From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: zsh-workers-request@euclid.skiles.gatech.edu Received: from euclid.skiles.gatech.edu (list@euclid.skiles.gatech.edu [130.207.146.50]) by coral.primenet.com.au (8.7.6/8.7.3) with ESMTP id UAA11550 for ; Tue, 26 Nov 1996 20:01:18 +1100 (EST) Received: (from list@localhost) by euclid.skiles.gatech.edu (8.7.3/8.7.3) id DAA11976; Tue, 26 Nov 1996 03:45:40 -0500 (EST) Resent-Date: Tue, 26 Nov 1996 03:45:40 -0500 (EST) From: Zefram Message-Id: <1922.199611260846@stone.dcs.warwick.ac.uk> Subject: Re: big key binding patch To: zsh-workers@math.gatech.edu (Z Shell workers mailing list) Date: Tue, 26 Nov 1996 08:46:13 +0000 (GMT) In-Reply-To: <14598.199611252205@stone.dcs.warwick.ac.uk> from "Zefram" at Nov 25, 96 10:05:14 pm X-Patch: 135 X-Loop: zefram@dcs.warwick.ac.uk X-Stardate: [-31]8481.82 X-US-Congress: Moronic fuckers Content-Type: text Resent-Message-ID: <"g0n8f2.0.1x2.pugco"@euclid> Resent-From: zsh-workers@math.gatech.edu X-Mailing-List: archive/latest/2479 X-Loop: zsh-workers@math.gatech.edu Precedence: list Resent-Sender: zsh-workers-request@math.gatech.edu -----BEGIN PGP SIGNED MESSAGE----- Okay, this patch fixes some problems with the key binding patch: * Src/zle_main.c: restored Thorsten's hack to avoid an illegal initialiser. And commented it (-: * Src/zle_vi.c: the one place I forgot to keep the bindtab and keybindtab in synch... This caused SEGV when pressing in vi command mode. (grep verifies that the binding tables are maintained together correctly everywhere else.) * configure.in: added -pedantic to the debugging version of the automatic gcc flags, just to keep us honest. Also made the automatic LDFLAGS work the same way as the CFLAGS, and automatically use -s when not debugging. Just to reiterate what I said yesterday, we should *not* use the patch to bind the ANSI arrow key sequences in vi insert mode. It is completely the wrong thing to do, and actually causes more problems. -zefram Index: configure.in =================================================================== RCS file: /home/zefram/usr/cvsroot/zsh/configure.in,v retrieving revision 1.1.1.25 retrieving revision 1.24 diff -c -r1.1.1.25 -r1.24 *** configure.in 1996/11/21 00:03:36 1.1.1.25 --- configure.in 1996/11/25 23:30:26 1.24 *************** *** 183,192 **** dnl CHECK THE COMPILER dnl ------------------ dnl We want these before the checks, so the checks can modify their values. ! test -z "$CFLAGS" && CFLAGS= auto_cflags=1 ! if test "${enable_zsh_debug}" = yes; then ! test -z "$LDFLAGS" && LDFLAGS=-g ! fi AC_PROG_CC --- 183,190 ---- dnl CHECK THE COMPILER dnl ------------------ dnl We want these before the checks, so the checks can modify their values. ! test -z "$CFLAGS" && CFLAGS= auto_cflags=1 ! test -z "$LDFLAGS" && LDFLAGS= auto_ldflags=1 AC_PROG_CC *************** *** 196,202 **** if test -n "$auto_cflags"; then if test "${enable_zsh_debug}" = yes; then if test -n "$GCC"; then ! CFLAGS="$CFLAGS -Wall -Wno-implicit -Wmissing-prototypes -g" else CFLAGS="$CFLAGS -g" fi --- 194,200 ---- if test -n "$auto_cflags"; then if test "${enable_zsh_debug}" = yes; then if test -n "$GCC"; then ! CFLAGS="$CFLAGS -Wall -Wno-implicit -Wmissing-prototypes -pedantic -ggdb" else CFLAGS="$CFLAGS -g" fi *************** *** 206,211 **** --- 204,216 ---- else CFLAGS="$CFLAGS -O" fi + fi + fi + if test -n "$auto_ldflags"; then + if test "${enable_zsh_debug}" = yes; then + LDFLAGS=-g + else + LDFLAGS=-s fi fi Index: Src/zle_main.c =================================================================== RCS file: /home/zefram/usr/cvsroot/zsh/Src/zle_main.c,v retrieving revision 1.30 diff -c -r1.30 zle_main.c *** Src/zle_main.c 1996/11/25 23:23:14 1.30 --- Src/zle_main.c 1996/11/25 23:48:41 *************** *** 1305,1317 **** { int i, *tab = 0; HashTable keytab = NULL; struct { int *tab; ! HashTable keytab; } list[] = { ! { altbindtab, altkeybindtab }, ! { embindtab, emkeybindtab }, ! { vibindtab, vikeybindtab }, { NULL, NULL } }, *ptr; --- 1305,1319 ---- { int i, *tab = 0; HashTable keytab = NULL; + /* N.B. we can't put the HashTable values in this table directly, * + * because ANSI C doesn't allow non-static aggregate initialisers. */ struct { int *tab; ! HashTable *keytabp; } list[] = { ! { altbindtab, &altkeybindtab }, ! { embindtab, &emkeybindtab }, ! { vibindtab, &vikeybindtab }, { NULL, NULL } }, *ptr; *************** *** 1325,1331 **** if(!(notall & 3)) { tab = ptr->tab; ! keytab = ptr->keytab; } /* --- 1327,1333 ---- if(!(notall & 3)) { tab = ptr->tab; ! keytab = *ptr->keytabp; } /* Index: Src/zle_vi.c =================================================================== RCS file: /home/zefram/usr/cvsroot/zsh/Src/zle_vi.c,v retrieving revision 1.18 diff -c -r1.18 zle_vi.c *** Src/zle_vi.c 1996/11/21 01:33:18 1.18 --- Src/zle_vi.c 1996/11/25 23:42:30 *************** *** 496,501 **** --- 496,502 ---- feep(); else { bindtab = altbindtab; + keybindtab = altkeybindtab; undoing = 1; vichgflag = 0; if (cs != findbol()) -----BEGIN PGP SIGNATURE----- Version: 2.6.2 iQCVAwUBMpo15HD/+HJTpU/hAQGtNwP8CIjBDQuB8UcaRl111osw6Wp57Nix10T5 64uhvlhgzMn8/PJdJEzgXpuphGD84wUhg3oLobxKS9q9VKpYKD2W5YrzRriHccRZ XNZqXsxdytbqHeO3DU5vpRqllVkD8Rgmdc3Nmhcm4XB8BKBFJGLYEUQe4lBIBft4 kimueDOZOts= =8ehV -----END PGP SIGNATURE-----