lynx-dev
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [2.8.1rel.2] lineedit cleanup/enhancement - take 3 (was: Re: lynx-de


From: Kim DeVaughn
Subject: Re: [2.8.1rel.2] lineedit cleanup/enhancement - take 3 (was: Re: lynx-dev [lynx2.8.1rel.2] lineedit bug fix (and enhancement))
Date: Tue, 3 Nov 1998 17:06:45 -0800

On Tue, Nov 03, 1998, Bela Lubkin (address@hidden) said:
|
| Kim DeVaughn wrote:
| >
| > The attached patch now removes the redundent LYE_DELC case code from
| > LYStrings.c, and add the new LYE_DELEOL case (which deletes characters
| > from the current cursor position, thru the end-of-line).
| >
| > Default binding for DELEOL is ^\ (formerly a NOP).
|
| On almost all Unix systems, ^\ is, by default, the `quit' character.  It
| sends SIGQUIT, which causes most programs to dump core (that's its
| purpose).  This can be blocked by ignoring SIGQUIT.
|
| I find no references to SIGQUIT in the Lynx source, including in your
| patch.  Hitting ^\ in my (un-patched) Lynx causes it to dump core, as
| expected.
|
| This isn't a good default binding, as it will cause problems on a large
| percentage of the systems that use Lynx.  Fixing it by blocking SIGQUIT
| wouldn't be good either -- it exists for good reason (e.g. to be able to
| generate a dump from a hung Lynx, for analysis).
|
| I don't object to the feature, just the default binding...

Heh.  Forgot about that usage of C-\.

FWIW, stty -a shows it bound to "quit" on this FreeBSD 2.2.7-STABLE system,
but it seems to have no effect on lynx (nor any other app, for that matter).
Wonder where it's getting snarfed up ...?...


As may be, I rebound the default for LYE_DELEOL to ^_ (which I *hope* is a
safe choice).

Also fixed a couple more doc references to emacs/vi keys to reflect that
they have no effect on the line-edit bindings.

/kim


diff -uNr lynx-2.8.1-rel.2.orig/src/LYStrings.c 
lynx-2.8.1-rel.2+kd/src/LYStrings.c
--- lynx-2.8.1-rel.2.orig/src/LYStrings.c       Tue Nov  3 15:43:03 1998
+++ lynx-2.8.1-rel.2+kd/src/LYStrings.c Mon Nov  2 22:49:25 1998
@@ -1514,14 +1514,28 @@
        }
        break;
 
+    case LYE_DELEOL:
+        /*
+        *  Delete from current cursor position thru EOL.
+        */
+        {
+            int pos0 = Pos;
+           LYEdit1(edit, 0, LYE_EOL, FALSE);
+            pos0 = Pos - pos0;
+           while (pos0--)
+                LYEdit1(edit, 0, LYE_DELP, FALSE);
+       }
+        break;
+
     case LYE_DELN:
        /*
-        *  Delete next character
+        *  Delete next character (I-beam style cursor), or current
+        *  character (box/underline style cursor).
         */
        if (Pos >= length)
            break;
        Pos++;
-       /* fall through */
+       /* fall through - DO NOT RELOCATE the LYE_DELN case wrt LYE_DELP */
 
     case LYE_DELP:
        /*
@@ -1530,18 +1544,6 @@
        if (length == 0 || Pos == 0)
            break;
        Pos--;
-       for (i = Pos; i < length; i++)
-           Buf[i] = Buf[i+1];
-       i--;
-       Buf[i] = 0;
-       break;
-
-    case LYE_DELC:
-       /*
-        *  Delete current character.
-        */
-       if (length == 0 || Pos == length)
-           break;
        for (i = Pos; i < length; i++)
            Buf[i] = Buf[i+1];
        i--;
diff -uNr lynx-2.8.1-rel.2.orig/src/LYStrings.h 
lynx-2.8.1-rel.2+kd/src/LYStrings.h
--- lynx-2.8.1-rel.2.orig/src/LYStrings.h       Tue Nov  3 15:43:03 1998
+++ lynx-2.8.1-rel.2+kd/src/LYStrings.h Mon Nov  2 16:52:35 1998
@@ -122,9 +122,9 @@
 #define LYE_TAB   (LYE_ENTER +1)  /* Input complete, return TAB  */
 #define LYE_ABORT (LYE_TAB   +1)  /* Input cancelled       */
 
-#define LYE_DELN  (LYE_ABORT +1)  /* Delete next    char   */
-#define LYE_DELC  (LYE_DELN  +1)  /* Delete current char   */
-#define LYE_DELP  (LYE_DELC  +1)  /* Delete prev    char   */
+#define LYE_DELN  (LYE_ABORT +1)  /* Delete next/curr char */
+#define LYE_DELC  (LYE_DELN)      /* Obsolete (DELC case was equiv to DELN) */
+#define LYE_DELP  (LYE_DELN  +1)  /* Delete prev      char */
 #define LYE_DELNW (LYE_DELP  +1)  /* Delete next word      */
 #define LYE_DELPW (LYE_DELNW +1)  /* Delete prev word      */
 
@@ -143,6 +143,8 @@
 #define LYE_LKCMD (LYE_UPPER +1)  /* Invoke command prompt */
 
 #define LYE_AIX   (LYE_LKCMD +1)  /* Hex 97               */
+
+#define LYE_DELEOL (LYE_AIX  +1)  /* Delete thru EOL       */
 
 #if defined(USE_KEYMAPS)
 extern int lynx_initialize_keymaps NOPARAMS;
diff -uNr lynx-2.8.1-rel.2.orig/src/LYEditmap.c 
lynx-2.8.1-rel.2+kd/src/LYEditmap.c
--- lynx-2.8.1-rel.2.orig/src/LYEditmap.c       Tue Nov  3 15:43:03 1998
+++ lynx-2.8.1-rel.2+kd/src/LYEditmap.c Tue Nov  3 15:56:32 1998
@@ -15,7 +15,7 @@
 LYE_NOP,        LYE_BOL,        LYE_DELPW,      LYE_ABORT,
 /* nul          ^A              ^B              ^C      */
 
-LYE_DELC,       LYE_EOL,        LYE_DELNW,      LYE_ABORT,
+LYE_DELN,       LYE_EOL,        LYE_DELNW,      LYE_ABORT,
 /* ^D           ^E              ^F              ^G      */
 
 LYE_DELP,       LYE_ENTER,      LYE_ENTER,      LYE_LOWER,
@@ -33,7 +33,7 @@
 LYE_ERASE,      LYE_NOP,        LYE_NOP,        LYE_NOP,
 /* ^X           ^Y              ^Z              ESC     */
 
-LYE_NOP,        LYE_NOP,        LYE_NOP,        LYE_NOP,
+LYE_NOP,        LYE_NOP,        LYE_NOP,        LYE_DELEOL,
 /* ^\           ^]              ^^              ^_      */
 
 /* sp .. RUBOUT                                         */
@@ -114,9 +114,117 @@
 };
 
 /*
- * Add your favorite key binding HERE
+ * Add your favorite key bindings HERE
  */
 
+/* KED */ /* Default except: ^B=cursor-backward, ^F=cursor-forward,    */
+          /*                 ^K=delete-to-EOL,                         */
+          /*                 ^R=delete-prev-word, ^T=delete-next-word, */
+          /*                 ^^=upper-case-line,  ^_=lower-case-line   */
+
+PRIVATE char BetterEditBinding[]={
+
+LYE_NOP,        LYE_BOL,        LYE_BACK,       LYE_ABORT,
+/* nul          ^A              ^B              ^C      */
+
+LYE_DELN,       LYE_EOL,        LYE_FORW,       LYE_ABORT,
+/* ^D           ^E              ^F              ^G      */
+
+LYE_DELP,       LYE_ENTER,      LYE_ENTER,      LYE_DELEOL,
+/* bs           tab             nl              ^K      */
+
+LYE_NOP,        LYE_ENTER,      LYE_FORWW,      LYE_ABORT,
+/* ^L           cr              ^N              ^O      */
+
+LYE_BACKW,      LYE_NOP,        LYE_DELPW,      LYE_NOP,
+/* ^P           XON             ^R              XOFF    */
+
+LYE_DELNW,      LYE_ERASE,      LYE_LKCMD,      LYE_NOP,
+/* ^T           ^U              ^V              ^W      */
+
+LYE_ERASE,      LYE_NOP,        LYE_NOP,        LYE_NOP,
+/* ^X           ^Y              ^Z              ESC     */
+
+LYE_NOP,        LYE_NOP,        LYE_UPPER,      LYE_LOWER,
+/* ^\           ^]              ^^              ^_      */
+
+/* sp .. RUBOUT                                         */
+LYE_CHAR,       LYE_CHAR,       LYE_CHAR,       LYE_CHAR,
+LYE_CHAR,       LYE_CHAR,       LYE_CHAR,       LYE_CHAR,
+LYE_CHAR,       LYE_CHAR,       LYE_CHAR,       LYE_CHAR,
+LYE_CHAR,       LYE_CHAR,       LYE_CHAR,       LYE_CHAR,
+LYE_CHAR,       LYE_CHAR,       LYE_CHAR,       LYE_CHAR,
+LYE_CHAR,       LYE_CHAR,       LYE_CHAR,       LYE_CHAR,
+LYE_CHAR,       LYE_CHAR,       LYE_CHAR,       LYE_CHAR,
+LYE_CHAR,       LYE_CHAR,       LYE_CHAR,       LYE_CHAR,
+LYE_CHAR,       LYE_CHAR,       LYE_CHAR,       LYE_CHAR,
+LYE_CHAR,       LYE_CHAR,       LYE_CHAR,       LYE_CHAR,
+LYE_CHAR,       LYE_CHAR,       LYE_CHAR,       LYE_CHAR,
+LYE_CHAR,       LYE_CHAR,       LYE_CHAR,       LYE_CHAR,
+LYE_CHAR,       LYE_CHAR,       LYE_CHAR,       LYE_CHAR,
+LYE_CHAR,       LYE_CHAR,       LYE_CHAR,       LYE_CHAR,
+LYE_CHAR,       LYE_CHAR,       LYE_CHAR,       LYE_CHAR,
+LYE_CHAR,       LYE_CHAR,       LYE_CHAR,       LYE_CHAR,
+LYE_CHAR,       LYE_CHAR,       LYE_CHAR,       LYE_CHAR,
+LYE_CHAR,       LYE_CHAR,       LYE_CHAR,       LYE_CHAR,
+LYE_CHAR,       LYE_CHAR,       LYE_CHAR,       LYE_CHAR,
+LYE_CHAR,       LYE_CHAR,       LYE_CHAR,       LYE_CHAR,
+LYE_CHAR,       LYE_CHAR,       LYE_CHAR,       LYE_CHAR,
+LYE_CHAR,       LYE_CHAR,       LYE_CHAR,       LYE_CHAR,
+LYE_CHAR,       LYE_CHAR,       LYE_CHAR,       LYE_CHAR,
+LYE_CHAR,       LYE_CHAR,       LYE_CHAR,       LYE_DELP,
+
+/* 80..9F ISO-8859-1 8-bit escape characters. */
+LYE_CHAR,       LYE_CHAR,       LYE_CHAR,       LYE_CHAR,
+LYE_CHAR,       LYE_CHAR,       LYE_CHAR,       LYE_CHAR,
+LYE_CHAR,       LYE_CHAR,       LYE_CHAR,       LYE_CHAR,
+LYE_CHAR,       LYE_CHAR,       LYE_CHAR,       LYE_CHAR,
+LYE_CHAR,       LYE_CHAR,       LYE_CHAR,       LYE_CHAR,
+LYE_CHAR,       LYE_CHAR,       LYE_CHAR,       LYE_AIX,
+/*                                               97 AIX    */
+LYE_CHAR,       LYE_CHAR,       LYE_CHAR,       LYE_CHAR,
+LYE_CHAR,       LYE_CHAR,       LYE_CHAR,       LYE_CHAR,
+
+/* A0..FF (permissible ISO-8859-1) 8-bit characters. */
+LYE_CHAR,       LYE_CHAR,       LYE_CHAR,       LYE_CHAR,
+LYE_CHAR,       LYE_CHAR,       LYE_CHAR,       LYE_CHAR,
+LYE_CHAR,       LYE_CHAR,       LYE_CHAR,       LYE_CHAR,
+LYE_CHAR,       LYE_CHAR,       LYE_CHAR,       LYE_CHAR,
+LYE_CHAR,       LYE_CHAR,       LYE_CHAR,       LYE_CHAR,
+LYE_CHAR,       LYE_CHAR,       LYE_CHAR,       LYE_CHAR,
+LYE_CHAR,       LYE_CHAR,       LYE_CHAR,       LYE_CHAR,
+LYE_CHAR,       LYE_CHAR,       LYE_CHAR,       LYE_CHAR,
+LYE_CHAR,       LYE_CHAR,       LYE_CHAR,       LYE_CHAR,
+LYE_CHAR,       LYE_CHAR,       LYE_CHAR,       LYE_CHAR,
+LYE_CHAR,       LYE_CHAR,       LYE_CHAR,       LYE_CHAR,
+LYE_CHAR,       LYE_CHAR,       LYE_CHAR,       LYE_CHAR,
+LYE_CHAR,       LYE_CHAR,       LYE_CHAR,       LYE_CHAR,
+LYE_CHAR,       LYE_CHAR,       LYE_CHAR,       LYE_CHAR,
+LYE_CHAR,       LYE_CHAR,       LYE_CHAR,       LYE_CHAR,
+LYE_CHAR,       LYE_CHAR,       LYE_CHAR,       LYE_CHAR,
+LYE_CHAR,       LYE_CHAR,       LYE_CHAR,       LYE_CHAR,
+LYE_CHAR,       LYE_CHAR,       LYE_CHAR,       LYE_CHAR,
+LYE_CHAR,       LYE_CHAR,       LYE_CHAR,       LYE_CHAR,
+LYE_CHAR,       LYE_CHAR,       LYE_CHAR,       LYE_CHAR,
+LYE_CHAR,       LYE_CHAR,       LYE_CHAR,       LYE_CHAR,
+LYE_CHAR,       LYE_CHAR,       LYE_CHAR,       LYE_CHAR,
+LYE_CHAR,       LYE_CHAR,       LYE_CHAR,       LYE_CHAR,
+LYE_CHAR,       LYE_CHAR,       LYE_CHAR,       LYE_CHAR,
+
+/* 100..10E function key definitions in LYStrings.h */
+LYE_NOP,        LYE_NOP,        LYE_FORW,       LYE_BACK,
+/* UPARROW      DNARROW         RTARROW         LTARROW     */
+
+LYE_NOP,        LYE_NOP,        LYE_BOL,        LYE_EOL,
+/* PGDOWN       PGUP            HOME            END         */
+
+LYE_NOP,        LYE_TAB,        LYE_BOL,        LYE_EOL,
+/* F1           Do key          Find key        Select key  */
+
+LYE_NOP,        LYE_DELP,       LYE_NOP,        LYE_NOP,
+/* Insert key   Remove key      DO_NOTHING      ...         */
+};
+
 
 /*
  * Add the array name to LYLineEditors
@@ -124,6 +232,7 @@
 
 PUBLIC char * LYLineEditors[]={
         DefaultEditBinding,     /* You can't please everyone, so you ... DW */
+       BetterEditBinding,      /* No, you certainly can't ... /ked 10/27/98*/
 };
 
 /*
@@ -131,7 +240,8 @@
  * The order of LYLineEditors and LyLineditNames MUST be the same
  */
 PUBLIC char * LYLineeditNames[]={
-        "Default Binding     ",
+        "Default Binding",
+       "Better Bindings",
         (char *) 0
 };
 
diff -uNr lynx-2.8.1-rel.2.orig/lynx_help/Lynx_users_guide.html 
lynx-2.8.1-rel.2+kd/lynx_help/Lynx_users_guide.html
--- lynx-2.8.1-rel.2.orig/lynx_help/Lynx_users_guide.html       Tue Nov  3 
15:43:03 1998
+++ lynx-2.8.1-rel.2+kd/lynx_help/Lynx_users_guide.html Mon Nov  2 23:01:03 1998
@@ -761,12 +761,16 @@
            uppercase H, J, K, and L keys remain mapped to their configured
            bindings (normally HELP, JUMP, KEYMAP, and LIST, respectively).
 
+         <p>Note: this has no effect on the line-editor's key bindings.
+
    <dt>Emacs keys
        <dd>If set to ON then the CTRL-P, CTRL-N, CTRL-F, and CTRL-B keys
            will be mapped to up-arrow, down-arrow, right-arrow, and
            left-arrow, respectively.  Otherwise, they remain mapped to
            their configured bindings (normally UP_TWO lines, DOWN_TWO
            lines, NEXT_PAGE, and PREV_PAGE, respectively).
+
+         <p>Note: this has no effect on the line-editor's key bindings.
 
    <dt>Show dot files
        <dd>If display/creation of hidden (dot) files/directories is
diff -uNr lynx-2.8.1-rel.2.orig/lynx_help/keystrokes/edit_help.html 
lynx-2.8.1-rel.2+kd/lynx_help/keystrokes/edit_help.html
--- lynx-2.8.1-rel.2.orig/lynx_help/keystrokes/edit_help.html   Tue Nov  3 
15:43:04 1998
+++ lynx-2.8.1-rel.2+kd/lynx_help/keystrokes/edit_help.html     Tue Nov  3 
16:02:35 1998
@@ -10,31 +10,41 @@
 Lynx invokes a built-in <em>Line Editor</em> for entering strings in
 response to prompts, in forms, and for email messages if an external editor
 has not been defined.  Administrators can offer alternate key bindings
-by adding them in LYEditmap.c before compiling Lynx, and they can
-be selected via the 'o'ptions menu.  This is the <em>Default Binding</em>:
-<pre>
-     ENTER  Input complete       -  RETURN
-     TAB    Input complete       -  TAB, Do
-     ABORT  Input cancelled      -  Ctrl-G, Ctrl-O, Ctrl-C
-     ERASE  Erase the line       -  Ctrl-U, Ctrl-X
-
-     BACK   Cursor back    char  -  Left-Arrow
-     FORW   Cursor forward char  -  Right-Arrow
-     BACKW  Cursor back    word  -  Ctrl-P
-     FORWW  Cursor forward word  -  Ctrl-N
-     BOL    Go to begin of line  -  Ctrl-A, Home, Find
-     EOL    Go to end   of line  -  Ctrl-E, End,  Select
-
-     DELP   Delete prev    char  -  Ctrl-H, DELETE, Remove
-     DELC   Delete current char  -  Ctrl-D
-     DELN   Delete next    char  -  Ctrl-R
-     DELPW  Delete prev    word  -  Ctrl-B
-     DELNW  Delete next    word  -  Ctrl-F
+by adding them in LYEditmap.c before compiling Lynx.  If available, they may
+be selected via the old-style 'o'ptions menu (see -forms_options command
+line option), or by editing lineedit_mode in the .lynxrc file.
 
-     LOWER  Lower case the line  -  Ctrl-K
-     UPPER  Upper case the line  -  Ctrl-T
+<p>Note: setting emacs/vi keys ON has no effect on line-editor bindings.
 
-     LKCMD  Invoke cmd prompt    -  Ctrl-V (in form text fields, only)
+<p>This is the <em>Default Binding</em>:
+
+<p><pre>
+     ENTER  Input complete        -  RETURN
+     TAB    Input complete        -  TAB, Do
+     ABORT  Input cancelled       -  Ctrl-G, Ctrl-O, (Ctrl-C on some systems)
+     ERASE  Erase the line        -  Ctrl-U, Ctrl-X
+
+     BACK   Cursor back     char  -  Left-Arrow
+     FORW   Cursor forward  char  -  Right-Arrow
+     BACKW  Cursor back     word  -  Ctrl-P
+     FORWW  Cursor forward  word  -  Ctrl-N
+     BOL    Go to begin of  line  -  Ctrl-A, Home, Find
+     EOL    Go to end   of  line  -  Ctrl-E, End,  Select
+
+     DELP   Delete prev     char  -  Ctrl-H, DELETE, Remove
+     DELN   Delete next [*] char  -  Ctrl-D, Ctrl-R
+     DELPW  Delete prev     word  -  Ctrl-B
+     DELNW  Delete next     word  -  Ctrl-F
+     DELEOL Delete to end of line -  Ctrl-_
+
+     LOWER  Lower case the line   -  Ctrl-K
+     UPPER  Upper case the line   -  Ctrl-T
+
+     LKCMD  Invoke cmd prompt     -  Ctrl-V (in form text fields, only)
+
+[*] "next" means the character "under" a box or underline style cursor; it
+     means "to the immediate right of" an I-beam (between characters) type
+     cursor.
 </pre>
 </body>
 </html>
diff -uNr lynx-2.8.1-rel.2.orig/lynx_help/keystrokes/option_help.html 
lynx-2.8.1-rel.2+kd/lynx_help/keystrokes/option_help.html
--- lynx-2.8.1-rel.2.orig/lynx_help/keystrokes/option_help.html Sat Oct 24 
09:49:07 1998
+++ lynx-2.8.1-rel.2+kd/lynx_help/keystrokes/option_help.html   Tue Nov  3 
16:10:25 1998
@@ -68,6 +68,7 @@
 to up-arrow, down-arrow, right-arrow and left-arrow respectively.  Otherwise,
 they remain mapped to their configured bindings (normally UP_TWO lines,
 DOWN_TWO lines, NEXT_PAGE and PREV_PAGE respectively).
+<p>Note: setting emacs keys does not affect the line-editor bindings.
 
 <H1><A NAME="LL">Execution links</A></H1>
 
@@ -170,6 +171,7 @@
 to left-arrow, down-arrow, up-arrow and right-arrow respectively.
 <p>The uppercase H, J, K, and L keys remain mapped to their configured bindings
 (normally HELP, JUMP, KEYMAP and LIST, respectively).
+<p>Note: setting vi keys does not affect the line-editor bindings.
 
 <H1><A NAME="DV">X DISPLAY variable</A></H1>
 
##--eof--##

reply via email to

[Prev in Thread] Current Thread [Next in Thread]