zsh-users
 help / color / mirror / code / Atom feed
From: Bart Schaefer <schaefer@brasslantern.com>
To: zsh-users@zsh.org
Subject: Re: ${(k)widgets} v. 'zle -la'
Date: Tue, 5 Jul 2016 14:01:20 -0700	[thread overview]
Message-ID: <160705140120.ZM17175@torch.brasslantern.com> (raw)
In-Reply-To: <20160705045758.GA18441@tarsus.local2>

On Jul 5,  4:57am, Daniel Shahaf wrote:
} Subject: ${(k)widgets} v. 'zle -la'
}
} $ zsh -f
} % bindkey zzzzzz foobar
} % zle -la | grep foobar                   
} % print -rl -- ${(k)widgets} | grep foobar 
} foobar
} % 
} 
} Is it intentional that 'foobar' is listed by 'zle -la' but not by
} ${(k)widgets}?  I'd expected those two to enumerate the same set of
} widgets.

It's actually the other way around, yes?  It's in $widgets but not in
"zle -la"?  

} Observations:
} 
} - The manual speaks of "all existing widgets" for the former and of "all
}   defined widgets" for the latter.

("the former" == zle, "the latter" == $widgets) That's not quite what the
doc for $widgets says, but in any case you're missing the crucial bit:
"zle -la" lists only USER-DEFINED widgets, wheras $widgets includes ALL
widgets.  In your example the "foobar" widget doesn't exist yet, so it
isn't user-defined, so "zle -la" doesn't show it.

Now you might argue that any widget that isn't a builtin must be user-
defined, so naming a widget that doesn't exist should cause that widget
to be listed by "zle -la".  However, you'd be forgetting that zmodload
may pull in additional builtin widgets, so there's no reason for zle to
presume that "foobar" will eventually become user-defined as opposed to
becoming a module-defined builtin.


  reply	other threads:[~2016-07-05 21:01 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-07-05  4:57 Daniel Shahaf
2016-07-05 21:01 ` Bart Schaefer [this message]
     [not found] ` <160705140120.ZM17175__36700.8317648017$1467752558$gmane$org@torch.brasslantern.com>
2016-07-07  2:00   ` Daniel Shahaf
2016-07-07 16:49     ` Bart Schaefer
     [not found]     ` <160707094921.ZM23499__38105.0642965876$1467910230$gmane$org@torch.brasslantern.com>
2016-07-13  4:59       ` Daniel Shahaf
2016-07-13  8:23         ` Peter Stephenson

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=160705140120.ZM17175@torch.brasslantern.com \
    --to=schaefer@brasslantern.com \
    --cc=zsh-users@zsh.org \
    /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).