zsh-workers
 help / color / mirror / code / Atom feed
From: Frank Terbeck <ft@bewatermyfriend.org>
To: zsh-workers@zsh.org
Subject: [PATCH 0/2] Custom init and finish hooks with vared
Date: Sat, 23 Mar 2013 15:46:36 +0100	[thread overview]
Message-ID: <1364049998-22603-1-git-send-email-ft@bewatermyfriend.org> (raw)

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


             reply	other threads:[~2013-03-23 14:55 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-03-23 14:46 Frank Terbeck [this message]
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

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=1364049998-22603-1-git-send-email-ft@bewatermyfriend.org \
    --to=ft@bewatermyfriend.org \
    --cc=zsh-workers@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).