From mboxrd@z Thu Jan 1 00:00:00 1970 From: Ulf Stegemann Subject: Re: org-capture in message-mode buffer Date: Thu, 05 May 2011 11:19:05 +0200 Message-ID: References: Mime-Version: 1.0 Content-Type: text/plain Return-path: Received: from eggs.gnu.org ([140.186.70.92]:58440) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1QHuiS-0001M3-4g for emacs-orgmode@gnu.org; Thu, 05 May 2011 05:19:25 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1QHuiQ-0003oT-I3 for emacs-orgmode@gnu.org; Thu, 05 May 2011 05:19:24 -0400 Received: from lo.gmane.org ([80.91.229.12]:32851) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1QHuiQ-0003nv-8K for emacs-orgmode@gnu.org; Thu, 05 May 2011 05:19:22 -0400 Received: from list by lo.gmane.org with local (Exim 4.69) (envelope-from ) id 1QHuiO-0006RL-1i for emacs-orgmode@gnu.org; Thu, 05 May 2011 11:19:20 +0200 Received: from london.zeitform.net ([146.140.213.100]) by main.gmane.org with esmtp (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Thu, 05 May 2011 11:19:20 +0200 Received: from ulf-news by london.zeitform.net with local (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Thu, 05 May 2011 11:19:20 +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 wrote: > On 2011-05-05 15:02 +0800, Ulf Stegemann wrote: >> Hmmm, is it? Suppose that linking to a message yet to be archived >> wouldn't be there, then `org-store-link' will tell you `org-store-link: >> Cannot link to a buffer which is not visiting a file' when called in a >> message buffer (like in any other non-file buffer). > > When I call org-capture in any buffer not visiting any file except in > message mode, I don't get any error. I see. That seems to be the very real problem, no? >>> I also dislike the fact that it inserts the Message-Id header. >> >> As the org link to Gnus messages consists of the group and the message >> id the latter one is need (as is the first one, the Gcc header). No >> reliable message id, no org link. One may argue if it's a good idea to >> generate the message id when calling `org-store-link' but I think it's a >> fair tradeoff to accept this in order to get the link to the message yet >> to be archived. > > If that depends on the Gcc header being available, it should check it > and do nothing when users does not use one. We are really talking about `org-gnus-store-link' here. The whole purpose of that function is to create an org link. I do not agree that this function should silently do nothing when there's no Gcc header present. If the function fails to do what it is meant to do, it should throw an error. Another story is if `org-capture' should fail only because `org-gnus-store-link' (which it called) fails. There are pros and cons. I agree that it may be annoying to not be able to org-capture something from within a message buffer. OTOH, there may be scenarios where an error message is helpful because you otherwise would think you've created a link with your capture but in fact haven't. >>> Also, the stored link may be useless unless it is referenced in the >>> template chosen by the user. >> >> Hmmm, I'm not quite sure what your scenario is here. If you dislike the >> behaviour of `org-store-link' in message mode and furthermore do not >> want to store a link at all since your template does not use it, why do >> you call `org-capture' from the message mode buffer at all? > > That seems like a very strange question. The only reason to have a > global keybinding to org-capture is so that one can invoke it anywhere > anytime. For example, while composing a new mail I might have a great > idea I want to add to my Notes but I don't care where I invoke > org-capture as illustrated by the template I use: > > ("n" "Notes" entry (file "Notes.org") "* %?\n %i" :prepend t) Okay, I see. This does not address the real problem but as a workaround you could have something like --8<------------------cut here----------------start---------------->8--- emacsclient -e '(org-capture nil "n")' --8<------------------cut here-----------------end----------------->8--- and bind it to a window manager shortcut. This will allow you to take a note even when you're not in emacs ... and of course also when in emacs/message mode. > BTW, the reason I have stopped using Gcc (long ago) is that I have gmail > to do archiving for me. It is accessible anytime anywhere and not tied > to a specific machine. This sounds interesting (at least for those that use gmail). Is the URL where the archived message will be available predictable, i.e. is it possible to know it while still composing the message? If yes, it would be great to expand `org-gnus-store-link' to either use a Gnus archive group (Gcc) or a gmail one. Leo wrote: > On 2011-05-05 15:59 +0800, Leo wrote: >> I believe the following patch is due. > > Think about it some more, there is a reason to signal an error when > calling org-store-link interactively but it should not when invoked by > org-capture. Otherwise it will get in the way. I tend to agree but am not completely sure (s.a.). Ulf