lynx-dev
[Top][All Lists]
Advanced

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

lynx-dev [PATCH 2.8.4dev.16] STOP edition


From: Ilya Zakharevich
Subject: lynx-dev [PATCH 2.8.4dev.16] STOP edition
Date: Sat, 3 Feb 2001 14:27:29 -0500
User-agent: Mutt/1.2.5i

This patch allows a different approach to the problem: how to enter a
keyboard navigation command when you are in an editing mode.  A new
EDIT-time action is introduced: LYE_STOP.  I use it like this:

  KEYMAP:^[:INTERRUPT:STOP

The action behaves as if -tna is temporary switched on: your edit is
commited, and you go into the non-edit mode - until you press Enter on
an edit field again (or switch to a different document), when this
temporary switch to -tna is terminated.  If the "current" edit field
has a different style than the "active" edit field, you get an
additional feedback.  Anyway, the status line shows a correct info
about the current mode.

In -tna mode this behaves as the usual end-of-edit action.

Enjoy,
Ilya

--- ./src/LYForms.c-pretna      Sat Jan 20 02:15:50 2001
+++ ./src/LYForms.c     Sat Feb  3 05:02:04 2001
@@ -661,6 +661,17 @@ again:
        if (action == LYE_ABORT) {
            return(DO_NOTHING);
        }
+       if (action == LYE_STOP) {
+#ifdef TEXTFIELDS_MAY_NEED_ACTIVATION
+           textfields_need_activation = TRUE;
+           break;
+#else
+#ifdef ENHANCED_LINEEDIT
+           if (MyEdit.mark >= 0)
+               MyEdit.mark = -1 - MyEdit.strlen;       /* Disable. */
+#endif
+#endif
+       }
        if (LKC_TO_LAC(keymap,ch) == LYK_REFRESH)
            break;
 #ifdef SH_EX
--- ./src/LYGlobalDefs.h-pretna Wed Oct 25 11:35:28 2000
+++ ./src/LYGlobalDefs.h        Sat Feb  3 03:39:28 2001
@@ -436,6 +436,7 @@ extern int connect_timeout;
 
 #ifdef TEXTFIELDS_MAY_NEED_ACTIVATION
 extern BOOL textfields_need_activation;
+extern BOOL global_textfields_need_activation;
 #ifdef INACTIVE_INPUT_STYLE_VH
 extern BOOL textinput_redrawn;
 #endif
--- ./src/LYKeymap.c-pretna     Sat Jan 20 02:16:58 2001
+++ ./src/LYKeymap.c    Sat Feb  3 04:22:54 2001
@@ -996,6 +996,7 @@ PRIVATE struct emap ekmap[] = {
   {"CHAR",     LYE_CHAR,       "Insert printable char"},
   {"ENTER",    LYE_ENTER,      "Input complete, return char/lynxkeycode"},
   {"TAB",      LYE_TAB,        "Input complete, return TAB"},
+  {"STOP",     LYE_STOP,       "Input desactivated"},
   {"ABORT",    LYE_ABORT,      "Input cancelled"},
 
   {"PASS",     LYE_FORM_PASS,  "In fields: input complete, or Do Nothing"},
--- ./src/LYMain.c-pretna       Tue Jan 23 00:28:04 2001
+++ ./src/LYMain.c      Sat Feb  3 03:40:54 2001
@@ -464,6 +464,7 @@ PUBLIC BOOL force_empty_hrefless_a = FAL
 
 #ifdef TEXTFIELDS_MAY_NEED_ACTIVATION
 PUBLIC BOOL textfields_need_activation = FALSE;
+PUBLIC BOOL global_textfields_need_activation = FALSE;
 #endif
 
 PUBLIC BOOLEAN textfield_prompt_at_left_edge = FALSE;
@@ -3593,7 +3594,7 @@ treated '>' as a co-terminator for doubl
    ),
 #ifdef TEXTFIELDS_MAY_NEED_ACTIVATION
    PARSE_SET(
-      "tna",           4|SET_ARG,              &textfields_need_activation,
+      "tna",           4|SET_ARG,              
&global_textfields_need_activation,
       "turn on \"Textfields Need Activation\" mode"
    ),
 #endif
--- ./src/LYMainLoop.c-pretna   Thu Dec 21 21:44:10 2000
+++ ./src/LYMainLoop.c  Sat Feb  3 04:05:48 2001
@@ -982,8 +982,9 @@ PRIVATE int handle_LYK_ACTIVATE ARGS6(
                F_TEXTLIKE(links[curdoc.link].form->type)) {
 
                textinput_activated = TRUE;
-               if (textfields_need_activation)
-                   show_main_statusline(links[curdoc.link], FOR_INPUT);
+               show_main_statusline(links[curdoc.link], FOR_INPUT);
+               textfields_need_activation = global_textfields_need_activation;
+
                return 0;
            }
 #endif
@@ -5458,6 +5459,9 @@ try_again:
 #ifdef USE_PRETTYSRC
                psrc_first_tag = TRUE;
 #endif
+#ifdef TEXTFIELDS_MAY_NEED_ACTIVATION
+               textfields_need_activation = global_textfields_need_activation;
+#endif
                FREE(LYRequestReferer);
                /*
                 *  Don't send Referer if we have to load a document again
@@ -6631,6 +6635,7 @@ try_again:
 #ifdef TEXTFIELDS_MAY_NEED_ACTIVATION
                        if (textfields_need_activation) {
                            textinput_activated = TRUE;
+                           textfields_need_activation = 
global_textfields_need_activation;
 #ifdef INACTIVE_INPUT_STYLE_VH
                            textinput_redrawn = TRUE;
 #endif
--- ./src/LYReadCFG.c-pretna    Tue Jan 23 00:07:50 2001
+++ ./src/LYReadCFG.c   Sat Feb  3 03:48:24 2001
@@ -1610,7 +1610,7 @@ static Config_Type Config_Table [] =
      PARSE_STR("system_mail_flags", CONF_STR, &system_mail_flags),
      PARSE_SET("tagsoup", CONF_BOOL, &Old_DTD),
 #ifdef TEXTFIELDS_MAY_NEED_ACTIVATION
-     PARSE_SET("textfields_need_activation", CONF_BOOL, 
&textfields_need_activation),
+     PARSE_SET("textfields_need_activation", CONF_BOOL, 
&global_textfields_need_activation),
 #endif
 #if defined(_WINDOWS)
      PARSE_INT("timeout", CONF_INT, &lynx_timeout),
--- ./src/LYStrings.c-pretna    Sat Jan 20 17:22:18 2001
+++ ./src/LYStrings.c   Sat Feb  3 04:21:00 2001
@@ -4722,6 +4722,22 @@ again:
            CTRACE((tfp, "LYgetstr LYE_ABORT\n"));
            return(-1);
 
+       case LYE_STOP:
+           /*
+            *  Deactivate.
+            */
+           CTRACE((tfp, "LYgetstr LYE_STOP\n"));
+#ifdef TEXTFIELDS_MAY_NEED_ACTIVATION
+           textfields_need_activation = TRUE;
+           return(-1);
+#else
+#ifdef ENHANCED_LINEEDIT
+           if (Mark >= 0)
+               Mark = -1 - Mark;               /* Disable it */
+#endif
+#endif
+           break;
+
        case LYE_LKCMD:
            /*
             *  Used only in form_getstr() for invoking
--- ./src/LYStrings.h-pretna    Sat Jan 20 02:17:00 2001
+++ ./src/LYStrings.h   Sat Feb  3 04:15:20 2001
@@ -211,7 +211,8 @@ typedef struct _EditFieldData {
 #define LYE_CHAR  (LYE_NOP   +1)  /* Insert printable char */
 #define LYE_ENTER (LYE_CHAR  +1)  /* Input complete, return char/lynxkeycode */
 #define LYE_TAB   (LYE_ENTER +1)  /* Input complete, return TAB  */
-#define LYE_ABORT (LYE_TAB   +1)  /* Input cancelled       */
+#define LYE_STOP  (LYE_TAB   +1)  /* Input compete,  deactivate  */
+#define LYE_ABORT (LYE_STOP  +1)  /* Input cancelled       */
 
 #define LYE_FORM_PASS (LYE_ABORT +1)  /* In form fields: input complete,
                                         return char / lynxkeycode;

; To UNSUBSCRIBE: Send "unsubscribe lynx-dev" to address@hidden

reply via email to

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