Zsh Mailing List Archive
Messages sorted by: Reverse Date, Date, Thread, Author

Re: bug in _mutt ?



On Jun 21,  9:55am, Andy Spiegl wrote:
} Subject: Re: bug in _mutt ?
}
} trace _mua_mailboxes:35(case)> mbox_names=( Mailboxes mailboxes

Please note those first two entries in mbox_names, it's important later.

} =sub/cus/rundbriefe =sub/cus/rundbriefe.muc =sub/mutt =sub/zsh
} =sub/zsh-workers =sub/linux/linux-ug =sub/linux/debian.security
} =sub/linux/debian.announce =sub/linux/debian.commercial
} =sub/linux/debian.user.de =sub/linux/debian.user =sub/kira =sub/akte )
}
} is being reduced to
} 
} =sub =sub =sub =sub =sub =sub =sub =sub =sub =sub =sub =sub =sub
}
} Is that intended?

Yes.  That's the whole point of _multi_parts: it works like _path_files,
but on strings that aren't necessarily file names.  So you should find
that if you type

% mutt -f =sub<TAB>

it'll append the slash, and offer completions of

cus  mutt  zsh  zsh-workers  linux  kira  akte

} It would sound more logical to me if the full paths were kept.

Why?  (Some people have very wide and deep mailbox hierarchies ...)

} And after
}  % muttf -f  m<TAB>
} I get these completions offered:
}  mailbox specification
}  mailboxes 
}  mailbox file
}  Mail/            movies/          mutt_1.2-1.deb 
} 
} Where does that "mailboxes" come from?

It comes from _mbox_names, up above.  I don't know why "Mailboxes" is
not also offered, since "Mail/" seems to be.

Now, how it got into _mbox_names is a different question.  In the
_mua_mailboxes helper function, you'll see

    (*:mutt:*)
      mbox_names=( "${_mutt_cache[@]}" "${_mailbox_cache[@]}"
      		   "${_maildir_cache[@]}" )

The _mutt_cache is initialized by grepping your .muttrc (or the file that
you name in the $muttrc variable, which you should set somewhere in your
.zshrc file if it's not ~/.muttrc) for the string "mailboxes" and then
throwing away the first word of the result.  So it could be coming from
there, if the grep is finding more words in .muttrc than Clint expected
(he wrote the original _mailboxes, I don't use mutt and have no idea
what a .muttrc file looks like).

The _mailbox_cache is all the files and directories under ~/Mail in your
home directory (again, set $maildirectory in your .zshrc to change this).
Unfortunately this caching means that you can't easily complete newly-
created mailbox names, but it's intended to speed things up for people
who have large numbers of mailboxes.  (Myabe the new enhancements to
_path_files are enough that we could do away with this?)

Finally, the _maildir_cache is all the *subdirectories* of ~/Mail (or
$maildirectory) that contain further subdirectories named "cur".  This
is crude support for a qmail mailbox format that stores messages as
individual files in three subdirectories of a directory named for the
mailbox.  This is imprecise, as it means that if you happen to have a
directory named "cur" it'll guess that the parent is a qmail mailbox.
You have a directory named "cus" ... do you also have a "cur"?

-- 
Bart Schaefer                                 Brass Lantern Enterprises
http://www.well.com/user/barts              http://www.brasslantern.com

Zsh: http://www.zsh.org | PHPerl Project: http://phperl.sourceforge.net   



Messages sorted by: Reverse Date, Date, Thread, Author