An empty string field value also means no field.
[pelican-mode.git] / pelican-mode.el
index fc9de9b..14d3472 100644 (file)
@@ -51,10 +51,12 @@ the unquoted printed representation of it is used:
 - `slug' means the file's path relative to the document root sans
   extension; see `pelican-default-slug'.
 
-- nil means return an empty string, without any name or value."
+- nil or an empty strings means return an empty string, without
+  any name or value."
   (setq value (pcase value
                 ('now (pelican-timestamp))
                 ('slug (pelican-default-slug))
+                ('"" nil)
                 (_ value)))
   (when (symbolp name)
     (setq name (string-remove-prefix ":" (symbol-name name))))
@@ -153,12 +155,12 @@ the unquoted printed representation of it is used:
 (defun pelican-update-date ()
   "Update a Pelican date header."
   (interactive)
-  (pelican-set-field "date" (pelican-timestamp)))
+  (pelican-set-field :date 'now))
 
 (defun pelican-publish-draft ()
   "Remove draft status from a Pelican post."
   (interactive)
-  (pelican-set-field "status" nil)
+  (pelican-remove-field :status)
   (pelican-update-date))
 
 (defun pelican-page-p ()