From: Bart Schaefer <schaefer@brasslantern.com>
To: zsh-users@zsh.org
Subject: Re: bracketed paste mode in xterm and urxvt
Date: Thu, 28 May 2015 15:30:15 -0700 [thread overview]
Message-ID: <150528153015.ZM11683@torch.brasslantern.com> (raw)
In-Reply-To: <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.
next prev parent reply other threads:[~2015-05-28 22:30 UTC|newest]
Thread overview: 13+ messages / expand[flat|nested] mbox.gz Atom feed top
2011-05-22 19:16 Mikael Magnusson
2015-05-28 11:42 ` Jérémie Roquet
2015-05-28 19:16 ` Yuri D'Elia
2015-05-28 20:30 ` Daniel Hahler
2015-05-28 22:30 ` Bart Schaefer [this message]
2015-05-29 10:00 ` Yuri D'Elia
2015-06-03 8:35 ` Jesper Nygårds
2015-06-03 8:48 ` toki clover
2015-06-03 10:04 ` Yuri D'Elia
2015-06-03 10:14 ` Jesper Nygårds
2015-06-03 12:06 ` Mikael Magnusson
2015-06-03 14:01 ` Yuri D'Elia
2015-06-06 8:51 ` toki clover
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=150528153015.ZM11683@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).