From mboxrd@z Thu Jan 1 00:00:00 1970 From: tftorrey@tftorrey.com (T.F. Torrey) Subject: [PATCH] Fixes org-rmail-store-link Date: Mon, 06 Aug 2012 00:09:25 -0600 Message-ID: <87txwgsga2.fsf@lapcat.tftorrey.com> Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="=-=-=" Return-path: Received: from eggs.gnu.org ([208.118.235.92]:60325) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1SyXHz-000561-6b for emacs-orgmode@gnu.org; Mon, 06 Aug 2012 20:04:47 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1SyXHx-00016v-UW for emacs-orgmode@gnu.org; Mon, 06 Aug 2012 20:04:47 -0400 Received: from relay3-d.mail.gandi.net ([217.70.183.195]:50420) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1SyXHx-00016f-N5 for emacs-orgmode@gnu.org; Mon, 06 Aug 2012 20:04:45 -0400 Received: from mfilter6-d.gandi.net (mfilter6-d.gandi.net [217.70.178.135]) by relay3-d.mail.gandi.net (Postfix) with ESMTP id DB1F4A807A for ; Tue, 7 Aug 2012 02:04:44 +0200 (CEST) Received: from relay3-d.mail.gandi.net ([217.70.183.195]) by mfilter6-d.gandi.net (mfilter6-d.gandi.net [10.0.15.180]) (amavisd-new, port 10024) with ESMTP id 3NowNd4hz87X for ; Tue, 7 Aug 2012 02:04:43 +0200 (CEST) Received: from lapcat.tftorrey.com.tftorrey.com (unknown [74.43.103.44]) (Authenticated sender: tftorrey@tftorrey.com) by relay3-d.mail.gandi.net (Postfix) with ESMTPSA id A6082A807D for ; Tue, 7 Aug 2012 02:04:42 +0200 (CEST) List-Id: "General discussions about Org-mode." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-orgmode-bounces+geo-emacs-orgmode=m.gmane.org@gnu.org Sender: emacs-orgmode-bounces+geo-emacs-orgmode=m.gmane.org@gnu.org To: emacs-orgmode@gnu.org --=-=-= Content-Type: text/plain 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 --=-=-= Content-Type: text/x-diff Content-Disposition: inline; filename=org-rmail.el.diff Content-Description: Patch to fix org-rmail-store-link bug in org-rmail.el 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")) --=-=-=--