source /etc/mutt/indexhooks.pl| documentation bug.
I have this perl program to write folder hooks so I can return to the same place in the mailboxes screen from the index screen, instead of always to the first line: #!/usr/bin/perl use strict; my @mailboxes = glob("Mail/*"); foreach my $mailbox ( @mailboxes ) { $mailbox =~ s/^ Mail\/ (.*)$/=$1/x; print qq{folder-hook $mailbox 'macro index h ?$mailbox'\n}; } I source it in /etc/Muttrc with this line: source /etc/mutt/indexhooks.pl|/ to put output into Muttrc, following the direction in the manual, If the filename ends with a vertical bar (|), then filename is considered to be an executable program from which to read input (eg. source ~bin/myscript|/). but I was getting this error: Error in /etc/Muttrc, line 709: /etc/mutt/indexhooks.pl|/: No such file or directory source: errors in /etc/Muttrc Press any key to continue... I then took off the final slash, and it started working. So, I think this is a documentation bug. However, this is on cygwin, so perhaps it is an idiosyncracy of cygwin, rather than a documentation bug.
Quoting from email other than the one you're replying to
The discussion of how to access in your editor mail in your folders other than the one mutt gave you when it put you into the editor seems to have died away, but before everyone forgets about it, I want to say that for people who don't have a GUI, you can still have windows/screens to cut and paste from. Check out screen, from these links: Sven Guckes [EMAIL PROTECTED] ---screen-3.9.9 SCREEN MailList http://www.yahoogroups.com/group/gnu-screen/ [010525] SCREEN UserPage http://www.math.fu-berlin.de/~guckes/screen/user.html SCREEN SetupFile http://www.math.fu-berlin.de/~guckes/setup/screenrc The other thing is, there is a vim script called mailbrowser.vim, which is now on http://vim.sourceforge.net "[25-Jul-2001] mailbrowser.vim : Browse Berkeley mbox format mailbox files (1.1) Silenced some unwanted messages. Added flag for "New" (unread) mail to the index. :SMail now works to always split mail browser into new window - Mark Waggoner " This opens up an index of an mbox folder in vim, and you can browse in it and select from it. The email appears in another buffer. "This script allows you to browse (read) email from a standard Berkeley mbox formatted mail file. When you type :Mail or :Mail , it will scan the file for headers, extract them, and present you with a list of the mail items present in the file. You can easily select mail items to view. It does not (as yet) allow you to send mail in any form, or to delete mail from the mailbox. " I just found it and am excited about it. However, it is for vim-6.0, which is still alpha, and if you compile vim with multibyte, a non-ASCII marker placed in the index breaks it, at least in my case. But you can munge this. -- Greg MathesonThose who can do. Chinmin College, Those who can't operate. Taiwan --G B Shaw
Re: Browser.c
On Thu, 26 Jul 2001, Nelson D. Guerrero wrote: > I've been wanting, for a long time now, to view in my browser > only the folders I have specified in my muttrc like when you > run mutt with -y or like when you press . That's the function of the mailbox screen, which is already there. Do you want to tear out the browser? > I was looking into browser.c and started editting (without > having any knowledge whatsoever in c) to see if I could in > fact put it that way. While you are hacking away, try to make the mailbox screen hierarchical like the Unix directory structure is. That is, can you make it so you have one set of mailboxes in one screen and another set in another screen? ;-) If these mailboxes have to be in different directories that is OK. I have 125 students and I have one mailbox for each of their individual lists of their mail their penpals, and another for the error messages from each of these lists. I think there are more I can't remember at the moment. They are also in class groups with different maillists. That makes more than 300 mailboxes. I don't want to work with limits in the index screen. But there are too many mailboxes for the mailbox screen! At the moment I have wrappers around mutt that rewrite the .muttrc mailboxes line for each of these three groups of mailbox, as well as writing macros to work through the mailbox screen. And I open three separate instances of mutt. But the amount of perl I learned doing this was phenomenal. And they are still difficult to use. What I want is to have a key like change folders in the index screen. You can use this to change from one mailfolder to another. But instead what I want to do is change mailbox screens. I then can move around in a separate set of mailboxes. Think what it would be like without directories in Unix. Everything would be all messed up. Or think about having all of your mail in one folder. The single mailbox screen has the same problem. The 3-deep hierarchy of mutt is too limiting. Three levels of Unix directories would not be enough. The 3-level mailbox-index-pager classification also needs to be extended at the top end. -- Greg Matheson Learn a third language and Chinmin College,be born again, again. Taiwan
Re: Getting current folder name
On Thu, 26 Jul 2001, Kai Weber wrote: > Hi, > I am searching for a way to get the current selected folder for > scripting. I want something like this: > folder-hook . source $MATCHED_FOLDER.rc > Depending on what folder I entered, I want to know what folder that > was. While you're doing that, find out what the name of the currently-edited (or last edited) message is ;-) That is to say, I don't think you can do that. These would have to be environmental variables set by mutt, and I don't think mutt sets any of these. However, you can use "-" to return to the previous folder on the command, so perhaps you could use that in .muttrc, like you can use "!" to set mailboxes. -- Greg MathesonThere is nothing as good as a Chinmin College, practical theory. Taiwan --Kurt Lewin's practicality maxim corollary
Re: About quoting text, about emacs.
On Wed, 25 Jul 2001, Dominique Pelle wrote: > On Wed, Jul 25, 2001 at 03:05:58PM +0200, Jens Paulus > ([EMAIL PROTECTED]) wrote: > [...cut...] > > 1.) Editing an email with vim/mutt, I sometimes wish to insert/quote > > text from another email that I'm not currently replying to. > [...cut...] > How about attaching another mail to the email you want > to send? > >From the send menu (before sending your email), press > 'A' (uppercase A bound to the attach-message function) > to attach another mail. This puts the messages you tag in a separate attachment, rather than in the body of the text you are now editing. However you CAN pipe them in this special attach-message screen to cat, to add them to the end of the message you are now editing, IF you know the name of the temporary file your editor is editing the message under. This can be all made 2 macros: one to rename the temporary file to a standard name, and open the attach-message screen and the second one to cat them to this newly named temporary file. However, when I lost these macros, I never rewrote them. I just copy the stuff I want to add to a temporary folder and then read it in my editor again. I think the best answer of how to do this without opening a second instance of mutt and cutting and pasting is to write some function to do it in your editor, or use something like readmsg. -- Greg MathesonRather than doing things right, Chinmin College, Doing the right thing. Taiwan
Re: About quoting text, about emacs.
On Wed, 25 Jul 2001, John Arundel wrote: > On 2001-07-25 at 15:05:58, Jens Paulus warbled: > > 1.) Editing an email with vim/mutt, I sometimes wish to insert/quote > > text from another email that I'm not currently replying to. > If there is a smart way to do this in mutt, I don't know it. I normally > just: > * Exit the editor > * Postpone the mail with Shift-P > * Go find the mail I want to quote > * Hit 'reply' to quote the text > * Select the text in xterm (or with screen's copy function) > * Recall the postponed mail > * Paste in There is a perl module called Mail::Folder that has subroutines for reading from mbox and maildir folders. You have to specify the number of the message in the folder. This makes it easy, if you know some perl, to write a little perl script that you could use in vim, like: :r !readmsg.pl Inbox 4 But the old elm readmsg had the capability of pattern searching, as well. Another approach would be to write a vim function. You would have to divide up a mbox folder file on the basis of /^From / lines, for example. I have to investigate the perl Mail::Folder approach. -- Greg MathesonRather than do things right, Chinmin College, Do the right thing. Taiwan
another pattern parsing question (was Re: Pattern parsing bug
I am using pattern parsing to order my index screens, scoring on a header I write to incoming mails with procmail. I have 125 students sending me mail from all over and I want the mail to be ordered in the index screen by their student ID number so it is easy to transfer grades to the grade book. I wanted to use a custom header like Student-ID: to avoid messing with information in the emails and so when I unignore the header it only shows for messages from my students. But mutt won't let me. I have to use the Sender: header. Procmail uses a table of email addresses and student IDs to write the student ID (actually school email addresses) in the email. In .muttrc, I have a series of lines of the form: score "~e s.7.@ms1" 20 score "~e s.8.@ms1" 10 score "~e s.9.@ms1" 00 score "~e s..0@ms1" 9 score "~e s..1@ms1" 8 score "~e s..2@ms1" 7 This works OK, except for the inelegance above, when I hit 'o' and 'c' in the index screen. I was getting "not supported in this mode" messages for the following: ~B EXPR messages which contain EXPR in the whole message ~h EXPR messages which contain EXPR in the message header I had to use: ~e EXPR message which contains EXPR in the ``Sender'' field I've forgotten what version this was. Could have been 0.95. How difficult would it be to hack the code for this? -- Greg Matheson Make a mistake Chinmin College, Taiwan Try it, you'll like it [EMAIL PROTECTED]
Re: changing directories
On Thu, Oct 26, 2000 at 09:11:20AM -0400, [EMAIL PROTECTED] wrote: > I wrote: > > > Anyway, I'd REALLY like to be able to change directories while inside > > > mutt; that's one of the things I've found wanting in elm that I hoped [cut] > There are work-arounds: I can press "s", erase the suggested filename, and > type in the path to the directory where I want to save it, followed by > the same filename that was suggested in the first place... but after doing > that a few dozen times in a row, it gets really old. I don't know if this helps, but you can define macros for the line editor. Like macro editor '\I' ~/slist/i/archive/latest But you would still have to type in the attachment name. I use this to get to folders not in my Mail directory, and which I don't want in my mailbox screen. I try to make the directories and folders I use a lot just one or two letters long. -- Greg Matheson Make a mistake Chinmin College, Taiwan Try it, you'll like it [EMAIL PROTECTED]
Re: I want a different sort of macro
On Tue, May 23, 2000 at 08:52:07PM +0530, Suresh Ramasubramanian wrote: > Byrial Jensen proclaimed on mutt-users that: >> But macros work! > Just what the doctor ordered. So we can use editor macros to change mailboxes to those folders with long names that are so hard to type, rather than create symlinks or hard links in the shell for them! -- Greg MathesonPractitioners talk about what Chinmin College, Taiwan they do. Theorists talk about [EMAIL PROTECTED] they haven't done.
Re: 'browser' - what is it?
> On Sat, May 13, 2000 at 11:43:52AM +0800, I wrote: > > I had the opposite problem [to Chris Green who always wanted > > the browser to go back to $folder, rather than the last > > directory he had been in]. I wanted to get back to the place > > in the mailboxes screen I had just been ... So, > > folder-hook . 'macro index h ?0' > > folder-hook '!' 'macro index h ?1' > > folder-hook =tn 'macro index h ?2' On Sat, May 13, 2000 at 04:51:34PM +0200, Michael Tatge wrote in reply: > I'm not sure if I understand you correctly. This way to are only able > to go from one folder to a specific other one. That's right. The same one. From the one in the index to the same one in the mailboxes screen. That's the way I want it. When I go from the index to the mailboxes screen, I want the cursor to be on the folder whose index I was just looking at, the same way when you go from looking at an email in the pager to the index, you get the index corresponding to the folder the email was in. Without these macros, ? always puts the cursor back on the first mailbox, usually the spoolfile. > So folder-hook =tn 'macro index h c=whatever mailbox #2 is in > you example' would do the same, right? No, this would put you in the index screen not the mailboxes screen. It would be the index for mailbox #2, which is just =tn in my case, so would do nothing. I use the mailbox screen to work through the new emails I get in order. It gives me a rough idea of how much new email I have. Another good thing to have would be numbers of mails like there are in the index, but I am prepared to do without. -- Greg Matheson Learn a third language Chinmin College, Taiwanand be born again again [EMAIL PROTECTED]
Re: 'browser' - what is it?
On Thu, May 11, 2000 at 10:08:12AM +0100, Chris Green wrote: > Well, I sort of know what the 'browser' is but there's nowhere in the > manual that actually tells you. There is also nowhere that tells you > how to get to the [file] browser. I found the browser very confusing. The default 'c' which means in the index and pager has the similar but different meaning of in the browser. I finally gave up and wrote these macros: macro browser c bind browser C change-dir I just found out that this first macro hangs mutt when the cursor is on the parent directory for example. I hit and I can see from ps that it is eating up CPU. Usually it works, because on mailboxes, places you in the index, where is defined. There is no function in the browser. In fact, I rarely use anything else than the mailboxes screen from the browser. I do not send attachments or stuff that I've worked on from other directories I have. I would be quite happy to see the file browser ripped out and made a separate program like urlview to be interfaced with mutt. Then it could have things like rm, mkdir, etc which would make it really useful to me. In fact, does anyone know of a file manager like this with menus I can use instead of doing it all on the command line? Instead, the functions of the mailbox screen could then be beefed up so they were more similar to those of the index. Things like for example. And cycling through mailboxes on . -- Greg Matheson "Vent the pent:" Chinmin College, Taiwan Samuel Beckett [EMAIL PROTECTED]
Re: 'browser' - what is it?
On Fri, May 12, 2000 at 05:00:37PM +0200, Michael Tatge wrote: > On Fri, May 12, 2000 at 08:57:40AM +0100, Chris Green wrote: > > In general I think I'd prefer the browser to *always* start from > > $folder... > There is a rather uncomfortable way to achieve this. Type > c?cPath/to/folder And this could be made a folder hook, couldn't it. I had the opposite problem. I wanted to get back to the place in the mailboxes screen I had just been so I now have 38 folder-hooks in my .muttrc of the form: folder-hook . 'macro index h ?0' folder-hook '!' 'macro index h ?1' folder-hook =tn 'macro index h ?2' -- Greg Matheson The Internet from time Chinmin College, Taiwanto time claims this [EMAIL PROTECTED] address does not exist
Re: drafting mutt filtering faq entry
On Thu, Apr 27, 2000 at 01:16:27AM -0400, David T-G wrote: > Now, is mbox-hook what I want? The typical user is going to have all of > his email dumped right into $MAIL and then want mutt to move Linux stuff > here and mutt stuff there and cron jobs elsewhere, and I don't know that > mbox-hook gives me that. Maybe save-hook instead? Mbox-hooks just match on the name of the folder and all mail in the folder is moved to the new folder, I think, depending on the value of the configuration variable, move, which is a quadoption. You also don't have the printf sequences that you do with save-hooks when specifying the folder where the messages are to be moved, so I think save-hooks are what you are looking for here. -- Greg MathesonLearn a second language Chinmin College, Taiwan and be born again almost [EMAIL PROTECTED]
Re: save-hooks? and mail notifiers
I shouldn't have sent that last message! On Mon, Apr 17, 2000 at 11:30:57AM +0800, I wrote: > > fcc-save-hook . +%o > > fcc-save-hook @ncube.com +ncube/%o > I can't find anything about this in the manual, and when I try it > I get a folder called =%o. It should be %O, of course. I didn't know these sequences could be used for things other than screen formatting. Then, quoting the manual, I thought, unlike mbox-hooks, all the save-hooks in .muttrc are evaluated. In fact, for both, the first one that matches is used, isn't it. So default mbox- and save-hooks have to go last in .muttrc. It is send-hooks and folder-hooks where the first have to be the defaults in .muttrc, because all are evaluated. I then continued: > The only difference I can see between a mbox-hook and a > save-hook is that the first does it without telling you and the > second just prompts you with a different folder to do it to. Actually, an mbox-hook saves a whole lot of messages at once (as distinct from a save-hook which only involves saving one message, unless you are tagging a number of them). And an mbox-hook doesn't do it without telling you, unless you have :set move=yes. -- Greg Matheson Those who do do. Chinmin College, Taiwan Those who think don't. [EMAIL PROTECTED]
Re: save-hooks? and mail notifiers
On Sat, Apr 15, 2000 at 03:53:31PM +0300, Mikko Hänninen wrote: > Have you tried this, based on the original examples: > fcc-save-hook . +%o > fcc-save-hook @ncube.com +ncube/%o I can't find anything about this in the manual, and when I try it I get a folder called =%o. Is this the development branch? I would be interested in getting this working in mbox-hooks, so I could have a set of folders for incoming mail and another set for mail that I have read and want to keep and study. At the moment I have 'crud' (=the stuff I want to keep!) building up in my mail folders that cramps my mail-handling style! Incidentally, the manual says about mbox-hooks, Unlike some of the other hook commands, only the first matching pattern is used (it is not possible to save read mail in more than a single mailbox). But, isn't this true about save-hooks, too. They only save mail in a single mailbox. And why is the only the first matching pattern used for mbox-hooks? The only difference I can see between a mbox-hook and a save-hook is that the first does it without telling you and the second just prompts you with a different folder to do it to. -- Greg Matheson No language feature can be explained Chinmin College, Taiwan well until most of the language [EMAIL PROTECTED] has already been explained: NH Cohen
Re: Trouble getting indicator to point to first message
On Tue, Mar 21, 2000 at 07:52:00AM +0100, Byrial Jensen wrote: > I would prefer to name the jump function directly instead of > relying on the key binding of "1": > folder-hook . 'push 1' Thanks for that. I had some macros to get back to the appropriate mailbox in the mailbox screen when I exit from the index, but they involved writing to a file and reading from it. With folder hooks, they become like this: folder-hook =ttl 'macro index h c?\t":e exec jump\n4"\n'\n folder-hook =mua 'macro index h c?\t":e exec jump\n5"\n'\n I don't know why the :e exec is necessary, but it is working and if I have just :exec it doesn't work. I couldn't get it working with the angle bracket notation. -- Greg Matheson Practitioners just do it. Reflective Chinmin College, Taiwan practitioners just think they did it. [EMAIL PROTECTED]
macros messing up browser under screen
I have started using screen so that I can launch lynx sessions in another window. The problem is that this has messed up the display of the mutt browser. There are error messages and reverse-video bars placed in the wrong place when I scroll through my mailboxes, whereas before it was just like scrolling through the index. The index has not been affected under screen. I have narrowed the problem down to the macros I have to make the browser act more like the index and pager. [They write a file with a count of the mailbox I am viewing at the moment, so I am placed on it each time I return to the mailbox screen from the index.] Under screen, when I comment out these macros in my .muttrc, the browser is fine, as before. When I define them again, the display gets screwed up again. It is a redrawing problem. Perhaps because the macros take too long to execute? When I type the display is refreshed and everything looks good. But when I type , the screen command to refresh the screen, the display is not refreshed. This leads me to the conclusion that this is not just a screen problem, but a problem due to the interaction between mutt and screen. is a mutt command, and that is what redraws the screen. For what it's worth here is (one of the macros): macro browser j ':macro browser \cBJ `$HOME/.jayplus`'\n\cBJ where in $HOME/.jayplus there is: #!/bin/bash #test if last-entry has been reached. If not, add another. #. #I have 33 mailboxes including spool, so 32 are needed. #There is something wrong with the test. I get an error message #but it still seems to work. touch $HOME/.jay JAY=`cat $HOME/.jay` if [ $JAY = "" ] then exit else echo -n "" >> $HOME/.jay fi #$HOME/.jay contains strings of form <.. What advice do you have? -- Greg Matheson "Vent the pent:" Chinmin College, Taiwan Samuel Beckett [EMAIL PROTECTED]
Re: Reading HTML Attachments
On Thu, Mar 02, 2000 at 07:28:19PM +0100, Jens Bech Madsen wrote: > Unfortunately a lot of websites are based on databases and > often have really illegible URLs. I often have the problem that > urlview gives me a long list of nearly identical URLs without > providing context. I don't have that problem. My problem is that Web connections are slow here and I want to put urlview in the background and go back to the mutt I have running (rather than opening another and having to keep track of all my instances of mutt). But I don't think this is possible, because urlview is being run as a child of the mutt process, isn't it. Please correct my knowledge of UNIX, if I am wrong. -- Greg Matheson genius + soul = jazz Chinmin College, Taiwan Mr_Bean on SchMOOze [EMAIL PROTECTED] & telnet://health.acor.org#
Re: key binding question
On Thu, Jan 27, 2000 at 05:20:21PM +1100, Shao Zhang wrote: > Hi, > I would like to bind a key where when I am in the brower mode > with a list of folders, I would like to press a key that goes to > the next folder which contains unread message. That would be difficult, I think, because there is no function for moving to the next folder with new messages, I believe. Someone wrote for me a macro to step through the folders with a single key press. It was something like (on one line): > macro browser I ':macro browser \cXJ "`$HOME/.jayplus; >$HOME/.jayread`"'\n\cXJl and in .jayplus: > #!/bin/bash > #test if last-entry has been reached. If not, add another > #. > #I have 33 mailboxes including spool, so 32 are needed. > #There is something wrong with the test. I get an error message > #but it still seems to work. > touch $HOME/.jay > JAY=`cat $HOME/.jay` > if [ $JAY = >"" > ] > then > exit > else > echo -n "" >> $HOME/.jay > fi and in .jayread: > #!/bin/sh > #writes '...' to macro definition > cat $HOME/.jay > echo -- Greg Matheson The Internet from time Chinmin College, Taiwanto time claims this [EMAIL PROTECTED] address does not exist
Re: folder-hooks, (un)ignore, and From_
On Thu, Jan 20, 2000 at 01:06:13PM +0200, Mikko Hänninen wrote: > Greg Matheson <[EMAIL PROTECTED]> wrote on Thu, 20 Jan 2000: > > I'm having a problem with folder hooks in which I have (un)ignore > > commands for From_ headers. > I remember reading somewhere that you can't (re-)ignore a header which > you have unignored. That was the problem, but upgrading to 1.0.1, that problem has gone away. -- Greg MathesonThink globally Chinmin College, Taiwan Act locally [EMAIL PROTECTED] Think one thing, do another
folder-hooks, (un)ignore, and From_
I'm having a problem with folder hooks in which I have (un)ignore commands for From_ headers. After unignoring the From_ header in one mailbox, I can't ignore it in others. The reason I want to see the From_ line is that I am using mutt to read my procmail log. This file has for each delivered email an entry showing the `From ' and `Subject:' fields of the header and some other stuff. I wrote for .procmail/log: folder-hook procmail/log'unignore "from "' And this works. But because this is not turned off when you change to another mailbox, there has to be a default folder-hook . 'ignore "from "' And this works placed ahead of the other folder-hook in my .muttrc when I first enter mutt. The problem is after I have changed to .procmail/log, and then to another mailbox, it doesn't work. I get both From_ and From: lines. The ignore lines in my .muttrc: > # default list of header fields to weed when displaying > # > ignore "from " received content- mime-version status x-status message-id > ignore sender references return-path lines x-mailer priority precedence > ignore x-sender reply-to mail-followup-to in-reply-to comments > #my list > ignore x- date user-agent organi cc delivered-to approved-by > ignore resent- > list- importance newsgroups errors-to followup-to > ignore supersedes > -- Greg MathesonDoing things right is Chinmin College, Taiwan doing the right thing. [EMAIL PROTECTED] Doing things wrong is education.
Re: directory browser macros
I was trying to get navigating between the index and mailbox screen in the browser more like moving from the pager to the index, and specifically, to make the current entry the mailbox I was just viewing rather than my spool mailbox. I was doing this with some macros and scripts that write to a file the position of the mailbox in the mailbox screen. The problem was that when reading the 'j' the script had written to the file the macro used to write to the file was being invoked again, apparently, so I was getting two js for the price of one. It worked when I changed the internal representation in the file to ''. So the macros I have are: macro browser j ':macro index \cBJ `$HOME/.jayplus`'\n\cBJ macro browser k ':macro index \cBK `$HOME/.jayminus`'\n\cBK macro index h ':macro index \cIJ "c?\t`$HOME/.jayread`"'\n\cIJ And in .jayplus, there is: > #!/bin/bash > > #test if last-entry has been reached. If not, add another. > #I have 33 mailboxes including spool, so 32 are needed. > > touch $HOME/.jay > JAY=`cat $HOME/.jay` > if [ $JAY = >"" > ] > then > exit > else > echo -n "" >> $HOME/.jay > fi In .jayminus: > #!/bin/bash > > #takes first 13 bytes (ie ) off .jay > > tail -c +13 $HOME/.jay > /tmp/jay > mv /tmp/jay $HOME/.jay And in .jayread: > #!/bin/sh > > #writes '...' to macro definition > > cat $HOME/.jay > echo Interestingly, I couldn't find any other position for '' in my macros. If they were at the end of the line, I got an error beep, even though the macros worked. In the present position, I don't get a beep, but I get the error message, 'Key is not bound. Press '?' for help,' even though the macros work. If I called a shell to write to the file, I got major screen flashing. Now how do I cope with and and accessing mailboxes with numbers? -- Greg Matheson Think locally Chinmin College, Taiwan Act globally [EMAIL PROTECTED] Think one thing, do another
directory browser macros
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 , 'k' is , 'l' is , and the idea is that 'h' should return you to where you were in the higher menu. For the pager, this means 'h' is . 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?' 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: jjj 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" 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]
Re: A hook for a separate compose window?
What I have done to make it easier for me to add stuff from mail folders while writing mail is to add two macros to my .muttrc: macro compose \cf "R/tmp/mutt0\nA" This one renames the file which is being edited in /tmp, so we know what its name is when we cat the mails to it. The ^U is a real control-u. It then opens a special attach-message menu discussed in 2.4 in the manual. macro index \cf ";|formail >> /tmp/mutt0\n~A\nq" After you tag the messages you want to put into the one you are composing, this macro pipes them to cat (actually formail) which adds them to the end of file you are editing and cleans up by untagging the messages, otherwise they will be added as separate attachments in the compose menu. The ^T is a real control-t. I read about using formail (part of procmail) rather than cat on the list. I think it just tidies up the From_ line, or something. I rename the file I am editing to /tmp/mutt0 because this means vim syntax highlighting will apply for it. You may need to use another name, depending on your editor. Last important point is you need to have, unset pipe_split in your .muttrc, I think. -- Greg Matheson Make a mistake Chinmin College, Taiwan Try it, you'll like it [EMAIL PROTECTED]
Re: macros - is there any logic about when they work or not?
On Tue, Nov 30, 1999 at 09:13:27AM +, Chris Green wrote: > 1 - "generic" macros rarely seem to work as expected, this may well be > for valid (but obscure) reasons. Maybe it would be a good idea for > the manual to point out that index and pager macros are more likely to > get the required effect. I was trying to write a generic macro (actually I think it was a binding) to make do next-page, rather than write separate ones for the browser and index screens. It seemed to work after I rewrote .muttrc and re-sourced it, but then after leaving mutt and restarting it, it stopped working. I wonder if this was connected to what the manual says about changing settings: > The generic menu is not a real menu, but specifies common > functions (such as movement) available in all menus except for > pager and editor. Changing settings for this menu will affect > the default bindings for all menus (except as noted). I never saw any of these promised 'as noted' messages, but I had other macros or bindings of (or there is a default binding which views the file (or mailbox) in the browser, which I can't find in the list in 6.4 in the manual at the moment), and these were I think the reason my generic binding wasn't working. I think generic bindings will only work if the key isn't used for a macro or binding anywhere else. Is the logic somewhat like that of folder-hooks not being reset, but in the case of bindings, there is no looking at what is in .muttrc again? That is the feel I got for it, anyway. -- Greg Matheson genius + soul = jazz Chinmin College, Taiwan Mr_Bean on SchMOOze [EMAIL PROTECTED] & telnet://health.acor.org#
mutt on MS Windows?
raf <[EMAIL PROTECTED]> said on the VIM list about November 4: > > [C]ould anyone recommend to me a freeware MUA running under > > Win32, understanding MIME, and that could use VIM for mail > > edition. > > [Y]ou might want to install cygwin (www.cygnus.com) which lets you > compile unix source code under win32. then compile mutt with it. Is this possible? Has anyone done this? -- Greg Matheson genius + soul = jazz Chinmin College, Taiwan Mr_Bean on SchMOOze [EMAIL PROTECTED] & telnet://health.acor.org#
backslashes in send-hooks
Why do I need to put two backslashes before the '+' in the first regexp, but only one before the '.' in the second? send-hook '~t ^lang\\+moo' 'my_hdr From: Mr Bean ' I have a mailing list set up at a box in my email address and I want to change my From: line for emails to that email+box address. The above send-hook works. I am just interested in the reason why only one backslash didn't work. -- Greg Matheson Make a mistake Chinmin College, Taiwan Try it, you'll like it [EMAIL PROTECTED]