/[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.753.2.4 by handa, Fri Apr 16 12:50:48 2004 UTC revision 1.753.2.5 by miles, Mon Jun 28 07:29:21 2004 UTC
# Line 117  struct backtrace Line 117  struct backtrace
117                             args points to slot holding list of                             args points to slot holding list of
118                             unevalled args */                             unevalled args */
119      char evalargs;      char evalargs;
120        /* Nonzero means call value of debugger when done with this operation. */
121        char debug_on_exit;
122    };    };
123    
124  #ifdef MULTI_KBOARD  #ifdef MULTI_KBOARD
# Line 679  static SIGTYPE interrupt_signal P_ ((int Line 681  static SIGTYPE interrupt_signal P_ ((int
681     to support it.  */     to support it.  */
682  static int cannot_suspend;  static int cannot_suspend;
683    
684    extern Lisp_Object Qidentity, Qonly;
685    
686  /* Install the string STR as the beginning of the string of echoing,  /* Install the string STR as the beginning of the string of echoing,
687     so that it serves as a prompt for the next character.     so that it serves as a prompt for the next character.
688     Also start echoing.  */     Also start echoing.  */
# Line 996  This function is called by the editor in Line 1000  This function is called by the editor in
1000    int count = SPECPDL_INDEX ();    int count = SPECPDL_INDEX ();
1001    Lisp_Object buffer;    Lisp_Object buffer;
1002    
1003      /* If we enter while input is blocked, don't lock up here.
1004         This may happen through the debugger during redisplay.  */
1005      if (INPUT_BLOCKED_P)
1006        return Qnil;
1007    
1008    command_loop_level++;    command_loop_level++;
1009    update_mode_lines = 1;    update_mode_lines = 1;
1010    
# Line 1151  cmd_error (data) Line 1160  cmd_error (data)
1160    
1161    Vinhibit_quit = Qnil;    Vinhibit_quit = Qnil;
1162  #ifdef MULTI_KBOARD  #ifdef MULTI_KBOARD
1163    any_kboard_state ();    if (command_loop_level == 0 && minibuf_level == 0)
1164        any_kboard_state ();
1165  #endif  #endif
1166    
1167    return make_number (0);    return make_number (0);
# Line 1240  command_loop () Line 1250  command_loop ()
1250      while (1)      while (1)
1251        {        {
1252          internal_catch (Qtop_level, top_level_1, Qnil);          internal_catch (Qtop_level, top_level_1, Qnil);
1253            /* Reset single_kboard in case top-level set it while
1254               evaluating an -f option, or we are stuck there for some
1255               other reason.  */
1256            any_kboard_state ();
1257          internal_catch (Qtop_level, command_loop_2, Qnil);          internal_catch (Qtop_level, command_loop_2, Qnil);
1258          executing_macro = Qnil;          executing_macro = Qnil;
1259    
# Line 1294  DEFUN ("top-level", Ftop_level, Stop_lev Line 1308  DEFUN ("top-level", Ftop_level, Stop_lev
1308    if (display_hourglass_p)    if (display_hourglass_p)
1309      cancel_hourglass ();      cancel_hourglass ();
1310  #endif  #endif
1311    
1312      /* Unblock input if we enter with input blocked.  This may happen if
1313         redisplay traps e.g. during tool-bar update with input blocked.  */
1314      while (INPUT_BLOCKED_P)
1315        UNBLOCK_INPUT;
1316    
1317    return Fthrow (Qtop_level, Qnil);    return Fthrow (Qtop_level, Qnil);
1318  }  }
1319    
# Line 1804  command_loop_1 () Line 1824  command_loop_1 ()
1824              call1 (Vrun_hooks, intern ("activate-mark-hook"));              call1 (Vrun_hooks, intern ("activate-mark-hook"));
1825          }          }
1826    
1827          /* Setting transient-mark-mode to `only' is a way of
1828             turning it on for just one command.  */
1829          if (!NILP (current_buffer->mark_active) && !NILP (Vrun_hooks))
1830            {
1831              if (EQ (Vtransient_mark_mode, Qidentity))
1832                Vtransient_mark_mode = Qnil;
1833              if (EQ (Vtransient_mark_mode, Qonly))
1834                Vtransient_mark_mode = Qidentity;
1835            }
1836    
1837      finalize:      finalize:
1838    
1839        if (current_buffer == prev_buffer        if (current_buffer == prev_buffer
# Line 3967  kbd_buffer_get_event (kbp, used_mouse_me Line 3997  kbd_buffer_get_event (kbp, used_mouse_me
3997        else if (event->kind == LANGUAGE_CHANGE_EVENT)        else if (event->kind == LANGUAGE_CHANGE_EVENT)
3998          {          {
3999            /* Make an event (language-change (FRAME CHARSET LCID)).  */            /* Make an event (language-change (FRAME CHARSET LCID)).  */
4000            obj = Fcons (event->modifiers, Qnil);            obj = Fcons (event->frame_or_window, Qnil);
           obj = Fcons (event->code, obj);  
           obj = Fcons (event->frame_or_window, obj);  
4001            obj = Fcons (Qlanguage_change, Fcons (obj, Qnil));            obj = Fcons (Qlanguage_change, Fcons (obj, Qnil));
4002            kbd_fetch_ptr = event + 1;            kbd_fetch_ptr = event + 1;
4003          }          }
# Line 6245  modify_event_symbol (symbol_num, modifie Line 6273  modify_event_symbol (symbol_num, modifie
6273          {          {
6274            int len = SBYTES (name_alist_or_stem);            int len = SBYTES (name_alist_or_stem);
6275            char *buf = (char *) alloca (len + 50);            char *buf = (char *) alloca (len + 50);
6276            if (sizeof (int) == sizeof (EMACS_INT))            sprintf (buf, "%s-%ld", SDATA (name_alist_or_stem),
6277              sprintf (buf, "%s-%d", SDATA (name_alist_or_stem),                     (long) XINT (symbol_int) + 1);
                      XINT (symbol_int) + 1);  
           else if (sizeof (long) == sizeof (EMACS_INT))  
             sprintf (buf, "%s-%ld", SDATA (name_alist_or_stem),  
                      XINT (symbol_int) + 1);  
           else  
             abort ();  
6278            value = intern (buf);            value = intern (buf);
6279          }          }
6280        else if (name_table != 0 && name_table[symbol_num])        else if (name_table != 0 && name_table[symbol_num])
# Line 7409  parse_menu_item (item, notreal, inmenuba Line 7431  parse_menu_item (item, notreal, inmenuba
7431        newcache = chkcache;        newcache = chkcache;
7432        if (chkcache)        if (chkcache)
7433          {          {
7434            tem = Fkey_description (tem);            tem = Fkey_description (tem, Qnil);
7435            if (CONSP (prefix))            if (CONSP (prefix))
7436              {              {
7437                if (STRINGP (XCAR (prefix)))                if (STRINGP (XCAR (prefix)))
# Line 9667  a special event, so ignore the prefix ar Line 9689  a special event, so ignore the prefix ar
9689        backtrace.args = &cmd;        backtrace.args = &cmd;
9690        backtrace.nargs = 1;        backtrace.nargs = 1;
9691        backtrace.evalargs = 0;        backtrace.evalargs = 0;
9692          backtrace.debug_on_exit = 0;
9693    
9694        tem = Fcall_interactively (cmd, record_flag, keys);        tem = Fcall_interactively (cmd, record_flag, keys);
9695    
# Line 9703  DEFUN ("execute-extended-command", Fexec Line 9726  DEFUN ("execute-extended-command", Fexec
9726    else if (CONSP (prefixarg) && XINT (XCAR (prefixarg)) == 4)    else if (CONSP (prefixarg) && XINT (XCAR (prefixarg)) == 4)
9727      strcpy (buf, "C-u ");      strcpy (buf, "C-u ");
9728    else if (CONSP (prefixarg) && INTEGERP (XCAR (prefixarg)))    else if (CONSP (prefixarg) && INTEGERP (XCAR (prefixarg)))
9729      {      sprintf (buf, "%ld ", (long) XINT (XCAR (prefixarg)));
       if (sizeof (int) == sizeof (EMACS_INT))  
         sprintf (buf, "%d ", XINT (XCAR (prefixarg)));  
       else if (sizeof (long) == sizeof (EMACS_INT))  
         sprintf (buf, "%ld ", (long) XINT (XCAR (prefixarg)));  
       else  
         abort ();  
     }  
9730    else if (INTEGERP (prefixarg))    else if (INTEGERP (prefixarg))
9731      {      sprintf (buf, "%ld ", (long) XINT (prefixarg));
       if (sizeof (int) == sizeof (EMACS_INT))  
         sprintf (buf, "%d ", XINT (prefixarg));  
       else if (sizeof (long) == sizeof (EMACS_INT))  
         sprintf (buf, "%ld ", (long) XINT (prefixarg));  
       else  
         abort ();  
     }  
9732    
9733    /* This isn't strictly correct if execute-extended-command    /* This isn't strictly correct if execute-extended-command
9734       is bound to anything else.  Perhaps it should use       is bound to anything else.  Perhaps it should use
# Line 9807  DEFUN ("execute-extended-command", Fexec Line 9816  DEFUN ("execute-extended-command", Fexec
9816            int count = SPECPDL_INDEX ();            int count = SPECPDL_INDEX ();
9817    
9818            record_unwind_protect (pop_message_unwind, Qnil);            record_unwind_protect (pop_message_unwind, Qnil);
9819            binding = Fkey_description (bindings);            binding = Fkey_description (bindings, Qnil);
9820    
9821            newmessage            newmessage
9822              = (char *) alloca (SCHARS (SYMBOL_NAME (function))              = (char *) alloca (SCHARS (SYMBOL_NAME (function))
# Line 10490  The elements of this list correspond to Line 10499  The elements of this list correspond to
10499    return Flist (sizeof (val) / sizeof (val[0]), val);    return Flist (sizeof (val) / sizeof (val[0]), val);
10500  }  }
10501    
10502    DEFUN ("posn-at-x-y", Fposn_at_x_y, Sposn_at_x_y, 2, 3, 0,
10503           doc: /* Return position information for pixel coordinates X and Y.
10504    By default, X and Y are relative to text area of the selected window.
10505    Optional third arg FRAME_OR_WINDOW non-nil specifies frame or window.
10506    
10507    The return value is similar to a mouse click position:
10508       (WINDOW AREA-OR-POS (X . Y) TIMESTAMP OBJECT POS (COL . ROW)
10509        IMAGE (DX . DY) (WIDTH . HEIGHT))
10510    The `posn-' functions access elements of such lists.  */)
10511      (x, y, frame_or_window)
10512         Lisp_Object x, y, frame_or_window;
10513    {
10514      if (NILP (frame_or_window))
10515        frame_or_window = selected_window;
10516    
10517      if (WINDOWP (frame_or_window))
10518        {
10519          struct window *w;
10520    
10521          CHECK_LIVE_WINDOW (frame_or_window);
10522    
10523          w = XWINDOW (frame_or_window);
10524          XSETINT (x, (WINDOW_TO_FRAME_PIXEL_X (w, XINT (x))
10525                       + window_box_left_offset (w, TEXT_AREA)));
10526          XSETINT (y, WINDOW_TO_FRAME_PIXEL_Y (w, XINT (y)));
10527          frame_or_window = w->frame;
10528        }
10529    
10530      CHECK_LIVE_FRAME (frame_or_window);
10531    
10532      return make_lispy_position (XFRAME (frame_or_window), &x, &y, 0);
10533    }
10534    
10535    DEFUN ("posn-at-point", Fposn_at_point, Sposn_at_point, 0, 2, 0,
10536           doc: /* Return position information for buffer POS in WINDOW.
10537    POS defaults to point in WINDOW; WINDOW defaults to the selected window.
10538    
10539    Return nil if position is not visible in window.  Otherwise,
10540    the return value is similar to that returned by `event-start' for
10541    a mouse click at the upper left corner of the glyph corresponding
10542    to the given buffer position:
10543       (WINDOW AREA-OR-POS (X . Y) TIMESTAMP OBJECT POS (COL . ROW)
10544        IMAGE (DX . DY) (WIDTH . HEIGHT))
10545    The `posn-' functions access elements of such lists.  */*/)
10546      (pos, window)
10547         Lisp_Object pos, window;
10548    {
10549      Lisp_Object tem;
10550    
10551      tem = Fpos_visible_in_window_p (pos, window, Qt);
10552      if (!NILP (tem))
10553        tem = Fposn_at_x_y (XCAR (tem), XCAR (XCDR (tem)), window);
10554      return tem;
10555    }
10556    
10557    
10558  /*  /*
10559   * Set up a new kboard object with reasonable initial values.   * Set up a new kboard object with reasonable initial values.
# Line 10913  syms_of_keyboard () Line 10977  syms_of_keyboard ()
10977    defsubr (&Sset_input_mode);    defsubr (&Sset_input_mode);
10978    defsubr (&Scurrent_input_mode);    defsubr (&Scurrent_input_mode);
10979    defsubr (&Sexecute_extended_command);    defsubr (&Sexecute_extended_command);
10980      defsubr (&Sposn_at_point);
10981      defsubr (&Sposn_at_x_y);
10982    
10983    DEFVAR_LISP ("last-command-char", &last_command_char,    DEFVAR_LISP ("last-command-char", &last_command_char,
10984                 doc: /* Last input event that was part of a command.  */);                 doc: /* Last input event that was part of a command.  */);
# Line 11357  mark_kboards () Line 11423  mark_kboards ()
11423        {        {
11424          if (event == kbd_buffer + KBD_BUFFER_SIZE)          if (event == kbd_buffer + KBD_BUFFER_SIZE)
11425            event = kbd_buffer;            event = kbd_buffer;
11426          mark_object (event->x);          if (event->kind != SELECTION_REQUEST_EVENT)
11427          mark_object (event->y);            {
11428                mark_object (event->x);
11429                mark_object (event->y);
11430              }
11431          mark_object (event->frame_or_window);          mark_object (event->frame_or_window);
11432          mark_object (event->arg);          mark_object (event->arg);
11433        }        }

Legend:
Removed from v.1.753.2.4  
changed lines
  Added in v.1.753.2.5

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