From mboxrd@z Thu Jan 1 00:00:00 1970 From: Tassilo Horn Subject: Re: org-capture in message-mode buffer Date: Tue, 24 May 2011 12:41:14 +0200 Message-ID: <87oc2speid.fsf@member.fsf.org> References: <17DB4712-0BB8-4322-8CBF-368FDFD19222@gmail.com> Mime-Version: 1.0 Content-Type: text/plain Return-path: Received: from eggs.gnu.org ([140.186.70.92]:46254) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1QOp3I-0005cs-Gw for emacs-orgmode@gnu.org; Tue, 24 May 2011 06:41:29 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1QOp3H-0001Ve-97 for emacs-orgmode@gnu.org; Tue, 24 May 2011 06:41:28 -0400 Received: from lo.gmane.org ([80.91.229.12]:50889) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1QOp3G-0001VS-UZ for emacs-orgmode@gnu.org; Tue, 24 May 2011 06:41:27 -0400 Received: from list by lo.gmane.org with local (Exim 4.69) (envelope-from ) id 1QOp3F-0003k9-2E for emacs-orgmode@gnu.org; Tue, 24 May 2011 12:41:25 +0200 Received: from tsdh.uni-koblenz.de ([141.26.67.142]) by main.gmane.org with esmtp (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Tue, 24 May 2011 12:41:25 +0200 Received: from tassilo by tsdh.uni-koblenz.de with local (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Tue, 24 May 2011 12:41:25 +0200 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 Leo writes: Hi! >> is there an agreement here on whether the patch appearing in this >> thread >> >> http://patchwork.newartisans.com/patch/783/ >> >> should be applied or not? > > I don't really know. Ditto. :-) The problem is that creating a link to a message with no Gcc errors right now. For interactive use, that's the right thing, I guess. But of course preventing `org-capture' from working is bad. An alternative to the proposed patch is this: --8<---------------cut here---------------start------------->8--- diff --git a/lisp/org-gnus.el b/lisp/org-gnus.el index a5ece8b..bc5ab20 100644 --- a/lisp/org-gnus.el +++ b/lisp/org-gnus.el @@ -187,7 +187,8 @@ If `org-store-link' was called with a prefix arg the meaning of group newsgroups message-id x-no-archive)) (org-add-link-props :link link :description desc) link)) - ((eq major-mode 'message-mode) + ((and (eq major-mode 'message-mode) + (called-interactively-p)) (setq org-store-link-plist nil) ; reset (save-excursion (save-restriction --8<---------------cut here---------------end--------------->8--- If `org-store-link' is called interactively but no Gcc header is there, you get an error just like it is right now. But if it is called non-interactively through `org-capture', the condition fails and thus no org-gnus link is created, but a file link to your draft folder. One may argue that a file link is not the right thing, either. Basically, there should be a possibility to let the link creator functions return "yes, I was the right handler, but because of reason X, I couldn't create a link". Is there something like that? Bye, Tassilo