From: Frédéric Perrin Date: Tue, 2 Apr 2024 19:25:00 +0000 (+0100) Subject: Add published propety X-Git-Url: http://gitweb.fperrin.net/?p=atom.el.git;a=commitdiff_plain;h=HEAD Add published propety --- diff --git a/atom-tests.el b/atom-tests.el index 941580a..c822f25 100644 --- a/atom-tests.el +++ b/atom-tests.el @@ -118,7 +118,8 @@ "http://example.org/text" "Some text" (list :updated (atom-parse-time "2024-03-23T01:02:04+0400") - :summary "summary")) + :published (atom-parse-time "2024-03-23T01:02:04+0400") + :summary "Summary")) (atom-add-html-entry my-atom-feed "A HTLM entry" diff --git a/atom.el b/atom.el index caca05c..34111c1 100644 --- a/atom.el +++ b/atom.el @@ -124,8 +124,7 @@ PROPS is an optional plist with the following properties: - :summary, if is not given, the entry will not contain any summary. -- :updated defaults to `(current-time)' if omitted, which is -probably not a very good default. +- :updated defaults to `(current-time)'. - :published, if given, is the earliest availability of the entry. It is optional, and shouldn't change even if the entry @@ -138,6 +137,8 @@ probably not a very good default. (atom-modify-entry entry 'link (list (list (cons 'href link)))) (atom-modify-entry entry 'id (or (plist-get props :id) link)) (atom-modify-entry entry 'updated (atom-format-time (plist-get props :updated))) + (if (plist-member props :published) + (atom-modify-entry entry 'published (atom-format-time (plist-get props :published)))) (if (plist-member props :summary) (atom-modify-entry entry 'summary (plist-get props :summary))) (atom-modify-entry entry 'content content)