From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 24892 invoked from network); 9 Mar 2000 15:53:58 -0000 Received: from sunsite.auc.dk (130.225.51.30) by ns1.primenet.com.au with SMTP; 9 Mar 2000 15:53:58 -0000 Received: (qmail 10478 invoked by alias); 9 Mar 2000 15:53:47 -0000 Mailing-List: contact zsh-workers-help@sunsite.auc.dk; run by ezmlm Precedence: bulk X-No-Archive: yes X-Seq: 10029 Received: (qmail 10466 invoked from network); 9 Mar 2000 15:53:47 -0000 Message-ID: <38C7C8D6.A69E1E6C@u.genie.co.uk> Date: Thu, 09 Mar 2000 15:52:54 +0000 From: Oliver Kiddle X-Mailer: Mozilla 4.72 [en] (Win95; I) X-Accept-Language: en MIME-Version: 1.0 To: Zsh workers Subject: PATCH: fix bug with Ctrl-^ handling Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit My normal editor allows Ctrl-6 and Shift-Ctrl-6 to be used for changing the case of the current selection. Sadly my terminal won't distinguish between the two keystrokes but I thought I'd bind it to uppercase the current word in zsh anyway. This revealed a bug in getkeystring(): in 3.1.6-dev-19: bindkey '^^' capitalise-word bindkey: cannot bind to an empty key sequence in Bart's preliminary 3.0.8 I don't get an error message but the key continues to do nothing. The problem was that in getkeystring() both '^'s are picked up and taken to set the variable control so the bindkey command works as if I had used just '^' as the key parameter. The following small patch fixes it. I have included patches for both 3.1.6 and 3.0.8 so you may need to separate them first or something. Oliver Kiddle --- zsh-3.1.6-dev-19/Src/utils.c.bak Thu Mar 9 15:03:36 2000 +++ zsh-3.1.6-dev-19/Src/utils.c Thu Mar 9 15:28:24 2000 @@ -3198,7 +3198,7 @@ } else if (fromwhere == 4 && *s == Snull) { for (u = t; (*u++ = *s++);); return t + 1; - } else if (*s == '^' && + } else if (*s == '^' && !control && (fromwhere == 2 || fromwhere == 5 || fromwhere == 6)) { control = 1; continue; --- zsh-3.0.8/Src/zle_main.c.bak Thu Mar 9 15:25:39 2000 +++ zsh-3.0.8/Src/zle_main.c Thu Mar 9 15:26:23 2000 @@ -845,7 +845,7 @@ } break; } - } else if (*s == '^' && fromwhere == 2) { + } else if (*s == '^' && !control && fromwhere == 2) { control = 1; continue; } else if (*s == Meta)