Zsh Mailing List Archive
Messages sorted by:
Reverse Date,
Date,
Thread,
Author
Re: ${(k)widgets} v. 'zle -la'
- X-seq: zsh-users 21734
- From: Bart Schaefer <schaefer@xxxxxxxxxxxxxxxx>
- To: zsh-users@xxxxxxx
- Subject: Re: ${(k)widgets} v. 'zle -la'
- Date: Tue, 5 Jul 2016 14:01:20 -0700
- Dkim-signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=brasslantern-com.20150623.gappssmtp.com; s=20150623; h=from:message-id:date:in-reply-to:comments:references:to:subject :mime-version; bh=OKKheFjvEJq8vhhlGvPQeXLYI+OutM8evUHBqtbRhBU=; b=kUmd/OZu8NacXcVNVO48gGTnpgdVKOe4iiINQd12FoRCZKNIQ9cz5lbSZQChHKSDtn sctUlCqI37wfNuCQveRucaLPoIVKOGdxWzJyWUY3tOKhvxSPZbhwkkjSuyUqw49EeZ90 ZU/aKGMEWOT18SwvcvCSTVulvFnbGeABrRUTat9Qat28ZAVlYC9riFsSplPevLQyISxZ pGtQf13vmp7S/bA0OZdJlb1S4Q+ep0GsQto7T7qHtI8FAfQ/aSse97VOIhjr62zxemzs UubIueQuaVVF57ANHcQ8/LQ8o/HK+BRxVIRxonQda7oa/qvnagRh6EU+ysqaidcLsz2v wsKQ==
- In-reply-to: <20160705045758.GA18441@tarsus.local2>
- List-help: <mailto:zsh-users-help@zsh.org>
- List-id: Zsh Users List <zsh-users.zsh.org>
- List-post: <mailto:zsh-users@zsh.org>
- Mailing-list: contact zsh-users-help@xxxxxxx; run by ezmlm
- References: <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.
Messages sorted by:
Reverse Date,
Date,
Thread,
Author