zsh-workers
 help / color / mirror / code / Atom feed
From: "Bart Schaefer" <schaefer@candle.brasslantern.com>
To: Andy Spiegl <zsh.Andy@spiegl.de>,
	Ollivier Robert <roberto@eurocontrol.fr>,
	Sven Wischnowsky <wischnow@informatik.hu-berlin.de>,
	zsh-workers@sunsite.auc.dk
Subject: Re: Completion for mutt
Date: Mon, 14 Feb 2000 17:21:10 +0000	[thread overview]
Message-ID: <1000214172110.ZM25955@candle.brasslantern.com> (raw)
In-Reply-To: <200002141156.MAA10295@beta.informatik.hu-berlin.de>
In-Reply-To: <20000214150010.B17427@br-online.de>
In-Reply-To: <20000214161129.B58230@caerdonn.eurocontrol.fr>

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


  reply	other threads:[~2000-02-14 17:21 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2000-02-14 11:56 completion but extra options allowed Sven Wischnowsky
     [not found] ` <20000210153411.A27005@fruitcom.com>
     [not found]   ` <1000210175857.ZM6927@candle.brasslantern.com>
     [not found]     ` <20000210195143.A26109@br-online.de>
     [not found]       ` <1000211175555.ZM32309@candle.brasslantern.com>
     [not found]         ` <20000214150010.B17427@br-online.de>
2000-02-14 15:11           ` Completion for mutt Ollivier Robert
2000-02-14 17:21             ` Bart Schaefer [this message]
2000-02-15  9:53 Sven Wischnowsky
2000-02-15 11:49 ` Ollivier Robert

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1000214172110.ZM25955@candle.brasslantern.com \
    --to=schaefer@candle.brasslantern.com \
    --cc=roberto@eurocontrol.fr \
    --cc=wischnow@informatik.hu-berlin.de \
    --cc=zsh-workers@sunsite.auc.dk \
    --cc=zsh.Andy@spiegl.de \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://git.vuxu.org/mirror/zsh/

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).