From mboxrd@z Thu Jan 1 00:00:00 1970 From: Leo Subject: Re: org-capture in message-mode buffer Date: Thu, 05 May 2011 15:59:15 +0800 Message-ID: References: Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Return-path: Received: from eggs.gnu.org ([140.186.70.92]:56064) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1QHtTC-0005I2-Io for emacs-orgmode@gnu.org; Thu, 05 May 2011 03:59:35 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1QHtTB-0007S1-JD for emacs-orgmode@gnu.org; Thu, 05 May 2011 03:59:34 -0400 Received: from lo.gmane.org ([80.91.229.12]:51456) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1QHtTB-0007Ru-8M for emacs-orgmode@gnu.org; Thu, 05 May 2011 03:59:33 -0400 Received: from list by lo.gmane.org with local (Exim 4.69) (envelope-from ) id 1QHtT7-0001nr-U3 for emacs-orgmode@gnu.org; Thu, 05 May 2011 09:59:29 +0200 Received: from 123.114.52.195 ([123.114.52.195]) by main.gmane.org with esmtp (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Thu, 05 May 2011 09:59:29 +0200 Received: from sdl.web by 123.114.52.195 with local (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Thu, 05 May 2011 09:59:29 +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 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 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. >> 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? > > Ulf 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) 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. I believe the following patch is due. Leo diff --git a/lisp/org-gnus.el b/lisp/org-gnus.el index eba4cb44..7290f1c6 100644 --- a/lisp/org-gnus.el +++ b/lisp/org-gnus.el @@ -187,7 +187,8 @@ (defun org-gnus-store-link () 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) + (message-fetch-field "gcc")) (setq org-store-link-plist nil) ; reset (save-excursion (save-restriction