emacs-orgmode@gnu.org archives
 help / color / mirror / code / Atom feed
From: Tassilo Horn <tassilo@member.fsf.org>
To: emacs-orgmode@gnu.org
Subject: Re: org-capture in message-mode buffer
Date: Tue, 24 May 2011 12:41:14 +0200	[thread overview]
Message-ID: <87oc2speid.fsf@member.fsf.org> (raw)
In-Reply-To: m1k4dg699c.fsf@th041094.ip.tsinghua.edu.cn

Leo <sdl.web@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	other threads:[~2011-05-24 10:41 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-05-04 12:26 org-capture in message-mode buffer Leo
2011-05-04 13:14 ` Ulf Stegemann
2011-05-04 14:36   ` Leo
2011-05-05  7:02     ` Ulf Stegemann
2011-05-05  7:59       ` Leo
2011-05-05  8:09         ` Leo
2011-05-05  9:19         ` Ulf Stegemann
2011-05-08  7:53           ` Leo
2011-05-24  3:19             ` Carsten Dominik
2011-05-24  3:57               ` Leo
2011-05-24 10:41                 ` Tassilo Horn [this message]
2011-05-24 10:56                   ` Carsten Dominik
2011-05-24 11:35                     ` Tassilo Horn
2011-05-24 11:38                       ` Carsten Dominik

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://www.orgmode.org/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=87oc2speid.fsf@member.fsf.org \
    --to=tassilo@member.fsf.org \
    --cc=emacs-orgmode@gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).