zsh-workers
 help / color / mirror / code / Atom feed
From: Greg Klanderman <gak@klanderman.net>
To: zsh-workers@sunsite.dk
Subject: Re: PATCH: add zle-line-finish special widget
Date: Tue, 27 Jan 2009 23:38:17 -0500	[thread overview]
Message-ID: <m3eiyojb9i.fsf@klanderman.net> (raw)
In-Reply-To: <20090123093749.1e6be9fe@news01> (Peter Stephenson's message of "Fri, 23 Jan 2009 09:37:49 +0000")

[-- Attachment #1: Type: text/plain, Size: 117 bytes --]


Hi Peter and Bart,

Here is an updated version of the patch for this feature.

thanks for your help on this,
Greg



[-- Attachment #2: zsh-finish.patch --]
[-- Type: text/plain, Size: 1455 bytes --]

Index: Doc/Zsh/zle.yo
===================================================================
RCS file: /cvsroot/zsh/zsh/Doc/Zsh/zle.yo,v
retrieving revision 1.76
diff -u -r1.76 zle.yo
--- Doc/Zsh/zle.yo	19 Jan 2009 17:57:43 -0000	1.76
+++ Doc/Zsh/zle.yo	28 Jan 2009 04:26:36 -0000
@@ -871,6 +872,11 @@
 (The command inside the function sets the keymap directly; it is
 equivalent to tt(zle vi-cmd-mode).)
 )
+tindex(zle-line-finish)
+item(tt(zle-line-finish))(
+This is similar to tt(zle-line-init) but is executed every time the
+line editor has finished reading a line of input.
+)
 tindex(zle-keymap-select)
 item(tt(zle-keymap-select))(
 Executed every time the keymap changes, i.e. the special parameter
Index: Src/Zle/zle_main.c
===================================================================
RCS file: /cvsroot/zsh/zsh/Src/Zle/zle_main.c,v
retrieving revision 1.121
diff -u -r1.121 zle_main.c
--- Src/Zle/zle_main.c	9 Dec 2008 17:37:01 -0000	1.121
+++ Src/Zle/zle_main.c	28 Jan 2009 04:26:36 -0000
@@ -1212,6 +1212,19 @@
 
     zlecore();
 
+    if (done && !exit_pending && !errflag &&
+	(initthingy = rthingy_nocreate("zle-line-finish"))) {
+	int saverrflag = errflag;
+	int savretflag = retflag;
+	char *args[2];
+	args[0] = initthingy->nam;
+	args[1] = NULL;
+	execzlefunc(initthingy, args, 1);
+	unrefthingy(initthingy);
+	errflag = saverrflag;
+	retflag = savretflag;
+    }
+
     statusline = NULL;
     invalidatelist();
     trashzle();

      reply	other threads:[~2009-01-28  4:38 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <18789.30656.261463.382208@gargle.gargle.HOWL>
     [not found] ` <20090110095231.GA61601@redoubt.spodhuis.org>
     [not found]   ` <m33afq97gg.fsf@klanderman.net>
     [not found]     ` <20090111025418.GA7272@redoubt.spodhuis.org>
     [not found]       ` <m3tz857mkm.fsf@klanderman.net>
     [not found]         ` <090111110748.ZM12349@torch.brasslantern.com>
     [not found]           ` <m3r63975pd.fsf@klanderman.net>
     [not found]             ` <m3ocyd70aj.fsf@klanderman.net>
     [not found]               ` <090111193317.ZM12655@torch.brasslantern.com>
2009-01-12  4:00                 ` some way to inherit kill ring in su'd shell? Greg Klanderman
2009-01-12  5:33                   ` Bart Schaefer
2009-01-12 19:33                     ` Greg Klanderman
2009-01-12 23:55                       ` Richard Hartmann
2009-01-16 23:54                   ` PATCH: add zle-line-finish special widget Greg Klanderman
2009-01-17 17:48                     ` Peter Stephenson
2009-01-17 18:08                     ` Bart Schaefer
2009-01-23  0:50                       ` Greg Klanderman
2009-01-23  9:37                         ` Peter Stephenson
2009-01-28  4:38                           ` Greg Klanderman [this message]

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=m3eiyojb9i.fsf@klanderman.net \
    --to=gak@klanderman.net \
    --cc=zsh-workers@sunsite.dk \
    /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).