zsh-workers
 help / color / mirror / code / Atom feed
From: Sven Wischnowsky <wischnow@informatik.hu-berlin.de>
To: zsh-workers@sunsite.auc.dk
Subject: Re: Completion for mutt (with PATCH)
Date: Tue, 15 Feb 2000 10:33:57 +0100 (MET)	[thread overview]
Message-ID: <200002150933.KAA12184@beta.informatik.hu-berlin.de> (raw)
In-Reply-To: "Bart Schaefer"'s message of Mon, 14 Feb 2000 17:21:10 +0000


Bart Schaefer wrote:

> 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.

Remember: for most options, compadd uses the first occurrence if they
are given more than once (the exception is -M -- all of them are
used).

In other words: the arguments given to _mailboxes override the
defaults it builds itself.

> 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 ...

Not really. _files parses its arguments and takes all interesting
options to give it to _path_files. Some time ago it just did the same
as _mailboxes, but with the appearence of tags _files had to learn to
modify or ignore some of the things it got (e.g. a -g option).

> ...
> 
> } > 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.)

First, I would get rid of the (expansion of) ~/Mail at the beginning
of all the strings in the cache. And then just use _multi_parts like
_tar does. (I haven't really looked at how the cache looks like
because I use a self-written mail reader, but I guess it just contains 
filenames and stuff, right?)


Some doc fixes.

Bye
 Sven

diff -ru ../z.old/Doc/Zsh/compwid.yo Doc/Zsh/compwid.yo
--- ../z.old/Doc/Zsh/compwid.yo	Tue Feb 15 10:04:06 2000
+++ Doc/Zsh/compwid.yo	Tue Feb 15 10:25:04 2000
@@ -548,7 +548,7 @@
 item(tt(-M) var(match-spec))(
 This gives local match specifications as described below in
 noderef(Matching Control). This option may be given more than once. In 
-this case all var(match-spec)s given are contaneted with speces
+this case all var(match-spec)s given are concatenated with spaces
 between them to form the specification string to use.
 Note that they will only be used if the tt(-U) option is not given.
 )
@@ -589,6 +589,9 @@
 hyphens.
 )
 enditem()
+
+Except for the tt(-M) flag, if any of these flags is given more than
+once, the first one (and its argument) will be used.
 )
 findex(compset)
 cindex(completion widgets, modifying special parameters)

--
Sven Wischnowsky                         wischnow@informatik.hu-berlin.de


                 reply	other threads:[~2000-02-15  9:34 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

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=200002150933.KAA12184@beta.informatik.hu-berlin.de \
    --to=wischnow@informatik.hu-berlin.de \
    --cc=zsh-workers@sunsite.auc.dk \
    /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).