瀏覽代碼

Merge branch 'master' of git+ssh://repo.or.cz/srv/git/org-mode

Dan Davison 14 年之前
父節點
當前提交
a8e9a52dfc
共有 8 個文件被更改,包括 91 次插入32 次删除
  1. 13 10
      doc/org.texi
  2. 14 12
      lisp/org-capture.el
  3. 8 3
      lisp/org-gnus.el
  4. 11 1
      lisp/org-mew.el
  5. 14 5
      lisp/org-mhe.el
  6. 10 0
      lisp/org-rmail.el
  7. 10 0
      lisp/org-vm.el
  8. 11 1
      lisp/org-wl.el

+ 13 - 10
doc/org.texi

@@ -6194,16 +6194,19 @@ similar way.}:
 @smallexample
 Link type          |  Available keywords
 -------------------+----------------------------------------------
-bbdb               |  %:name %:company
-bbdb               |  %::server %:port %:nick
-vm, wl, mh, rmail  |  %:type %:subject %:message-id
-                   |  %:from %:fromname %:fromaddress
-                   |  %:to   %:toname   %:toaddress
-                   |  %:fromto @r{(either "to NAME" or "from NAME")@footnote{This will always be the other, not the user.  See the variable @code{org-from-is-user-regexp}.}}
-gnus               |  %:group, @r{for messages also all email fields}
-w3, w3m            |  %:url
-info               |  %:file %:node
-calendar           |  %:date
+bbdb                    |  %:name %:company
+irc                     |  %:server %:port %:nick
+vm, wl, mh, mew, rmail  |  %:type %:subject %:message-id
+                        |  %:from %:fromname %:fromaddress
+                        |  %:to   %:toname   %:toaddress
+                        |  %:date @r{(message date header field)}
+                        |  %:date-timestamp @r{(date as active timestamp)}
+                        |  %:date-timestamp-inactive @r{(date as inactive timestamp)}
+                        |  %:fromto @r{(either "to NAME" or "from NAME")@footnote{This will always be the other, not the user.  See the variable @code{org-from-is-user-regexp}.}}
+gnus                    |  %:group, @r{for messages also all email fields}
+w3, w3m                 |  %:url
+info                    |  %:file %:node
+calendar                |  %:date
 @end smallexample
 
 @noindent

+ 14 - 12
lisp/org-capture.el

@@ -224,18 +224,20 @@ or gnus will record the author and the subject of the message, which you
 can access with \"%:from\" and \"%:subject\", respectively.  Here is a
 complete list of what is recorded for each link type.
 
-Link type          |  Available information
--------------------+------------------------------------------------------
-bbdb               |  %:type %:name %:company
-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 and
-                   |  %:org-date (the Date: header in Org format)
-w3, w3m            |  %:type %:url
-info               |  %:type %:file %:node
-calendar           |  %:type %:date"
+Link type               |  Available information
+------------------------+------------------------------------------------------
+bbdb                    |  %:type %:name %:company
+vm, wl, mh, mew, rmail  |  %:type %:subject %:message-id
+                        |  %:from %:fromname %:fromaddress
+                        |  %:to   %:toname   %:toaddress
+                        |  %:fromto (either \"to NAME\" or \"from NAME\")
+                        |  %:date
+                        |  %:date-timestamp (as active timestamp)
+                        |  %:date-timestamp-inactive (as inactive timestamp)
+gnus                    |  %:group, for messages also all email fields
+w3, w3m                 |  %:type %:url
+info                    |  %:type %:file %:node
+calendar                |  %:type %:date"
   :group 'org-capture
   :type
   '(repeat

+ 8 - 3
lisp/org-gnus.el

@@ -152,8 +152,11 @@ 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)))
+	   (date-ts (and date (format-time-string
+			       (org-time-stamp-format t) (date-to-time date))))
+	   (date-ts-ia (and date (format-time-string
+				  (org-time-stamp-format t t)
+				  (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)
@@ -170,8 +173,10 @@ If `org-store-link' was called with a prefix arg the meaning of
 	      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-date org-date
 			    :message-id message-id :group group :to to)
+      (when date
+	(org-add-link-props :date date :date-timestamp date-ts
+			    :date-timestamp-inactive date-ts-ia))
       (setq desc (org-email-link-description)
 	    link (org-gnus-article-link
 		  group	newsgroups message-id x-no-archive))

+ 11 - 1
lisp/org-mew.el

@@ -81,7 +81,7 @@
 		(mew-case-folder (mew-sinfo-get-case)
 				 (nth 1 (mew-refile-get msgnum)))
 	      (mew-summary-folder-name)))
-	   message-id from to subject desc link)
+	   message-id from to subject desc link date date-ts date-ts-ia)
       (save-window-excursion
 	(if (fboundp 'mew-summary-set-message-buffer)
 	    (mew-summary-set-message-buffer folder-name msgnum)
@@ -89,9 +89,19 @@
 	(setq message-id (mew-header-get-value "Message-Id:"))
 	(setq from (mew-header-get-value "From:"))
 	(setq to (mew-header-get-value "To:"))
+	(setq date (mew-header-get-value "Date:"))
+	(setq date-ts (and date (format-time-string
+				 (org-time-stamp-format t)
+				 (date-to-time date))))
+	(setq date-ts-ia (and date (format-time-string
+				    (org-time-stamp-format t t)
+				    (date-to-time date))))
 	(setq subject (mew-header-get-value "Subject:")))
       (org-store-link-props :type "mew" :from from :to to
 			    :subject subject :message-id message-id)
+      (when date
+	(org-add-link-props :date date :date-timestamp date-ts
+			    :date-timestamp-inactive date-ts-ia))
       (setq message-id (org-remove-angle-brackets message-id))
       (setq desc (org-email-link-description))
       (setq link (org-make-link "mew:" folder-name

+ 14 - 5
lisp/org-mhe.el

@@ -83,13 +83,22 @@ supported by MH-E."
   "Store a link to an MH-E folder or message."
   (when (or (equal major-mode 'mh-folder-mode)
 	    (equal major-mode 'mh-show-mode))
-    (let ((from (org-mhe-get-header "From:"))
-	  (to (org-mhe-get-header "To:"))
-	  (message-id (org-mhe-get-header "Message-Id:"))
-	  (subject (org-mhe-get-header "Subject:"))
-	  link desc)
+    (let* ((from (org-mhe-get-header "From:"))
+	   (to (org-mhe-get-header "To:"))
+	   (message-id (org-mhe-get-header "Message-Id:"))
+	   (subject (org-mhe-get-header "Subject:"))
+	   (date (org-mhe-get-header "Date:"))
+	   (date-ts (and date (format-time-string
+			       (org-time-stamp-format t) (date-to-time date))))
+	   (date-ts-ia (and date (format-time-string
+				  (org-time-stamp-format t t)
+				  (date-to-time date))))
+	   link desc)
       (org-store-link-props :type "mh" :from from :to to
 			    :subject subject :message-id message-id)
+      (when date
+	(org-add-link-props :date date :date-timestamp date-ts
+			    :date-timestamp-inactive date-ts-ia))
       (setq desc (org-email-link-description))
       (setq link (org-make-link "mhe:" (org-mhe-get-message-real-folder) "#"
 				(org-remove-angle-brackets message-id)))

+ 10 - 0
lisp/org-rmail.el

@@ -59,10 +59,20 @@
 	       (from (mail-fetch-field "from"))
 	       (to (mail-fetch-field "to"))
 	       (subject (mail-fetch-field "subject"))
+	       (date (mail-fetch-field "date"))
+	       (date-ts (and date (format-time-string
+				   (org-time-stamp-format t)
+				   (date-to-time date))))
+	       (date-ts-ia (and date (format-time-string
+				      (org-time-stamp-format t t)
+				      (date-to-time date))))
 	       desc link)
 	  (org-store-link-props
 	   :type "rmail" :from from :to to
 	   :subject subject :message-id message-id)
+	  (when date
+	    (org-add-link-props :date date :date-timestamp date-ts
+				:date-timestamp-inactive date-ts-ia))
 	  (setq message-id (org-remove-angle-brackets message-id))
 	  (setq desc (org-email-link-description))
 	  (setq link (org-make-link "rmail:" folder "#" message-id))

+ 10 - 0
lisp/org-vm.el

@@ -66,9 +66,19 @@
 	     (to (vm-get-header-contents message "To"))
 	     (from (vm-get-header-contents message "From"))
 	     (message-id (vm-su-message-id message))
+	     (date (vm-get-header-contents message "Date"))
+	     (date-ts (and date (format-time-string
+				 (org-time-stamp-format t)
+				 (date-to-time date))))
+	     (date-ts-ia (and date (format-time-string
+				    (org-time-stamp-format t t)
+				    (date-to-time date))))
 	     desc link)
 	(org-store-link-props :type "vm" :from from :to to :subject subject
 			      :message-id message-id)
+	(when date
+	  (org-add-link-props :date date :date-timestamp date-ts
+			      :date-timestamp-inactive date-ts-ia))
 	(setq message-id (org-remove-angle-brackets message-id))
 	(setq folder (abbreviate-file-name folder))
 	(if (and vm-folder-directory

+ 11 - 1
lisp/org-wl.el

@@ -140,7 +140,7 @@ folder name determines the the folder type."
   "Return content of FIELD in ENTITY.
 FIELD is a symbol of a rfc822 message header field.
 ENTITY is a message entity."
-  (let ((content (elmo-message-entity-field entity field)))
+  (let ((content (elmo-message-entity-field entity field 'string)))
     (if (listp content) (car content) content)))
 
 (defun org-wl-store-link ()
@@ -199,6 +199,13 @@ ENTITY is a message entity."
 		 (to (org-wl-message-field 'to wl-message-entity))
 		 (xref (org-wl-message-field 'xref wl-message-entity))
 		 (subject (org-wl-message-field 'subject wl-message-entity))
+		 (date (org-wl-message-field 'date wl-message-entity))
+		 (date-ts (and date (format-time-string
+				     (org-time-stamp-format t)
+				     (date-to-time date))))
+		 (date-ts-ia (and date (format-time-string
+					(org-time-stamp-format t t)
+					(date-to-time date))))
 		 desc link)
 
 	    ;; remove text properties of subject string to avoid possible bug
@@ -238,6 +245,9 @@ ENTITY is a message entity."
 	      (setq desc (org-email-link-description))
 	      (setq link (org-make-link "wl:" folder-name "#" message-id-no-brackets))
 	      (org-add-link-props :link link :description desc)))
+	    (when date
+	      (org-add-link-props :date date :date-timestamp date-ts
+				  :date-timestamp-inactive date-ts-ia))
 	    (or link xref)))))))
 
 (defun org-wl-open-nntp (path)