aboutsummaryrefslogtreecommitdiffstats
path: root/src/keyboard.c
diff options
context:
space:
mode:
authorKenichi Handa2010-08-25 14:15:20 +0900
committerKenichi Handa2010-08-25 14:15:20 +0900
commit4e603db3429957e6b26953c177f00a9c9d1c8766 (patch)
tree8206240e3006468bff9dfda5fb3696f80fbcb9f0 /src/keyboard.c
parentb60f961f6cdc1095e778ad624657bb57788512af (diff)
parentf6aa6ec68ed936800ef2c3aefa42102e60b654cb (diff)
downloademacs-4e603db3429957e6b26953c177f00a9c9d1c8766.tar.gz
emacs-4e603db3429957e6b26953c177f00a9c9d1c8766.zip
merge trunk
Diffstat (limited to 'src/keyboard.c')
-rw-r--r--src/keyboard.c44
1 files changed, 12 insertions, 32 deletions
diff --git a/src/keyboard.c b/src/keyboard.c
index 2fd13c4ae24..cac051f7882 100644
--- a/src/keyboard.c
+++ b/src/keyboard.c
@@ -368,7 +368,7 @@ Lisp_Object Vselect_active_regions;
368 Used by the `select-active-regions' feature. */ 368 Used by the `select-active-regions' feature. */
369Lisp_Object Vsaved_region_selection; 369Lisp_Object Vsaved_region_selection;
370 370
371Lisp_Object Qx_set_selection, QPRIMARY; 371Lisp_Object Qx_set_selection, QPRIMARY, Qhandle_switch_frame;
372 372
373Lisp_Object Qself_insert_command; 373Lisp_Object Qself_insert_command;
374Lisp_Object Qforward_char; 374Lisp_Object Qforward_char;
@@ -1799,10 +1799,11 @@ command_loop_1 (void)
1799 { 1799 {
1800 /* Even if not deactivating the mark, set PRIMARY if 1800 /* Even if not deactivating the mark, set PRIMARY if
1801 `select-active-regions' is non-nil. */ 1801 `select-active-regions' is non-nil. */
1802 if (EQ (Vselect_active_regions, Qonly) 1802 if ((EQ (Vselect_active_regions, Qonly)
1803 ? EQ (CAR_SAFE (Vtransient_mark_mode), Qonly) 1803 ? EQ (CAR_SAFE (Vtransient_mark_mode), Qonly)
1804 : (!NILP (Vselect_active_regions) 1804 : (!NILP (Vselect_active_regions)
1805 && !NILP (Vtransient_mark_mode))) 1805 && !NILP (Vtransient_mark_mode)))
1806 && !EQ (Vthis_command, Qhandle_switch_frame))
1806 { 1807 {
1807 int beg = XINT (Fmarker_position (current_buffer->mark)); 1808 int beg = XINT (Fmarker_position (current_buffer->mark));
1808 int end = XINT (make_number (PT)); 1809 int end = XINT (make_number (PT));
@@ -10345,13 +10346,12 @@ give to the command you invoke, if it asks for an argument. */)
10345 (Lisp_Object prefixarg) 10346 (Lisp_Object prefixarg)
10346{ 10347{
10347 Lisp_Object function; 10348 Lisp_Object function;
10348 char buf[40];
10349 int saved_last_point_position; 10349 int saved_last_point_position;
10350 Lisp_Object saved_keys, saved_last_point_position_buffer; 10350 Lisp_Object saved_keys, saved_last_point_position_buffer;
10351 Lisp_Object bindings, value; 10351 Lisp_Object bindings, value;
10352 struct gcpro gcpro1, gcpro2, gcpro3; 10352 struct gcpro gcpro1, gcpro2, gcpro3;
10353#ifdef HAVE_WINDOW_SYSTEM 10353#ifdef HAVE_WINDOW_SYSTEM
10354 /* The call to Fcompleting_read wil start and cancel the hourglass, 10354 /* The call to Fcompleting_read will start and cancel the hourglass,
10355 but if the hourglass was already scheduled, this means that no 10355 but if the hourglass was already scheduled, this means that no
10356 hourglass will be shown for the actual M-x command itself. 10356 hourglass will be shown for the actual M-x command itself.
10357 So we restart it if it is already scheduled. Note that checking 10357 So we restart it if it is already scheduled. Note that checking
@@ -10364,31 +10364,9 @@ give to the command you invoke, if it asks for an argument. */)
10364 XVECTOR (this_command_keys)->contents); 10364 XVECTOR (this_command_keys)->contents);
10365 saved_last_point_position_buffer = last_point_position_buffer; 10365 saved_last_point_position_buffer = last_point_position_buffer;
10366 saved_last_point_position = last_point_position; 10366 saved_last_point_position = last_point_position;
10367 buf[0] = 0;
10368 GCPRO3 (saved_keys, prefixarg, saved_last_point_position_buffer); 10367 GCPRO3 (saved_keys, prefixarg, saved_last_point_position_buffer);
10369 10368
10370 if (EQ (prefixarg, Qminus)) 10369 function = call0 (intern ("read-extended-command"));
10371 strcpy (buf, "- ");
10372 else if (CONSP (prefixarg) && XINT (XCAR (prefixarg)) == 4)
10373 strcpy (buf, "C-u ");
10374 else if (CONSP (prefixarg) && INTEGERP (XCAR (prefixarg)))
10375 sprintf (buf, "%ld ", (long) XINT (XCAR (prefixarg)));
10376 else if (INTEGERP (prefixarg))
10377 sprintf (buf, "%ld ", (long) XINT (prefixarg));
10378
10379 /* This isn't strictly correct if execute-extended-command
10380 is bound to anything else. Perhaps it should use
10381 this_command_keys? */
10382 strcat (buf, "M-x ");
10383
10384 /* Prompt with buf, and then read a string, completing from and
10385 restricting to the set of all defined commands. Don't provide
10386 any initial input. Save the command read on the extended-command
10387 history list. */
10388 function = Fcompleting_read (build_string (buf),
10389 Vobarray, Qcommandp,
10390 Qt, Qnil, Qextended_command_history, Qnil,
10391 Qnil);
10392 10370
10393#ifdef HAVE_WINDOW_SYSTEM 10371#ifdef HAVE_WINDOW_SYSTEM
10394 if (hstarted) start_hourglass (); 10372 if (hstarted) start_hourglass ();
@@ -11506,11 +11484,11 @@ init_keyboard (void)
11506 Emacs on SIGINT when there are no termcap frames on the 11484 Emacs on SIGINT when there are no termcap frames on the
11507 controlling terminal. */ 11485 controlling terminal. */
11508 signal (SIGINT, interrupt_signal); 11486 signal (SIGINT, interrupt_signal);
11509#if defined (HAVE_TERMIO) || defined (HAVE_TERMIOS) 11487#ifndef DOS_NT
11510 /* For systems with SysV TERMIO, C-g is set up for both SIGINT and 11488 /* For systems with SysV TERMIO, C-g is set up for both SIGINT and
11511 SIGQUIT and we can't tell which one it will give us. */ 11489 SIGQUIT and we can't tell which one it will give us. */
11512 signal (SIGQUIT, interrupt_signal); 11490 signal (SIGQUIT, interrupt_signal);
11513#endif /* HAVE_TERMIO */ 11491#endif /* not DOS_NT */
11514 } 11492 }
11515/* Note SIGIO has been undef'd if FIONREAD is missing. */ 11493/* Note SIGIO has been undef'd if FIONREAD is missing. */
11516#ifdef SIGIO 11494#ifdef SIGIO
@@ -11725,6 +11703,8 @@ syms_of_keyboard (void)
11725 staticpro (&Qx_set_selection); 11703 staticpro (&Qx_set_selection);
11726 QPRIMARY = intern_c_string ("PRIMARY"); 11704 QPRIMARY = intern_c_string ("PRIMARY");
11727 staticpro (&QPRIMARY); 11705 staticpro (&QPRIMARY);
11706 Qhandle_switch_frame = intern_c_string ("handle-switch-frame");
11707 staticpro (&Qhandle_switch_frame);
11728 11708
11729 Qinput_method_exit_on_first_char = intern_c_string ("input-method-exit-on-first-char"); 11709 Qinput_method_exit_on_first_char = intern_c_string ("input-method-exit-on-first-char");
11730 staticpro (&Qinput_method_exit_on_first_char); 11710 staticpro (&Qinput_method_exit_on_first_char);