Gnus development mailing list
 help / color / mirror / Atom feed
* proper hook for message body transform?
@ 2011-09-09 11:35 Eric Abrahamsen
  2011-09-09 11:46 ` Leo
  0 siblings, 1 reply; 4+ messages in thread
From: Eric Abrahamsen @ 2011-09-09 11:35 UTC (permalink / raw)
  To: ding

I hope someone can give me a little advice on a project I'm working on.
I'm trying to put tags into a message body that will "do things" to my
org-mode setup -- automatically create TODOs from sent messages, to be
specific. What I'd like to do is have a little text tag that sits in the
message composition buffer, and when the message is sent the tag itself
is stripped from the message, and the good stuff happens in a hook.

I tried looking at the mml package to see how they do it, but can't for
the life of me figure out which hook the mml functions are attached to:
the only hooks I see in the source code are those that are used to kill
the tags if the message is discarded (I think).

Does anyone have any words of wisdom for putting things in message
buffers that are then stripped (and other functions triggered) when the
message is sent? Neither `message-send-hook' nor
`message-send-mail-hook' has anything attached to it by default, which
makes me think there's some better way of doing this. Anyway, any
experience shared would be much appreciated!

Eric




^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: proper hook for message body transform?
  2011-09-09 11:35 proper hook for message body transform? Eric Abrahamsen
@ 2011-09-09 11:46 ` Leo
  2011-09-09 13:07   ` Eric Abrahamsen
  0 siblings, 1 reply; 4+ messages in thread
From: Leo @ 2011-09-09 11:46 UTC (permalink / raw)
  To: Eric Abrahamsen; +Cc: ding

On 2011-09-09 19:35 +0800, Eric Abrahamsen wrote:
> I hope someone can give me a little advice on a project I'm working on.
> I'm trying to put tags into a message body that will "do things"

Put a new header name (e.g. X-Org-Tags) in message-default-headers. Add
a message-send-hook that does whatever you want to do.

Leo

-- 
Your time is limited, so don’t waste it living someone else’s life.



^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: proper hook for message body transform?
  2011-09-09 11:46 ` Leo
@ 2011-09-09 13:07   ` Eric Abrahamsen
  2011-09-12  6:56     ` Reiner Steib
  0 siblings, 1 reply; 4+ messages in thread
From: Eric Abrahamsen @ 2011-09-09 13:07 UTC (permalink / raw)
  To: ding

On Fri, Sep 09 2011, Leo wrote:

> On 2011-09-09 19:35 +0800, Eric Abrahamsen wrote:
>> I hope someone can give me a little advice on a project I'm working on.
>> I'm trying to put tags into a message body that will "do things"
>
> Put a new header name (e.g. X-Org-Tags) in message-default-headers. Add
> a message-send-hook that does whatever you want to do.

Yes! I had the same idea, but it seemed conceptually wrong -- this
information is never leaving my local machine, and no mail servers or
mail recipients would ever know what to do with such a header. In that
case a removable tag in the message body seemed like the better choice.
I'll settle on message-send-hook as the one to use, but I guess I'll
have to experiment with both the tag and header routes before making a
decision.

Thanks!




^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: proper hook for message body transform?
  2011-09-09 13:07   ` Eric Abrahamsen
@ 2011-09-12  6:56     ` Reiner Steib
  0 siblings, 0 replies; 4+ messages in thread
From: Reiner Steib @ 2011-09-12  6:56 UTC (permalink / raw)
  To: ding

On Fri, Sep 09 2011, Eric Abrahamsen wrote:
> On Fri, Sep 09 2011, Leo wrote:
>> Put a new header name (e.g. X-Org-Tags) in message-default-headers. Add
>> a message-send-hook that does whatever you want to do.
>
> Yes! I had the same idea, but it seemed conceptually wrong -- this
> information is never leaving my local machine, and no mail servers or
> mail recipients would ever know what to do with such a header. 

See `message-ignored-mail-headers´ and `message-ignored-news-headers´.

Bye, Reiner.
-- 
       ,,,
      (o o)
---ooO-(_)-Ooo---  |  PGP key available  |  http://rsteib.home.pages.de/




^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2011-09-12  6:56 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2011-09-09 11:35 proper hook for message body transform? Eric Abrahamsen
2011-09-09 11:46 ` Leo
2011-09-09 13:07   ` Eric Abrahamsen
2011-09-12  6:56     ` Reiner Steib

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 NNTP newsgroup(s).