zsh-workers
 help / color / mirror / code / Atom feed
* [PATCH 0/2] Custom init and finish hooks with vared
@ 2013-03-23 14:46 Frank Terbeck
  2013-03-23 14:46 ` [PATCH 1/2] zle: Make sure state changes are refreshed after init hook Frank Terbeck
                   ` (2 more replies)
  0 siblings, 3 replies; 5+ messages in thread
From: Frank Terbeck @ 2013-03-23 14:46 UTC (permalink / raw)
  To: zsh-workers

So, I wanted to write a function that helps me write commit messages with
git from the command line, roughly like this:

#+begin_src shell-script
local msg name email
name=$(git config --get user.name)
email=$(git config --get user.email)
msg="

Signed-off-by: $name <$email>"

vared -p $' - type your commit message -\n' msg
printf '%s\n' "$msg" | git commit -F-
#+begin_src shell-script

Of course, I wanted to have the cursor at the very beginning of the
vared buffer after vared started up. I could have done it by using
$CONTEXT and some other state-handling variables all within
`zle-line-init', but I think being able to do it the way the second
patch of this series implements is way more elegant.

Documentation update coming up, unless someone screams "this has no
chance of making it into the core!"... ;)

Regards, Frank


Frank Terbeck (2):
  zle: Make sure state changes are refreshed after init hook
  Let vared define custom init and finish hooks

 Src/Zle/zle_main.c | 25 ++++++++++++++++---------
 1 file changed, 16 insertions(+), 9 deletions(-)

-- 
1.8.2.rc1


^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2013-06-17 14:53 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2013-03-23 14:46 [PATCH 0/2] Custom init and finish hooks with vared Frank Terbeck
2013-03-23 14:46 ` [PATCH 1/2] zle: Make sure state changes are refreshed after init hook Frank Terbeck
2013-06-17 14:53   ` Mikael Magnusson
2013-03-23 14:46 ` [PATCH 2/2] Let vared define custom init and finish hooks Frank Terbeck
2013-03-23 17:07 ` [PATCH 3/2] Add documentation for the new -i and -f options of vared Frank Terbeck

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).