org-rmail.el (org-rmail-follow-link): Don't raise an error when no article is matched

* org-rmail.el (org-rmail-follow-link): Don't raise an error
when no article is matched.
This commit is contained in:
Bastien Guerry 2014-01-04 15:27:53 +01:00
parent 45b0d23b0c
commit e764dfe80b
1 changed files with 5 additions and 3 deletions

View File

@ -95,7 +95,10 @@
(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
@ -105,8 +108,7 @@
(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