Zsh Mailing List Archive
Messages sorted by: Reverse Date, Date, Thread, Author

Re: delete-to-char



Not waiting for the bits to dry, I generated this patch.  In the
course of testing this, I found that M-digit did not work for me with
bindkey -me, even though bindkey thinks they are bound to
digit-argument.  M-anydigit just beeps.  "od -x" tells me that M-0
sends 0xb0, M-1 sends 0xb1, etc.  Do I have my xterm/stty settings
wrong, or is this a bug in zsh.

ESC-digit does work, so I did manage to test this.

  - vin

--- Src/Zle/deltochar.c.orig	Wed Jun 23 08:12:25 1999
+++ Src/Zle/deltochar.c	Wed Sep 22 22:24:16 1999
@@ -43,7 +43,8 @@
 	    while (dest != ll && line[dest] != c)
 		dest++;
 	    if (dest != ll) {
-		dest++;
+		if (n > 0)
+		    dest++;
 		if (!n) {
 		    forekill(dest - cs, 0);
 		    ok++;
@@ -59,7 +60,7 @@
 		dest--;
 	    if (line[dest] == c) {
 		if (!n) {
-		    backkill(cs - dest, 1);
+		    backkill(cs - dest - 1, 1);
 		    ok++;
 		}
 		if (dest)
--- Doc/Zsh/mod_deltochar.yo.orig	Tue Jun 22 04:02:49 1999
+++ Doc/Zsh/mod_deltochar.yo	Wed Sep 22 22:28:37 1999
@@ -6,7 +6,7 @@
 tindex(delete-to-char)
 item(tt(delete-to-char))(
 Read a character from the keyboard, and
-delete from the cursor position up to and including the next
+delete from the cursor position up to but not including the next
 (or, with repeat count var(n), the var(n)th) instance of that character.
 )
 enditem()


>>>>> On 20 Sep 1999, I wrote:

Vin> OK, I'm waking up to the new world of modules and I came across the
Vin> deltochar module and the delete-to-char function.  I hope I'm not
Vin> rehashing an old discussion, but both XEmacs (as of 21.0) and FSF
Vin> Emacs (as of at least 20.4) now define zap-to-char as deleting up to
Vin> but not including the specified character.  It would be good, IMHO, to
Vin> have delete-to-char model that functionality.  Currently
Vin> delete-to-char deletes up to and including the specified character.

Vin> I can submit a patch if people were amenable to this change.
Vin> Whaddaya think?

Vin>   - vin




Messages sorted by: Reverse Date, Date, Thread, Author