zsh-workers
 help / color / mirror / code / Atom feed
From: Zefram <zefram@dcs.warwick.ac.uk>
To: zsh-workers@math.gatech.edu (Z Shell workers mailing list)
Subject: Re: big key binding patch
Date: Tue, 26 Nov 1996 08:46:13 +0000 (GMT)	[thread overview]
Message-ID: <1922.199611260846@stone.dcs.warwick.ac.uk> (raw)
In-Reply-To: <14598.199611252205@stone.dcs.warwick.ac.uk> from "Zefram" at Nov 25, 96 10:05:14 pm

-----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 <ESC> 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-----


  reply	other threads:[~1996-11-26  9:01 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
1996-11-24 15:30 Zefram
1996-11-25 13:22 ` Peter Stephenson
1996-11-25 16:02   ` Zefram
1996-11-25 18:57     ` Thorsten Meinecke
1996-11-25 22:05       ` Zefram
1996-11-26  8:46         ` Zefram [this message]
1996-11-26 12:03 Duncan Sinclair
1996-11-26 12:10 ` Zefram

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=1922.199611260846@stone.dcs.warwick.ac.uk \
    --to=zefram@dcs.warwick.ac.uk \
    --cc=zsh-workers@math.gatech.edu \
    /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).