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

Re: [BUG] _gnu_generic completer produces broken output



On 7/28/21, Jun T <takimoto-j@xxxxxxxxxxxxxxxxx> wrote:
>> 2021/07/27 12:57, Jun T <takimoto-j@xxxxxxxxxxxxxxxxx> wrote:
>>
>> The case in workers/48091 is more obscure for me:
>>
>>> autoload -Uz compinit; compinit
>>> zstyle ':completion:*:functions' ignored-patterns
>>> '[[:punct:]]*[[:alnum:]]*'
>>> zstyle ':completion:*:options' matcher 'b:-=+'
>>
>> First _main_complete:218 calls _complete, but it fails (returns 1); why?
>
> It fails because _functions (the last command run in _typeset) fails,
> and _functions fails because there is no functions whose name starts with
> '-'.
> Not calling _functions when completing options (as in my previous patch)
> solves the problem, but I think it would be better to correctly set the
> return value of _typeset as in the patch below.
>
> If return value is correctly set, the previous patch
>
> -    else
> +    elif [[ $PREFIX != [-+]* ]]; then
>
> is not necessary, but I kept it because calling _functions when completing
> options is just a waste of time (I assume no one would create a function
> whose
> name starts with '-' or '+').

You are (unfortunately) wrong about that:
% grep ' [+-][-a-zA-Z_]* *()' \#zsh.log
15:11 <Fandekasp> kind of esc, I've done this
http://pastebin.com/TeuTQfmk  and by added the misc %m in the formats,
I'm now seeing the stuff given by +vi-git-st()
00:17 <Stalafin> If I encounter a function like "function +foo() {
.... }", what does the + mean? Or does it have no meaning at all?
00:18 <Stalafin> as in: function +foo()
08:31 <Sample> because i don't want to overwrite the -init(), but i
also apparently don't want the zle -K within -keymap-select
08:37 <rking> +vi-tone-down-master() {
hook_com[branch]=${hook_com[branch]/#%master/st} }
08:44 <rking> +vi-check-untracked() {
22:04 <ft> I'd probably build functions such as +zlogin_red() and then
unfunction the whole +zlogin_* namespace.
02:55 <excalibr> +vi-git-untracked() { bla }
23:32 <osse> > +foo() { echo hello }; +foo
16:11 <OxCEA5ED> -() { print huhu }
16:11 <OxCEA5ED> > -() { print huhu }; -; which -
16:11 <OxCEA5ED> > -() { print huhu }; which -
16:12 <ccxCZ> > -() { print huhu }; which - -
16:12 <SweetieBot> ccxCZ: - () {
15:01 <FauxFaux> So /lastlog -regexp () # crashes irssi.  This is not
a good way to find examples of function declarations.
07:25 <llua> > -foo() echo hi; -foo
22:53 <psprint> or rather -strlen(), as r should be raw bytes
15:09 <osse> +vi-check-untracked() {
15:11 <osse> >> +lol() { echo lol }; +lol
15:43 <osse> +vi-check-upstream() {
22:13 <Mikachu> > ls -l () hi; which - -l
22:13 <machabot> Mikachu: -l () {
00:21 <shadowkyogre> random question again. So why does it complain
about bad option when I do "alias -='cd -'", but when I do -(){builtin
cd -}, it allows me to declare that? I do find the function
declaration workaround handy, but I was wondering if there was
anything I'd need to be aware of when doing that.
10:18 <osse> and +vi-shorten-hash() changes the contents of $hook_com[applied]
10:30 <danielsh> should work.  +vi-applied-string() {
hook_com[applied-string]="${${1%% *}[1,12]} ${1#* }"; ret=1 }
20:17 <thrig> > -ke-bab-() { print $ZSH_VERSION }; -ke-bab-
06:37 <jp> how do you trigger +() then as ksh glob?
04:29 <okdana> zstyle ':vcs_info:git*+set-message:*' hooks yourfunc;
+vi-yourfunc() { get the info }
13:15 <rnmhdn> how can I make this seq 2 | xargs -l () {printf '%s %s'
"$1" "xxx\n";}
16:03 <osse> replicant:  +vi-add-space() {
hook_com[branch]+=${hook_com[branch]:+ } }
03:05 <psprint> I wonder what is the diff regex that tells it to
choose builtin source ${ZPLGM[BIN_DIR]}"/zplugin-side.zsh" over
-zplg-download-snippet() as the function name to display after the @@
... @@
03:08 <psprint> or @ zplugin.zsh:1207 @ builtin setopt noaliases  over
@ ... @ -zplg-load-snippet() { Isn't this ridiculous?

-- 
Mikael Magnusson




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