From: Carsten Dominik <carsten.dominik@gmail.com>
To: Tassilo Horn <tassilo@member.fsf.org>
Cc: emacs-orgmode@gnu.org
Subject: Re: org-capture in message-mode buffer
Date: Tue, 24 May 2011 13:38:04 +0200 [thread overview]
Message-ID: <14FE40C9-9E73-4209-8A72-076F7373827D@gmail.com> (raw)
In-Reply-To: <87k4dgpdgx.fsf@member.fsf.org>
On May 24, 2011, at 1:35 PM, Tassilo Horn wrote:
> Carsten Dominik <carsten.dominik@gmail.com> writes:
>
>>> 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 ?
>
> Then no link will be created. Basically, that's what we'd like to have.
>
> But somehow my `called-interactively-p' check now always returns nil.
> I'm pretty sure it didn't when I tested my last patch. But according to
> its docs, the current behavior is correct. It should only check if the
> *containing* function was called interactively, not if its caller was
> called interactively.
>
> So I'd say the current behavior, i.e., erroring if there's no Gcc
> header, is correct and neither one of the two proposed patches shall be
> applied. Instead of making the low-level functions aware of their call
> context (an interactive org-store-link call called org-gnus-store-link
> vs. an interactive org-capture called org-store-link that in turn called
> org-gnus-store-link), the caller should be adapted to handle the error
> appropriately.
I agree.
>
> Here's a patch for the `org-capture' use case. I've tested it. In a
> message buffer without Gcc header, calling `org-store-link' will produce
> an error indicating the problem to the user. When called by
> `org-capture', the error is still produce but simply ignored so you
> still can capture. In that case, the %a format spec is empty.
Thanks!
- Carsten
>
> Bye,
> Tassilo
>
> --8<---------------cut here---------------start------------->8---
> From dbee3ff4f0a6584c4437af8ebff285babc87db30 Mon Sep 17 00:00:00 2001
> From: Tassilo Horn <tassilo@member.fsf.org>
> Date: Tue, 24 May 2011 13:29:53 +0200
> Subject: [PATCH 3/3] Ignore errors from link creation.
>
> 2011-05-24 Tassilo Horn <tassilo@member.fsf.org>
>
> * org-capture.el (org-capture): Ignore errors from link
> creation.
> ---
> lisp/org-capture.el | 2 +-
> 1 files changed, 1 insertions(+), 1 deletions(-)
>
> diff --git a/lisp/org-capture.el b/lisp/org-capture.el
> index 0af4529..ccfca75 100644
> --- a/lisp/org-capture.el
> +++ b/lisp/org-capture.el
> @@ -415,7 +415,7 @@ bypassed."
> (annotation (if (and (boundp 'org-capture-link-is-already-stored)
> org-capture-link-is-already-stored)
> (plist-get org-store-link-plist :annotation)
> - (org-store-link nil)))
> + (ignore-errors (org-store-link nil))))
> (initial (and (org-region-active-p)
> (buffer-substring (point) (mark))))
> (entry (org-capture-select-template keys)))
> --
> 1.7.5.rc3
>
> --8<---------------cut here---------------end--------------->8---
- Carsten
prev parent reply other threads:[~2011-05-24 11:38 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
2011-05-24 10:56 ` Carsten Dominik
2011-05-24 11:35 ` Tassilo Horn
2011-05-24 11:38 ` Carsten Dominik [this message]
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=14FE40C9-9E73-4209-8A72-076F7373827D@gmail.com \
--to=carsten.dominik@gmail.com \
--cc=emacs-orgmode@gnu.org \
--cc=tassilo@member.fsf.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).