From mboxrd@z Thu Jan 1 00:00:00 1970 From: "Andrew J. Korty" Subject: Bug: org-mhe creates corrupt link when Message-ID field contains newline [7.01trans] Date: Wed, 15 Sep 2010 10:21:18 -0400 Message-ID: <30477.1284560478@iu.edu> Content-Type: text/plain; charset=utf-8; format=flowed Return-path: Received: from [140.186.70.92] (port=55917 helo=eggs.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1OvsrU-00023U-Lb for emacs-orgmode@gnu.org; Wed, 15 Sep 2010 10:21:29 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.69) (envelope-from ) id 1OvsrP-0003bG-Pf for emacs-orgmode@gnu.org; Wed, 15 Sep 2010 10:21:24 -0400 Received: from singsing.itso.iu.edu ([149.166.143.49]:46927) by eggs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1OvsrP-0003b7-Kq for emacs-orgmode@gnu.org; Wed, 15 Sep 2010 10:21:19 -0400 Received: from iu.edu (149-166-143-228.dhcp-in.iupui.edu [149.166.143.228]) by singsing.itso.iu.edu (Postfix) with ESMTPA id AA0CE239242 for ; Wed, 15 Sep 2010 14:20:52 +0000 (UTC) List-Id: "General discussions about Org-mode." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: emacs-orgmode-bounces+geo-emacs-orgmode=m.gmane.org@gnu.org Errors-To: emacs-orgmode-bounces+geo-emacs-orgmode=m.gmane.org@gnu.org To: emacs-orgmode@gnu.org Some MUAs insert a newline when rendering the Message-ID field: Message-ID: <98A78083733DE040834C2B9E91B87FDE0AADEB@example.com> The newline causes org-mhe-store-link to create a link that looks like [[mhe:%2Barchive# %20<98A78083733DE040834C2B9E91B87FDE0AADEB@example.com][subject]] org later treats the above as separate lines; any tags or properties added end up in the middle of the link. The following patch removes whitespace at the beginning of all header fields returned by org-mhe-get-header, correcting this problem and possibly others. Andrew Korty --- lisp/org-mhe.el | 2 +- 1 files changed, 1 insertions(+), 1 deletions(-) diff --git a/lisp/org-mhe.el b/lisp/org-mhe.el index 46340be..6810359 100644 --- a/lisp/org-mhe.el +++ b/lisp/org-mhe.el @@ -181,7 +181,7 @@ you have a better idea of how to do this then please let us know." (if (equal major-mode 'mh-folder-mode) (mh-show) (mh-show-show)) - header-field))) + (replace-regexp-in-string "^\\s-+" "" header-field)))) (defun org-mhe-follow-link (folder article) "Follow an MH-E link to FOLDER and ARTICLE. -- 1.7.2.3 Emacs : GNU Emacs 23.1.50.1 (x86_64-apple-darwin10.0.0, NS apple-appkit-1038.11) of 2009-11-10 on phrygian Package: Org-mode version 7.01trans