From mboxrd@z Thu Jan 1 00:00:00 1970 From: Carsten Dominik Subject: Re: org-capture in message-mode buffer Date: Tue, 24 May 2011 12:56:00 +0200 Message-ID: References: <17DB4712-0BB8-4322-8CBF-368FDFD19222@gmail.com> <87oc2speid.fsf@member.fsf.org> Mime-Version: 1.0 (Apple Message framework v1084) Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: quoted-printable Return-path: Received: from eggs.gnu.org ([140.186.70.92]:57033) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1QOpHQ-0008A6-N4 for emacs-orgmode@gnu.org; Tue, 24 May 2011 06:56:05 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1QOpHP-0004Du-Ix for emacs-orgmode@gnu.org; Tue, 24 May 2011 06:56:04 -0400 Received: from mail-ew0-f41.google.com ([209.85.215.41]:47451) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1QOpHP-0004Dg-Bx for emacs-orgmode@gnu.org; Tue, 24 May 2011 06:56:03 -0400 Received: by ewy9 with SMTP id 9so2454104ewy.0 for ; Tue, 24 May 2011 03:56:02 -0700 (PDT) In-Reply-To: <87oc2speid.fsf@member.fsf.org> 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: Tassilo Horn Cc: emacs-orgmode@gnu.org On May 24, 2011, at 12:41 PM, Tassilo Horn wrote: > Leo writes: >=20 > Hi! >=20 >>> is there an agreement here on whether the patch appearing in this >>> thread >>>=20 >>> http://patchwork.newartisans.com/patch/783/ >>>=20 >>> should be applied or not? >>=20 >> I don't really know. >=20 > Ditto. :-) >=20 > 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. >=20 > An alternative to the proposed patch is this: >=20 > --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--- >=20 > 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. >=20 > 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? What happens if you return t in this case, without calling = org-store-link-props ? Regards - Carsten=