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

Re: Completion for mutt



On Feb 14, 12:56pm, Sven Wischnowsky wrote:
} Subject: Re: completion but extra options allowed
} 
} [ moved to zsh-workers ]
} 
} Bart Schaefer wrote:
} 
} > _mailboxes then calls "compadd -J -default- -J -default- - ..." which
} > seems a bit odd.  The first -J -default- is from "$@" and the second is
} > of course "$expl[@]".  Is that really doing the right thing?
} 
} 3) Depending on the implementors preferences, he may or may not change 
} the '-f+:mailbox:_mailboxes' to '-f+:mailbox: _mailboxes', which will
} make _arguments *not* give a description to _mailboxes (i.e., then you 
} only get the second one).

I guess the question is not whether it's right for _mutt to pass the
first -J to _mailboxes, but whether it's right for _mailboxes to pass
both -J along to compadd, given that it doesn't generate anything that
will ever be put in the first group.

On the other hand, _mailboxes doesn't know what else may be in "$@" so
it can't just ignore it entirely ... or can it?  _files appears to ...

} In another message:
} 
} > compadd -i + -f -W ~/Mail
} > 
} > directly does not accomplish what I expected it to.  Is this a bug, or am
} > I missing something?
} 
} -i just *adds* some string to IPREFIX. It is really only useful when
} used with -U

Ah, of course.

} > What IS the compadd equivalent of 
} > compctl -x 's[+] c[-1,-f],s[-f+]' -W ~/Mail -f ...
} 
} So, the right way to do the same as that compctl would be:
} 
}   if compset -P '+|-f+' || [[ $words[CURRENT-1] = -f ]]; then
}     _files -W ~/Mail
}   else
}     ...
}   fi

OK ... now a slightly different question:  In _mailboxes, we already
have a list of all the mailboxes in ~/Mail.  How do I get the equivalent
of "_files -W ~/Mail" with that already-generated list as the starting
point?  (Because ~/Mail may contain maildir or MH directories, it's
not sufficient to simply complete files as _files does.)

On Feb 14,  3:00pm, Andy Spiegl wrote:
} Subject: Re: completion but extra options allowed
}
} > } And it doesn't expand local filenames either:
} > } eule:~>cd Mail
} > } eule:~/Mail>mutt -f a<TAB>
} > 
} > I think that's intentional on the grounds that files not in the mail
} > directory are not likely to be mail files.  It should probably be set
} > by a style, if the 'mailbox' style won't already work.
} I wasn't able to find anything about the mailbox-style in the docs.  :-(
} What can I set with it?

My mistake, there isn't any mailbox style.  There probably should be,
implemented by _mailboxes.

} > You don't need to edit _mailboxes, you just need
} > 	set muttrc=~/.mutt/local
} But of course that doesn't work for the aliases, which are in ~/.mutt/aliases.
} Hm, while just looking at _mutt I see that mailaddresses are taken from
} 'recipient:->userhost', which I don't understand.  Where is that info
} being set?  Or in other words: how can I influence the list of addressees?

The ->userhost means that it will call the _users completer until the
current word contains an @, and then it will call the _hosts completer.
The _users completer reads the list of user names from the *:users style,
and the _hosts completer does the same for the *:hosts style.

_mutt is currently not clever about completing mail aliases.

On Feb 14,  4:11pm, Ollivier Robert wrote:
} Subject: Completion for mutt
}
} When we switched from compctl to completion widgets, we lost something in
} the Mutt frompltion. I used to be able to complete on '+' (which represents
} ~/Mail generally) after a '-f'. Now it is trying to expand only full path
} behind "-f"...

The _mailboxes completion function is very rudimentary at this point.
It tries to understand spool files, maildir boxes, MH folders, pine
mail files, and mutt mail files, but it throws them all together into
the same big cache of mailbox names and then supplies those as the
completions.  They really should be broken out by context (i.e. it's
no use completing maildirs for pine, it won't read them), put into
different completion groups, etc.

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



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