The wiki lies about macros and tags.
The section about tags in http://wiki.mutt.org/?MuttGuide/Macros is flat-out wrong in 1.5.21 and 1.5.20, as far as I can tell, and should be entirely removed or cordoned off. I tried, and I cannot replicate the old behaviour at all. Does anyone know when this behaviour changed? -Robin -- http://singinst.org/ : Our last, best hope for a fantastic future. .i ko na cpedu lo nu stidi vau loi jbopre .i danfu lu na go'i li'u .e lu go'i li'u .i ji'a go'i lu na'e go'i li'u .e lu go'i na'i li'u .e lu no'e go'i li'u .e lu to'e go'i li'u .e lu lo mamta be do cu sofybakni li'u
Re: The wiki lies about macros and tags.
On Thu, Jul 19, 2012 at 10:30:42AM -0700, Robin Lee Powell wrote: > The section about tags in http://wiki.mutt.org/?MuttGuide/Macros is > flat-out wrong in 1.5.21 and 1.5.20, as far as I can tell, and > should be entirely removed or cordoned off. 1.5.18, too. -Robin
Re: The wiki lies about macros and tags.
* On 19 Jul 2012, Robin Lee Powell wrote: > The section about tags in http://wiki.mutt.org/?MuttGuide/Macros is > flat-out wrong in 1.5.21 and 1.5.20, as far as I can tell, and In what way, specifically? The statements appear to be correct and there are no functional examples (only illustrative ones), so it's hard to infer what's incorrect. -- David Champion • d...@uchicago.edu • IT Services • University of Chicago
Re: The wiki lies about macros and tags.
On Thu, Jul 19, 2012 at 12:44:31PM -0500, David Champion wrote: > * On 19 Jul 2012, Robin Lee Powell wrote: > > The section about tags in http://wiki.mutt.org/?MuttGuide/Macros > > is flat-out wrong in 1.5.21 and 1.5.20, as far as I can tell, > > and > > In what way, specifically? The statements appear to be correct > and there are no functional examples (only illustrative ones), so > it's hard to infer what's incorrect. "If you define a macro to work with a single entry, then it can not be applied to tagged entries just by using macro-key!!!" is flat-out false in every version of mutt I have access to. This means that the entire section "Special usage: applying to several tagged entries" is both false and useless. Based on that statement, given the following macro: macro index ,t I would expect the following sequence of characters to error out: ttt;,t But in fact it works perfectly. -Robin -- http://singinst.org/ : Our last, best hope for a fantastic future. .i ko na cpedu lo nu stidi vau loi jbopre .i danfu lu na go'i li'u .e lu go'i li'u .i ji'a go'i lu na'e go'i li'u .e lu go'i na'i li'u .e lu no'e go'i li'u .e lu to'e go'i li'u .e lu lo mamta be do cu sofybakni li'u
Re: The wiki lies about macros and tags.
On Thu, Jul 19, 2012 at 10:48:03AM -0700, Robin Lee Powell wrote: > On Thu, Jul 19, 2012 at 12:44:31PM -0500, David Champion wrote: > > * On 19 Jul 2012, Robin Lee Powell wrote: > > > The section about tags in > > > http://wiki.mutt.org/?MuttGuide/Macros is flat-out wrong in > > > 1.5.21 and 1.5.20, as far as I can tell, and > > > > In what way, specifically? The statements appear to be correct > > and there are no functional examples (only illustrative ones), > > so it's hard to infer what's incorrect. > > "If you define a macro to work with a single entry, then it can > not be applied to tagged entries just by using > macro-key!!!" is flat-out false in every version of > mutt I have access to. This means that the entire section > "Special usage: applying to several tagged entries" is both false > and useless. > > Based on that statement, given the following macro: > > macro index ,t > > I would expect the following sequence of characters to error out: > > ttt;,t > > But in fact it works perfectly. It just occured to me that it may be that it is intended to mean that given: macro index ,t this won't work: macro index ,x ,t But in fact that is also false; all 4 of the following work exactly as you'd expect: macro index ,t t macro index ,T macro index ,x ,t macro index ,X ,T at least in 1.5.21, where I just tested them. -Robin
Re: The wiki lies about macros and tags.
* On 19 Jul 2012, Robin Lee Powell wrote: > "If you define a macro to work with a single entry, then it can not > be applied to tagged entries just by using macro-key!!!" > is flat-out false in every version of mutt I have access to. This > means that the entire section "Special usage: applying to several > tagged entries" is both false and useless. It's not false or useless, but it is incomplete. What it means is that if a macro contains two or more operations, and you press your keystroke before executing the macro, it will execute the first operation on each tagged entry and then execute each subsequent operation on the current entry, whichever entry happens to be current after the first operation is done. The current wording is correct in a logical sense, but not in a practical sense. Perhaps it should say: If you define a macro to work with a single entry, then it can not **necessarily** be applied to tagged entries just by using macro-key! Or: If you define a macro to perform multiple actions, then it can not be applied to tagged entries just by using macro-key! Or: affects only the next action performed by a macro, not the entire macro as a whole. -- David Champion • d...@uchicago.edu • IT Services • University of Chicago
wiki macro page expansion (was Re: The wiki lies about macros and tags.)
On Thu, Jul 19, 2012 at 10:55:07AM -0700, Robin Lee Powell wrote: > On Thu, Jul 19, 2012 at 10:48:03AM -0700, Robin Lee Powell wrote: > > On Thu, Jul 19, 2012 at 12:44:31PM -0500, David Champion wrote: > > > * On 19 Jul 2012, Robin Lee Powell wrote: > > > > The section about tags in > > > > http://wiki.mutt.org/?MuttGuide/Macros is flat-out wrong in > > > > 1.5.21 and 1.5.20, as far as I can tell, and > > > > > > In what way, specifically? The statements appear to be correct > > > and there are no functional examples (only illustrative ones), > > > so it's hard to infer what's incorrect. > > > > "If you define a macro to work with a single entry, then it can > > not be applied to tagged entries just by using > > macro-key!!!" is flat-out false in every version of > > mutt I have access to. This means that the entire section > > "Special usage: applying to several tagged entries" is both false > > and useless. > > > > Based on that statement, given the following macro: > > > > macro index ,t > > > > I would expect the following sequence of characters to error out: > > > > ttt;,t > > > > But in fact it works perfectly. > > It just occured to me that it may be that it is intended to mean > that given: > >macro index ,t > > this won't work: > >macro index ,x ,t > > But in fact that is also false; all 4 of the following work exactly > as you'd expect: > >macro index ,t t >macro index ,T >macro index ,x ,t >macro index ,X ,T > > at least in 1.5.21, where I just tested them. And now I think I understand what it's *actually* trying to say. I took: If you define a macro to work with a single entry, then it can not be applied to tagged entries just by using macro-key!!! to mean that *no* macros *ever* work with tags unless set to do so explicitely, but it means that *some* macros will do unpexpected things. I'm going to suggest some wording here that I'd like to put in that section of the wiki, and y'all can tell me if it's halfway decent. Tags, Advancement, And Other Macro Surprises All macros devolve in the end, essentially, to a sequence of keystrokes sent to mutt. This means that working with tagged messages in macros can be tricky, at least unless you have auto_tag turned on, because if you simply hit the tag-prefix key (default ;) before the macro, the tag-prefix key will only apply to the first action. If your macro does more than one thing, each seperate thing that it does must be tag-prefixed seperately. Here's an example; this (totally useless) macro: macro index ,g 'wc -l' "useless: count lines, throw away the count, and then delete" pipes a message to a shell command and then deletes it. If, however, you use tab-prefix first (i.e. ";,g"), it doesn't pipe each message to the shell and then delete them, it pipes them all to the shell and then deletes the one under the cursor. In other words, assuming default bindings and using to stand in for hitting the enter key, the keystrokes: |wc -ld become: ;|wc -ld which pipes all the messages but only deletes one message (and not any of the ones you had tagged, probably, but rather the one under the cursor!) and not: ;|wc -l;d which pipes and deletes all of them, as you might expect. A slightly tricky bit there is that pipe-entry asks for user input, which you might not want in a macro; this can be handled by temporarily disabling that behaviour and then (assuming you want it on) turning it back on, like so: macro index ,G 'set wait_key=nowc -lset wait_key=no' "useless: count lines, don't wait, throw away the count, and then delete" The wait_key bit is to stop it from explicitely asking you to press enter. This behaves even worse with tag-prefix, because what you end up with is: ;:set wait_key=no|wc -ld:set wait_key=yes Which is a problem because as soon as you type the :, the prefix-ness just gets completely lost; you might as well have not even typed ;. For some macros, there's no problem; this macro will work just fine with tag-prefix: macro index ,s '=spam' "Dump to spam folder" Because it only performs one action, with tag prefix this turns into: ;s=spam which works perfectly. If you do need a macro that performs multiple actions, though, what you'll need to do is have a version that expects no tags, and a versian that accepts tags. [INSERT CURRENT CONTENTS OF "Special usage: applying to several tagged entries" HERE] Another surprise is that most commands in mutt at the index level move to the next message, at least with default settings, and this is true when they are invoked as macros as well. This means that: macro index ,t '' "broken: toggle new, then delete something else" is almost certainly a totally useless macro, with tags or not. Without tag-prefix, it toggles the new flag on the message under the cursor, advances to th
Re: The wiki lies about macros and tags.
On Thu, Jul 19, 2012 at 01:04:23PM -0500, David Champion wrote: > * On 19 Jul 2012, Robin Lee Powell wrote: > > "If you define a macro to work with a single entry, then it can > > not be applied to tagged entries just by using > > macro-key!!!" is flat-out false in every version of > > mutt I have access to. This means that the entire section > > "Special usage: applying to several tagged entries" is both > > false and useless. > > It's not false or useless, but it is incomplete. Sorry, I started my big mail before I saw this. :) > What it means is that if a macro contains two or more operations, > and you press your keystroke before executing the > macro, it will execute the first operation on each tagged entry > and then execute each subsequent operation on the current entry, > whichever entry happens to be current after the first operation is > done. > > The current wording is correct in a logical sense, but not in a > practical sense. Perhaps it should say: > > If you define a macro to work with a single entry, then it can not > **necessarily** be applied to tagged entries just by using > macro-key! > > Or: > > If you define a macro to perform multiple actions, then it can not > be applied to tagged entries just by using macro-key! > > Or: > > affects only the next action performed by a macro, > not the entire macro as a whole. I got into documentation mode and suggested some rather extensive additions; please let me know what you think. -Robin -- http://singinst.org/ : Our last, best hope for a fantastic future. .i ko na cpedu lo nu stidi vau loi jbopre .i danfu lu na go'i li'u .e lu go'i li'u .i ji'a go'i lu na'e go'i li'u .e lu go'i na'i li'u .e lu no'e go'i li'u .e lu to'e go'i li'u .e lu lo mamta be do cu sofybakni li'u
Re: archive messages in gmail
On Tue, Jul 17, 2012 at 06:56:19PM -0500, Luis Mochan wrote: > I have used gmail from mutt occasionally using the attached rc > file. Today I decided to clean my gmail account, deleting some > messages and saving others in their corresponding folders under, > for example =here or =there (under imaps://imap.gmail.com:993/). > Things seemed to be working well. After saving each message, it > was marked as Deleted from my INBOX. My problem is that when I > expunged the messages from the INBOX, they also dissapeared from > the folder to which I had copied them! You're going to need to tell us the exact keystrokes you're pressing for us to be able to usefully comment. > This is very confusing to me (and probably I couldn't explain the > situation clearly). How could one manage gmail labels in gmail > from within mutt in a safe way? I've had no problem whatsoever with just: s=Label But then I don't use labels with gmail very much at all because the search is so good; in fact I have "s" rebound to "save to all mail", which removes things from the inbox but does nothing else. Here's all my gmail-related stuff, with comments, in case it helps: # Gmail-related keyboard shortcuts # This allows going to space-containing folders bind editor noop # The trash variable doesn't exist in this version of mutt, so we # trash with delete; we also turn off pattern delete due to no "ask # for user input" command; just use the tag functions # # Note that saving to Trash immediately, forcefully, deletes the message from # the inbox; this causes a "Mailbox was externally modified. Flags # may be wrong." message, and often causes the cursor to go # somewhere weird. This does not seem to be fixable, although you # could add or something to these macros and at least # end up in a predictable place. # macro index,pager d "=[Gmail]/Trash" "Gmail trash message" macro index,pager D noop macro index,pager ^D "=[Gmail]/Trash" "Gmail trash thread" macro index,pager d "=[Gmail]/Trash" "Gmail trash thread" # Saving to Trash immediately, forcefully, deletes the message from # the inbox; this means undelete of all kinds is useless, you have # to go to the trash and save them to another label, or use the web # interface. macro index,pager u noop macro index,pager ^u noop macro index,pager u noop # I don't use labels basically ever, so by default save just means # "get it out of my inbox" macro index,pager s "=[Gmail]/All Mail" "Remove from inbox/save to all mail" macro index,pager ,s "" "Normal save" macro index,pager S "" "Normal save" # Macros to go to common gmail labels. macro index,pager ,i "=INBOX" "Go to inbox" macro index,pager ,a "=[Gmail]/All Mail" "Go to all mail" macro index,pager ,s "=[Gmail]/Sent Mail" "Go to outbox" macro index,pager ,d "=[Gmail]/Drafts" "Go to drafts" -Robin -- http://singinst.org/ : Our last, best hope for a fantastic future. .i ko na cpedu lo nu stidi vau loi jbopre .i danfu lu na go'i li'u .e lu go'i li'u .i ji'a go'i lu na'e go'i li'u .e lu go'i na'i li'u .e lu no'e go'i li'u .e lu to'e go'i li'u .e lu lo mamta be do cu sofybakni li'u
Re: archive messages in gmail
On Thu, Jul 19, 2012 at 01:38:21PM -0700, Robin Lee Powell wrote: > On Tue, Jul 17, 2012 at 06:56:19PM -0500, Luis Mochan wrote: > > I have used gmail from mutt occasionally using the attached rc > > file. Today I decided to clean my gmail account, deleting some > > messages and saving others in their corresponding folders under, > > for example =here or =there (under imaps://imap.gmail.com:993/). > > Things seemed to be working well. After saving each message, it > > was marked as Deleted from my INBOX. My problem is that when I > > expunged the messages from the INBOX, they also dissapeared from > > the folder to which I had copied them! > > You're going to need to tell us the exact keystrokes you're pressing > for us to be able to usefully comment. > > > This is very confusing to me (and probably I couldn't explain the > > situation clearly). How could one manage gmail labels in gmail > > from within mutt in a safe way? > > I've had no problem whatsoever with just: > > s=Label > > But then I don't use labels with gmail very much at all because the > search is so good; in fact I have "s" rebound to "save to all mail", > which removes things from the inbox but does nothing else. > > Here's all my gmail-related stuff, with comments, in case it helps: My apologies, these needed more testing. It turns out that whether or note something you've saved to a label leaves your inbox is dependent on whether you send the IMAP delete command for that email in your inbox, so the behaviour of the delete variable becomes important; delete=no means "save saves to labels but keep in the inbox", delete=yes means "save saves to labels and removes from the inbox", approximately. My stuff again: # Gmail-related keyboard shortcuts # This allows going to space-containing folder names bind editor noop # The trash variable doesn't exist in this version of mutt, so we # trash with delete; we also turn off pattern delete due to no "ask # for user input" command; just use the tag functions # # Note that saving to Trash immediately, forcefully, deletes the message from # the inbox; this causes a "Mailbox was externally modified. Flags # may be wrong." message, and often causes the cursor to go # somewhere weird. This does not seem to be fixable, although you # could add or something to these macros and at least # end up in a predictable place. # macro index,pager d "=[Gmail]/Trash" "Gmail trash message" bind index,pager D noop macro index,pager ^D "=[Gmail]/Trash" "Gmail trash thread" macro index,pager d "=[Gmail]/Trash" "Gmail trash thread" # I don't use labels basically ever, so by default save just means # "get it out of my inbox" # # This version, and the variable setting, auto-expunge such # messages; if you don't want that, comment out the next two lines # and uncomment the one after that. set delete=yes macro index,pager s "=Saved" "Remove from inbox/save to all mail" # macro index,pager s "=Saved" "Remove from inbox/save to all mail" macro index,pager ,s "" "Normal save" macro index,pager S "" "Normal save" # Macros to go to common gmail labels. macro index,pager ,i "=INBOX" "Go to inbox" macro index,pager ,a "=[Gmail]/All Mail" "Go to all mail" macro index,pager ,s "=[Gmail]/Sent Mail" "Go to outbox" macro index,pager ,d "=[Gmail]/Drafts" "Go to drafts" -Robin
Re: archive messages in gmail
On Thu, Jul 19, 2012 at 04:15:49PM -0500, Luis Mochan wrote: > On Thu, Jul 19, 2012 at 01:38:21PM -0700, Robin Lee Powell wrote: > > On Tue, Jul 17, 2012 at 06:56:19PM -0500, Luis Mochan wrote: > > > I have used gmail from mutt occasionally using the attached rc > > > file. Today I decided to clean my gmail account, deleting some > > > messages and saving others in their corresponding folders > > > under, for example =here or =there (under > > > imaps://imap.gmail.com:993/). Things seemed to be working > > > well. After saving each message, it was marked as Deleted from > > > my INBOX. My problem is that when I expunged the messages from > > > the INBOX, they also dissapeared from the folder to which I > > > had copied them! > > > > You're going to need to tell us the exact keystrokes you're > > pressing for us to be able to usefully comment. > > If I remember correctly (I haven't reproduced the problem) I typed > s=mailbox to save a message, > $ to purge the message, which had been marked with a D, from the INBOX > c=mailbox to open the mailbox > and the message seems to have disappeared. AAH! I get it. That's because you have trash= set to Google's Trash, which is how you tell it that you want things purged forever. So $ obeys the trash= variable, which trashes it completely. If you drop trash= and use my macros instead for deleting, which actually save to Trash instead of deleting, you should be fine. -Robin