On 2013-03-12 12:53:56 -0500, David Champion wrote:
> To some degree you can do that now with $editor and edit-message, right?
> 
> set my_editor=$editor
> set editor="my-script %s"
> <edit>
> set editor="$my_editor"
> 
> my-script:
> #!/bin/sh
> sed -e 's/^X-Label: /' ...

But it is not possible to provide arguments, and the modified
message is marked as new.

Moreover, in case of error during the execution of the macro,
I suppose that the old $editor value will not be restored (I'm
thinking of the effect of ^G or ^C).

> However that's a workaround, and I see that this isn't really what
> you're asking about.  Perhaps a good approach would be use a generic
> filter_header function that can be easily hooked into any header or
> message attribute editing function.

Yes, or alternatively some kind of a mix between the edit and
pipe-message functions, say filter-message. So, one could define
a macro:

macro ... ": <filter-message>/path/to/script %s "

The user could add arguments after the %s. It could behave like <edit>
but without creating a new message.

-- 
Vincent Lefèvre <[email protected]> - Web: <http://www.vinc17.net/>
100% accessible validated (X)HTML - Blog: <http://www.vinc17.net/blog/>
Work: CR INRIA - computer arithmetic / AriC project (LIP, ENS-Lyon)

Reply via email to