From: "Bart Schaefer" <schaefer@candle.brasslantern.com>
To: "Andrej Borsenkow" <Andrej.Borsenkow@mow.siemens.ru>,
<zsh-workers@sunsite.auc.dk>
Subject: Re: PATCH: _insert_all_matches bindable command
Date: Fri, 22 Sep 2000 15:13:08 +0000 [thread overview]
Message-ID: <1000922151308.ZM7937@candle.brasslantern.com> (raw)
In-Reply-To: <001901c022f3$1cf94770$21c9ca95@mow.siemens.ru>
On Sep 20, 3:08pm, Andrej Borsenkow wrote:
}
} - I could not find a way to supress suffix addition. It is weird as it is
} added only to the last match anyway. Sven?
This happens any time you insert multiple matches. Look at the code for
the add-space style in _expand -- it deliberately changes the compadd
command for each match in order to suppress the suffix or change it to
a space.
} sourceforge CVS server is down, so I just send the function itself
BTW, for those of you who don't get sourceforge user update mailings, the
scheduled downtime this weekend has been canceled, and will be sometime in
October instead.
} zstyle -s ":completion:${curcontext}:" old-list list
}
} # If there is already an old list,
} # and either the style :insert-all-matches:old-list is `always',
^^^^^^^^^^^^^^^^^^^^^^^^^^^^
:completion:insert-all-matches:* old-list ??
} # or it is not `never', then insert the existing list
} # (even if it was generated by another widget).
} # Else just call completion and insert whatever matches it generated
} # TODO: does not work in menu selection
}
}
} if [[ -n $compstate[old_list] && $list != never &&
} $LASTWIDGET != _complete_help && $WIDGET != _complete_help ]]; then
It's never possible for $WIDGET to be _complete_help, is it? Both this
function and _complete_help must be separately bound to keystrokes. You
would only need to test $WIDGET if this were a completer like _expand.
And you can do
if [[ -n $compstate[old_list] ]] && $LASTWIDGET != _complete_help &&
! zstyle -t ":completion:${curcontext}:" old-list never; then
instead of separately fetching the value into $list and then testing it.
} else
} curcontext="$oldcurcontext"
} _main_complete
} ret=$?
} compstate[insert]=all
} return $ret
} fi
Why reset the current context? And why not just
_main_complete && compstate[insert]=all
?? Do you really want to set compstate[insert] when the function is going
to return nonzero?
--
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
next prev parent reply other threads:[~2000-09-22 15:23 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
[not found] <1000919021428.ZM30137@candle.brasslantern.com>
2000-09-20 11:08 ` Andrej Borsenkow
2000-09-22 15:13 ` Bart Schaefer [this message]
2000-09-22 15:47 ` Suffixes and menu completion vs. menu selection Bart Schaefer
2000-10-04 11:28 PATCH: _insert_all_matches bindable command Sven Wischnowsky
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=1000922151308.ZM7937@candle.brasslantern.com \
--to=schaefer@candle.brasslantern.com \
--cc=Andrej.Borsenkow@mow.siemens.ru \
--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).