Leo <sdl....@gmail.com> 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


Reply via email to