I am having problems trying to write macros to navigate around
the various menus in mutt.
I have written key bindings for the index and pager menus so that
I can view my mailboxes like hypertext, almost like the vi-keys in
lynx. That is, 'j' is <next-entry>, 'k' is
<previous-entry>, 'l' is <select-entry>, and the idea is that 'h'
should return you to where you were in the higher menu. For
the pager, this means 'h' is <exit>.
For the index, to get 'h' to do the same thing, ie move from the
index to the mailbox menu in the directory browser, I wrote the
macro:
macro index h 'c?<Tab><Tab>'
The problem with this is that it returns to the first of the
mailboxes, not the mailbox I was viewing.
The way to get round this I think, is a macro that uses a script
to write to a file. Someone on the list wrote for me such a macro
when I wanted to step through my mailboxes in order with a single
keystroke.
The macro was similar to:
macro index I ':macro index \cXJ "c?\t\t\t`$HOME/.jayscript1;
$HOME/.jayscript2`"'\n\cXJl
This is supposed to be all on one line, of course. In
.jayscript1, we have:
#!/bin/bash
echo -n j >> $HOME/.jay
And in .jayscript2, we have:
#!/bin/bash
cat $HOME/.jay
echo
In .jay, we have a line of j's like this:
jjjjjjjjjjj
The first script adds another j to the line. The second script
cats this line, so that it ends up in the macro within a macro.
This has been working for a long time. There has been no problem
with it. But for the last couple of days, I have been trying to
write macros so that I can get 'h' to return me to the same
mailbox in the directory browser, as mentioned above. I have been
able to write a macro to use the second script to read .jay. It
is:
macro index h ':macro index \cXJ "c=\t\t\t`$HOME/.jayscript2`'\n\cXJ
I have not, however, been able to work out one to use the first
script to write j's to the line in .jay, when in the browser. In
particular, this one:
macro browser j "!~/.jayscript1\n<next-entry>"
returns in very strange places in the directory browser
mailbox menu. Does anyone have any ideas what I'm doing wrong?
And how do these macros within macros work? I don't really
understand the details.
--
Greg Matheson Learn a second language
Chinmin College, Taiwan and be born again almost
[EMAIL PROTECTED]