Zsh Mailing List Archive
Messages sorted by:
Reverse Date,
Date,
Thread,
Author
Re: bracketed paste mode in xterm and urxvt
- X-seq: zsh-users 20235
- From: Bart Schaefer <schaefer@xxxxxxxxxxxxxxxx>
- To: zsh-users@xxxxxxx
- Subject: Re: bracketed paste mode in xterm and urxvt
- Date: Thu, 28 May 2015 15:30:15 -0700
- In-reply-to: <55677AF5.50709@thequod.de>
- 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: <BANLkTikh_-+L2W5=Yfu7h7iAe5CcpP6fxw@mail.gmail.com> <CAFOazAOfk=Sq-smkMGzJKO4b7jMb_1_m4vXXn8twoVA2wV55YA@mail.gmail.com> <55677AF5.50709@thequod.de>
On May 28, 10:30pm, Daniel Hahler wrote:
}
} I've stumbled upon it recently, too, and noticed that the handling of
} zle-line-init and zle-line-finish should be improved to not overwrite
} an already defined function.
}
} I am using the following pattern to add additional code to these hooks:
}
} eval "zle-line-init() { something_new; $functions[zle-line-init]; }"
} eval "zle-line-finish() { something_new; $functions[zle-line-finish]; }"
}
} Does this make sense?
Mostly; in some obscure cases (e.g., zle-line-init is an autoload and has
not yet been loaded) it could break.
} Would this be something that add-zsh-hook could provide?
Possibly, though it would require its own separate conditional branch
because zle-line-init is not the same flavor of "hook" as everything else.
One way to do this is something like so:
zle-line-init() {
local w
for w in "${(@ok)widgets%zle-line-init-*}"
do zle $w "$@"
done
}
Then you just create widgets named zle-line-init-N where N represents
the order you want them to execute. Similarly for zle-line-finish.
Messages sorted by:
Reverse Date,
Date,
Thread,
Author