/[emacs]/emacs/src/keyboard.c
ViewVC logotype

Diff of /emacs/src/keyboard.c

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 1.641 by monnier, Tue Nov 6 15:07:16 2001 UTC revision 1.642 by monnier, Wed Dec 5 02:51:12 2001 UTC
# Line 154  Lisp_Object raw_keybuf; Line 154  Lisp_Object raw_keybuf;
154  int raw_keybuf_count;  int raw_keybuf_count;
155    
156  #define GROW_RAW_KEYBUF                                                 \  #define GROW_RAW_KEYBUF                                                 \
157  if (raw_keybuf_count == XVECTOR (raw_keybuf)->size)                     \   if (raw_keybuf_count == XVECTOR (raw_keybuf)->size)                    \
158    {                                                                     \    {                                                                     \
159      int newsize = 2 * XVECTOR (raw_keybuf)->size;                       \      int newsize = 2 * XVECTOR (raw_keybuf)->size;                       \
160      Lisp_Object new;                                                    \      Lisp_Object new;                                                    \
# Line 718  echo_prompt (str) Line 718  echo_prompt (str)
718            unsigned char *pend = p + ECHOBUFSIZE - 4;            unsigned char *pend = p + ECHOBUFSIZE - 4;
719            int char_len;            int char_len;
720    
721            do            do
722              {              {
723                PARSE_MULTIBYTE_SEQ (p, pend - p, char_len);                PARSE_MULTIBYTE_SEQ (p, pend - p, char_len);
724                p += char_len;                p += char_len;
# Line 3235  kbd_buffer_store_event (event) Line 3235  kbd_buffer_store_event (event)
3235    
3236        if (c == quit_char)        if (c == quit_char)
3237          {          {
3238            extern SIGTYPE interrupt_signal ();            static SIGTYPE interrupt_signal (int);
3239  #ifdef MULTI_KBOARD  #ifdef MULTI_KBOARD
3240            KBOARD *kb;            KBOARD *kb;
3241            struct input_event *sp;            struct input_event *sp;
# Line 3279  kbd_buffer_store_event (event) Line 3279  kbd_buffer_store_event (event)
3279            }            }
3280    
3281            last_event_timestamp = event->timestamp;            last_event_timestamp = event->timestamp;
3282            interrupt_signal ();            interrupt_signal (0 /* dummy */);
3283            return;            return;
3284          }          }
3285    
# Line 6829  parse_menu_item (item, notreal, inmenuba Line 6829  parse_menu_item (item, notreal, inmenuba
6829        AREF (item_properties, ITEM_PROPERTY_DEF) = def;        AREF (item_properties, ITEM_PROPERTY_DEF) = def;
6830      }      }
6831    
   /* If we got no definition, this item is just unselectable text which  
      is OK in a submenu but not in the menubar.  */  
   if (NILP (def))  
     return (inmenubar ? 0 : 1);  
   
6832    /* Enable or disable selection of item.  */    /* Enable or disable selection of item.  */
6833    tem = AREF (item_properties, ITEM_PROPERTY_ENABLE);    tem = AREF (item_properties, ITEM_PROPERTY_ENABLE);
6834    if (!EQ (tem, Qt))    if (!EQ (tem, Qt))
# Line 6847  parse_menu_item (item, notreal, inmenuba Line 6842  parse_menu_item (item, notreal, inmenuba
6842        AREF (item_properties, ITEM_PROPERTY_ENABLE) = tem;        AREF (item_properties, ITEM_PROPERTY_ENABLE) = tem;
6843      }      }
6844    
6845      /* If we got no definition, this item is just unselectable text which
6846         is OK in a submenu but not in the menubar.  */
6847      if (NILP (def))
6848        return (inmenubar ? 0 : 1);
6849    
6850    /* See if this is a separate pane or a submenu.  */    /* See if this is a separate pane or a submenu.  */
6851    def = AREF (item_properties, ITEM_PROPERTY_DEF);    def = AREF (item_properties, ITEM_PROPERTY_DEF);
6852    tem = get_keymap (def, 0, 1);    tem = get_keymap (def, 0, 1);
# Line 7531  read_char_minibuf_menu_prompt (commandfl Line 7531  read_char_minibuf_menu_prompt (commandfl
7531    char *menu;    char *menu;
7532    
7533    vector = Qnil;    vector = Qnil;
7534      name = Qnil;
7535    
7536    if (! menu_prompting)    if (! menu_prompting)
7537      return Qnil;      return Qnil;
# Line 7558  read_char_minibuf_menu_prompt (commandfl Line 7559  read_char_minibuf_menu_prompt (commandfl
7559      }      }
7560    
7561    /* If we don't have any menus, just read a character normally.  */    /* If we don't have any menus, just read a character normally.  */
7562    if (mapno >= nmaps)    if (!STRINGP (name));
7563      return Qnil;      return Qnil;
7564    
7565    /* Prompt string always starts with map's prompt, and a space.  */    /* Prompt string always starts with map's prompt, and a space.  */
# Line 7898  read_key_sequence (keybuf, bufsize, prom Line 7899  read_key_sequence (keybuf, bufsize, prom
7899       this key sequence.  In other words, the lowest i such that       this key sequence.  In other words, the lowest i such that
7900       defs[i] is non-nil.  */       defs[i] is non-nil.  */
7901    volatile int first_binding;    volatile int first_binding;
7902      /* Index of the first key that has no binding.
7903         It is useless to try fkey_start larger than that.  */
7904      volatile int first_unbound;
7905    
7906    /* If t < mock_input, then KEYBUF[t] should be read as the next    /* If t < mock_input, then KEYBUF[t] should be read as the next
7907       input key.       input key.
# Line 8029  read_key_sequence (keybuf, bufsize, prom Line 8033  read_key_sequence (keybuf, bufsize, prom
8033    starting_buffer = current_buffer;    starting_buffer = current_buffer;
8034    function_key_possible = 0;    function_key_possible = 0;
8035    key_translation_possible = 0;    key_translation_possible = 0;
8036      first_unbound = bufsize + 1;
8037    
8038    /* Build our list of keymaps.    /* Build our list of keymaps.
8039       If we recognize a function key and replace its escape sequence in       If we recognize a function key and replace its escape sequence in
# Line 8094  read_key_sequence (keybuf, bufsize, prom Line 8099  read_key_sequence (keybuf, bufsize, prom
8099       reading.  */       reading.  */
8100    while ((first_binding < nmaps && ! NILP (submaps[first_binding]))    while ((first_binding < nmaps && ! NILP (submaps[first_binding]))
8101           || (first_binding >= nmaps           || (first_binding >= nmaps
8102               && fkey_start < t               && fkey_start < t)
              /* mock input is never part of a function key's sequence.  */  
              && mock_input <= fkey_start)  
8103           || (first_binding >= nmaps           || (first_binding >= nmaps
8104               && keytran_start < t && key_translation_possible)               && keytran_start < t && key_translation_possible)
8105           /* Don't return in the middle of a possible function key sequence,           /* Don't return in the middle of a possible function key sequence,
# Line 8122  read_key_sequence (keybuf, bufsize, prom Line 8125  read_key_sequence (keybuf, bufsize, prom
8125           just one key.  */           just one key.  */
8126        volatile int echo_local_start, keys_local_start, local_first_binding;        volatile int echo_local_start, keys_local_start, local_first_binding;
8127    
8128    
8129          if (first_unbound < fkey_start && first_unbound < keytran_start)
8130            { /* The prefix upto first_unbound has no binding and has
8131                 no translation left to do either, so we know it's unbound.
8132                 If we don't stop now, we risk staying here indefinitely
8133                 (if the user keeps entering fkey or keytran prefixes
8134                 like C-c ESC ESC ESC ESC ...)  */
8135              int i;
8136              for (i = first_unbound + 1; i < t; i++)
8137                keybuf[i - first_unbound - 1] = keybuf[i];
8138              mock_input = t - first_unbound - 1;
8139              fkey_end = fkey_start -= first_unbound + 1;
8140              fkey_map = Vfunction_key_map;
8141              keytran_end = keytran_start -= first_unbound + 1;
8142              keytran_map = Vkey_translation_map;
8143              goto replay_sequence;
8144            }
8145    
8146        if (t >= bufsize)        if (t >= bufsize)
8147          error ("Key sequence too long");          error ("Key sequence too long");
8148    
# Line 8511  read_key_sequence (keybuf, bufsize, prom Line 8532  read_key_sequence (keybuf, bufsize, prom
8532        if (first_binding >= nmaps)        if (first_binding >= nmaps)
8533          {          {
8534            Lisp_Object head;            Lisp_Object head;
8535              
8536              /* Remember the position to put an upper bound on fkey_start.  */
8537              first_unbound = min (t, first_unbound);
8538    
8539            head = EVENT_HEAD (key);            head = EVENT_HEAD (key);
8540            if (help_char_p (head) && t > 0)            if (help_char_p (head) && t > 0)
# Line 9418  current_active_maps (maps_p) Line 9442  current_active_maps (maps_p)
9442          extra_maps = 3;          extra_maps = 3;
9443        nmaps = current_minor_maps (NULL, &tmaps);        nmaps = current_minor_maps (NULL, &tmaps);
9444        maps = (Lisp_Object *) alloca ((nmaps + extra_maps)        maps = (Lisp_Object *) alloca ((nmaps + extra_maps)
9445                                       * sizeof (maps[0]));                                        * sizeof (maps[0]));
9446        bcopy (tmaps, maps, nmaps * sizeof (maps[0]));        bcopy (tmaps, maps, nmaps * sizeof (maps[0]));
9447        if (!NILP (map))        if (!NILP (map))
9448          maps[nmaps++] = map;          maps[nmaps++] = map;

Legend:
Removed from v.1.641  
changed lines
  Added in v.1.642

savannah-hackers-public@gnu.org
ViewVC Help
Powered by ViewVC 1.1.26