org-rmail.el: Fix bug when storing and inserting a link.

* org-rmail.el (org-rmail-store-link, org-rmail-follow-link):
Toggle headers when necessary.

Thanks to T.F. Torrey for reporting this bug and for proposing a fix.
This commit is contained in:
Bastien Guerry 2012-08-07 12:09:33 +02:00
parent e2af881caf
commit 1f7263d6b1

View file

@ -52,6 +52,8 @@
(rmail-show-message rmail-current-message)) (rmail-show-message rmail-current-message))
(when (fboundp 'rmail-narrow-to-non-pruned-header) (when (fboundp 'rmail-narrow-to-non-pruned-header)
(rmail-narrow-to-non-pruned-header)) (rmail-narrow-to-non-pruned-header))
(when (eq rmail-header-style 'normal)
(rmail-toggle-header -1))
(let* ((folder buffer-file-name) (let* ((folder buffer-file-name)
(message-id (mail-fetch-field "message-id")) (message-id (mail-fetch-field "message-id"))
(from (mail-fetch-field "from")) (from (mail-fetch-field "from"))
@ -98,6 +100,8 @@
(setq message-number (setq message-number
(save-restriction (save-restriction
(widen) (widen)
(when (eq rmail-header-style 'normal)
(rmail-toggle-header -1))
(goto-char (point-max)) (goto-char (point-max))
(if (re-search-backward (if (re-search-backward
(concat "^Message-ID:\\s-+" (regexp-quote (concat "^Message-ID:\\s-+" (regexp-quote