]> code.delx.au - gnu-emacs/blobdiff - lisp/org/org-rmail.el
Update copyright year to 2015
[gnu-emacs] / lisp / org / org-rmail.el
index ccfa59f5cf5da266bf6dcd45fb7621238929c89c..da515e29c49de8c4a00e2499eb0692b466f8f7e5 100644 (file)
@@ -1,6 +1,6 @@
 ;;; org-rmail.el --- Support for links to Rmail messages from within Org-mode
 
-;; Copyright (C) 2004-2014 Free Software Foundation, Inc.
+;; Copyright (C) 2004-2015 Free Software Foundation, Inc.
 
 ;; Author: Carsten Dominik <carsten at orgmode dot org>
 ;; Keywords: outlines, hypermedia, calendar, wp
 (defun org-rmail-follow-link (folder article)
   "Follow an Rmail link to FOLDER and ARTICLE."
   (require 'rmail)
-  (setq article (org-add-angle-brackets article))
+  (cond ((null article) (setq article ""))
+       ((stringp article)
+        (setq article (org-add-angle-brackets article)))
+       (t (user-error "Wrong RMAIL link format")))
   (let (message-number)
     (save-excursion
       (save-window-excursion
                (rmail-widen)
                (goto-char (point-max))
                (if (re-search-backward
-                    (concat "^Message-ID:\\s-+" (regexp-quote
-                                                 (or article "")))
+                    (concat "^Message-ID:\\s-+" (regexp-quote article))
                     nil t)
                    (rmail-what-message))))))
     (if message-number