<<< Date Index >>>     <<< Thread Index >>>

Re: Patch for "tag-prefix and macros" bug



On Mon, Feb 02, 2004 at 09:03:37AM +0100, Nicolas Rachinsky wrote:
> * Lionel Elie Mamane <lionel@xxxxxxxxx> [2004-02-02 07:56 +0100]:
>> On Mon, Feb 02, 2004 at 03:08:27AM +0100, Nicolas Rachinsky wrote:

>>>> ######## DO NOT RUN THIS EXAMPLE ON A MAILBOX WITH REAL MAIL ########
>>>> macro index \047 "D.\n$y" "delete all"
>>>> macro index <F2> "<tag-prefix-cond><pipe-entry>echo 
>>>> '<end-cond>'\n<pipe-entry>echo foo\n" "Silly test of <end-cond>"

>>> OK, I want to have a macro to copy a mail to /tmp/<End>, a perfectly
>>> legal use (but not that sensible, of course).  'macro index
>>> . "C/tmp/<End>\n"' seems the obvious solution, but try it

>> Indeed, it doesn't work. Note that 

>> macro index . "C/tmp/<pipe-entry>\n"

>> works as expected, though. I would have to look at the code to explain
>> this in detail.

> BTW: 'macro index . "C/tmp/<end-cond>\n"' works, too. Are you sure
> your demo macro works as described?

Yes, I am: I tried it out.

> I have tried it, and it does not sync the mailbox (but delete the
> message inside. really strange).

Possibly because "y" is not a positive answer in your locale? You
might be using, e.g. a german locale, in which case the 'y' must be
replaced by a 'j'.

>>> I don't think that mutt has the concept of an argument to a function
>>> in macros.

>> Yes, yes, that's the root of the problem. But that's how someone
>> writing a macro thinks about it.

> But then you have to fix the macro writers, or, since you can't do
> this directly, the documentation.

:)

>>> That would be really much work.

>> <grin>

> What about my (deleted by you) proposal? <foo> to execute the
> command foo, and e.g. <<foo> to get <foo>?

I have no comment on it at this stage. I'll take a closer look at it
later.

-- 
Lionel