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 |
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. */ |
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 |
|
|
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); |
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 |
|
|
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 |
|
|
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 |
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 |
} |
} |
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]) |
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))) |
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 |
|
|
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 |
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)) |
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. |
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. */); |
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 |
} |
} |