emacs-orgmode@gnu.org archives
 help / color / mirror / code / Atom feed
* [PATCH] Fixes org-rmail-store-link
@ 2012-08-06  6:09 T.F. Torrey
  2012-08-07  3:19 ` Nick Dokos
  2012-08-07 10:10 ` Bastien
  0 siblings, 2 replies; 5+ messages in thread
From: T.F. Torrey @ 2012-08-06  6:09 UTC (permalink / raw)
  To: emacs-orgmode

[-- Attachment #1: Type: text/plain, Size: 1129 bytes --]

Hello all,

Attempting to save a link in an Rmail buffer fails with the error
"Wrong type argument: arrayp, nil".

Attempting to save a link in an Rmail buffer succeeds if all headers
are shown (by pressing T to toggle the display).

Attempting to save a link in an Rmail summary buffer always fails with
the same error, even if all headers are shown.

The error occurs because org-rmail-store-link attempts to get the
Message-ID header with mail-fetch-field, then remove the angle
brackets with org-remove-angle-brackets. However, without showing full
headers, Message-ID is hidden, and (mail-fetch-field "message-id)
returns nil. When this is passed to org-remove-angle-brackets, the
error is thrown.

The attached patch remedies this by toggling on the full header display
before getting the Message-ID.

Emacs  : GNU Emacs 24.1.50.1 (i686-pc-linux-gnu, GTK+ Version 3.4.2)
 of 2012-07-29 on doubah, modified by Debian

Package: Org-mode version 7.8.11 (release_7.8.11-360-g7c4ac5-git @ mixed
installation! /usr/local/share/emacs/site-lisp/ and
/home/tftorrey/.emacs.d/src/org-mode/lisp/)

Best to all,
Terry
-- 
T.F. Torrey


[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: Patch to fix org-rmail-store-link bug in org-rmail.el --]
[-- Type: text/x-diff, Size: 446 bytes --]

diff --git a/lisp/org-rmail.el b/lisp/org-rmail.el
index cb379d3..f8abbf4 100644
--- a/lisp/org-rmail.el
+++ b/lisp/org-rmail.el
@@ -52,6 +52,7 @@
 	  (rmail-show-message rmail-current-message))
 	(when (fboundp 'rmail-narrow-to-non-pruned-header)
 	  (rmail-narrow-to-non-pruned-header))
+	(rmail-toggle-header 0)
 	(let* ((folder buffer-file-name)
 	       (message-id (mail-fetch-field "message-id"))
 	       (from (mail-fetch-field "from"))

^ permalink raw reply related	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2012-08-10  5:04 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2012-08-06  6:09 [PATCH] Fixes org-rmail-store-link T.F. Torrey
2012-08-07  3:19 ` Nick Dokos
2012-08-08 21:16   ` T.F. Torrey
2012-08-07 10:10 ` Bastien
2012-08-08 21:19   ` T.F. Torrey

Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).