[Pkg-zsh-devel] Bug#872685: zshrc: zsh-common: zsh-line-init should use add-zle-hook-function

Daniel Shahaf danielsh at apache.org
Sun Aug 20 02:36:18 UTC 2017


Package: zsh-common
Version: 5.4.1-1
Severity: wishlist
File: zshrc
Tags: newcomer

Dear Maintainer,

/etc/zsh/zshrc defines zle-line-init and zle-line-finish widgets and
functions.

It should instead define arbitrarily-named functions and register them
using add-zle-hook-widget.

That matters if a zle-line-* widget has been registered before
/etc/zsh/zshrc is sourced (either with or without add-zle-hook-widget),
or if a zle-line-* widget will be registered after /etc/zsh/zshrc
without add-zle-hook-widget: in either case, someone will overwrite
someone else's zle-line-init widget.

(Use of add-zle-hook-widget preserves any pre-existing zle-line-* widgets.)

Also, there's some educational value in using add-zle-hook-widget: it
advertises that feature's existence.

Cheers,

Daniel



More information about the Pkg-zsh-devel mailing list