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<enter> > > 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 <space> 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 <last-entry> or something to these macros and at least # end up in a predictable place. # macro index,pager d "<save-message>=[Gmail]/Trash<enter>" "Gmail trash message" bind index,pager D noop macro index,pager ^D "<tag-thread><tag-prefix><save-message>=[Gmail]/Trash<enter>" "Gmail trash thread" macro index,pager <esc>d "<tag-subthread><tag-prefix><save-message>=[Gmail]/Trash<enter>" "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 "<save-message>=Saved<enter><sync-mailbox>" "Remove from inbox/save to all mail" # macro index,pager s "<save-message>=Saved<enter>" "Remove from inbox/save to all mail" macro index,pager ,s "<save-message>" "Normal save" macro index,pager S "<save-message>" "Normal save" # Macros to go to common gmail labels. macro index,pager ,i "<change-folder>=INBOX<enter>" "Go to inbox" macro index,pager ,a "<change-folder>=[Gmail]/All Mail<enter>" "Go to all mail" macro index,pager ,s "<change-folder>=[Gmail]/Sent Mail<enter>" "Go to outbox" macro index,pager ,d "<change-folder>=[Gmail]/Drafts<enter>" "Go to drafts" -Robin