;;; org-rmail.el --- Support for links to Rmail messages from within Org-mode
-;; Copyright (C) 2004, 2005, 2006, 2007, 2008 Free Software Foundation, Inc.
+;; Copyright (C) 2004-2011 Free Software Foundation, Inc.
;; Author: Carsten Dominik <carsten at orgmode dot org>
;; Keywords: outlines, hypermedia, calendar, wp
;; Homepage: http://orgmode.org
-;; Version: 6.15a
+;; Version: 7.4
;;
;; This file is part of GNU Emacs.
;;
(require 'org)
;; Declare external functions and variables
-(declare-function rmail-narrow-to-non-pruned-header "rmail" ())
(declare-function rmail-show-message "rmail" (&optional n no-summary))
(declare-function rmail-what-message "rmail" ())
(defvar rmail-current-message)
(save-restriction
(when (eq major-mode 'rmail-summary-mode)
(rmail-show-message rmail-current-message))
- (rmail-narrow-to-non-pruned-header)
+ (when (fboundp 'rmail-narrow-to-non-pruned-header)
+ (rmail-narrow-to-non-pruned-header))
(let* ((folder buffer-file-name)
(message-id (mail-fetch-field "message-id"))
(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))
(provide 'org-rmail)
-;; arch-tag: c6cf4a8b-6639-4b7f-821f-bdf10746b173
;;; org-rmail.el ends here