Explorar o código

Allow %:org-date for Gnus links.

* org-capture.el (org-capture-templates): update docstring
to advertize %:org-date.

* org-remember.el (org-remember-templates): update docstring
to advertize %:org-date.

* org-gnus.el (org-gnus-store-link): define %:org-date.

This was suggested by Sébastien Vauban.
Bastien Guerry %!s(int64=14) %!d(string=hai) anos
pai
achega
d821c54aab
Modificáronse 3 ficheiros con 8 adicións e 3 borrados
  1. 2 1
      lisp/org-capture.el
  2. 4 1
      lisp/org-gnus.el
  3. 2 1
      lisp/org-remember.el

+ 2 - 1
lisp/org-capture.el

@@ -231,7 +231,8 @@ vm, wl, mh, rmail  |  %:type %:subject %:message-id
                    |  %:from %:fromname %:fromaddress
                    |  %:to   %:toname   %:toaddress
                    |  %:fromto (either \"to NAME\" or \"from NAME\")
-gnus               |  %:group, for messages also all email fields
+gnus               |  %:group, for messages also all email fields and
+                   |  %:org-date (the Date: header in Org format)
 w3, w3m            |  %:type %:url
 info               |  %:type %:file %:node
 calendar           |  %:type %:date"

+ 4 - 1
lisp/org-gnus.el

@@ -152,6 +152,8 @@ If `org-store-link' was called with a prefix arg the meaning of
 	   (from (mail-header-from header))
 	   (message-id (org-remove-angle-brackets (mail-header-id header)))
 	   (date (mail-header-date header))
+	   (org-date (format-time-string 
+		      (cdr org-time-stamp-formats) (date-to-time date)))
 	   (subject (copy-sequence (mail-header-subject header)))
 	   (to (cdr (assq 'To (mail-header-extra header))))
 	   newsgroups x-no-archive desc link)
@@ -167,7 +169,8 @@ If `org-store-link' was called with a prefix arg the meaning of
 	(setq to (or to (gnus-fetch-original-field "To"))
 	      newsgroups (gnus-fetch-original-field "Newsgroups")
 	      x-no-archive (gnus-fetch-original-field "x-no-archive")))
-      (org-store-link-props :type "gnus" :from from :subject subject :date date
+      (org-store-link-props :type "gnus" :from from :subject subject 
+			    :date date :org-date org-date
 			    :message-id message-id :group group :to to)
       (setq desc (org-email-link-description)
 	    link (org-gnus-article-link

+ 2 - 1
lisp/org-remember.el

@@ -167,7 +167,8 @@ vm, wl, mh, rmail  |  %:type %:subject %:message-id
                    |  %:from %:fromname %:fromaddress
                    |  %:to   %:toname   %:toaddress
                    |  %:fromto (either \"to NAME\" or \"from NAME\")
-gnus               |  %:group, for messages also all email fields
+gnus               |  %:group, for messages also all email fields and
+                   |  %:org-date (the Date: header in Org format)
 w3, w3m            |  %:type %:url
 info               |  %:type %:file %:node
 calendar           |  %:type %:date"