emacs-orgmode@gnu.org archives
 help / color / mirror / code / Atom feed
From: Ulf Stegemann <ulf-news@zeitform.de>
To: emacs-orgmode@gnu.org
Subject: Re: Store link upon sending a message
Date: Fri, 12 Nov 2010 16:54:13 +0100	[thread overview]
Message-ID: <zf.upny68yy1ui.fsf@zeitform.de> (raw)
In-Reply-To: zf.upn39r6zj49.fsf@zeitform.de

Ulf Stegemann <ulf-news@zeitform.de> wrote:

> Eric S. Fraga <ucecesf@ucl.ac.uk> wrote:
>
>> Ulf Stegemann <ulf-news@zeitform.de> writes:
>>
>>> I came back to the matter of storing an org link to a copy of a message
>>> upon sending that message.  The function below does just that and proves
>>> to be quite useful together with a sensible key binding (if you use Gnus
>>> and Gcc that is).
>>
>> Very nice!  Works very well.  Thanks.
>>
>> Instead of binding this to a command sequence, is there any hook we can
>> attach the function to so that it's invoked for every message I send
>> (I'm somewhat of a gnus noob unfortunately although I'm learning...)?  I
>> ask because I alternative between =C-c C-c= and =C-c C-j= for sending
>> emails and I would need to provide two alternatives to incorporate your
>> function.
>
> hmmm, never thought of this, probably because I never use
> `gnus-delay-article'.  You could try to put the function into
> `message-send-hook' (but you should remove the call to
> `message-send-and-exit' first).  I don't know if this would work as I
> don't know if the Gcc magic (incl. removal of Gcc header) is done before
> or after that hook.  If the Gcc header has been removed when
> `message-send-hook' is called than you'll have to look for a different
> hook to use.  If the Gcc header is still present, it should probably
> work as expected but note that in that case the org link will be created
> before the actual copying of the message took place. If something goes
> wrong with the latter this will leave you with a bogus org link (which,
> however, is probably not much of a problem).

If the hook approach does not work you could also advise
`gnus-inews-do-gcc', the function that actually creates the message
copies ...

... or you could replace `gnus-inews-do-gcc', e.g. replace the
call to `message-send-and-exit' in
`ulf-message-send-and-org-gnus-store-link' with something like
`gnus-inews-do-gcc-orig' and save it as e.g.
`my-gnus-gcc-and-org-store-link'.  Then you could do something like

(fset 'gnus-inews-do-gcc-orig (symbol-function 'gnus-inews-do-gcc))
(fset 'gnus-inews-do-gcc 'my-gnus-gcc-and-org-store-link)

... but that's all untested ;)

Ulf

  parent reply	other threads:[~2010-11-12 15:54 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-10-01  9:11 Store link upon sending a message Ulf Stegemann
2010-10-01  9:58 ` Łukasz Stelmach
2010-10-01 10:56   ` Ulf Stegemann
2010-11-12 13:03     ` Ulf Stegemann
2010-11-12 13:58       ` Eric S Fraga
2010-11-12 14:55         ` Ulf Stegemann
2010-11-12 15:52           ` Eric S Fraga
2010-11-12 16:07             ` Ulf Stegemann
2010-11-12 16:20               ` Eric S Fraga
2010-11-12 15:54           ` Ulf Stegemann [this message]
2010-11-12 16:03             ` Eric S Fraga
2011-01-04 17:51       ` Bastien
2011-01-05  7:24         ` Ulf Stegemann
  -- strict thread matches above, loose matches on Subject: below --
2010-10-01  9:01 Ulf Stegemann

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=zf.upny68yy1ui.fsf@zeitform.de \
    --to=ulf-news@zeitform.de \
    --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).