comparison src/callint.c @ 93542:5dd7fdf8c27e

(Vshift_select_mode): New var. (Finteractive): Document new ^ spec. (Fcall_interactively): Call handle-shift-selection if the ^ spec is present.
author Chong Yidong <cyd@stupidchicken.com>
date Wed, 02 Apr 2008 20:14:40 +0000
parents 82e99a4c7c09
children 42db50d02ca0
comparison
equal deleted inserted replaced
93541:f924a28b09bd 93542:5dd7fdf8c27e
48 Lisp_Object Qenable_recursive_minibuffers; 48 Lisp_Object Qenable_recursive_minibuffers;
49 49
50 /* Non-nil means treat the mark as active 50 /* Non-nil means treat the mark as active
51 even if mark_active is 0. */ 51 even if mark_active is 0. */
52 Lisp_Object Vmark_even_if_inactive; 52 Lisp_Object Vmark_even_if_inactive;
53
54 Lisp_Object Vshift_select_mode, Qhandle_shift_selection;
53 55
54 Lisp_Object Vmouse_leave_buffer_hook, Qmouse_leave_buffer_hook; 56 Lisp_Object Vmouse_leave_buffer_hook, Qmouse_leave_buffer_hook;
55 57
56 Lisp_Object Qlist, Qlet, Qletx, Qsave_excursion, Qprogn, Qif, Qwhen; 58 Lisp_Object Qlist, Qlet, Qletx, Qsave_excursion, Qprogn, Qif, Qwhen;
57 static Lisp_Object preserved_fns; 59 static Lisp_Object preserved_fns;
113 v -- Variable name: symbol that is user-variable-p. 115 v -- Variable name: symbol that is user-variable-p.
114 x -- Lisp expression read but not evaluated. 116 x -- Lisp expression read but not evaluated.
115 X -- Lisp expression read and evaluated. 117 X -- Lisp expression read and evaluated.
116 z -- Coding system. 118 z -- Coding system.
117 Z -- Coding system, nil if no prefix arg. 119 Z -- Coding system, nil if no prefix arg.
118 In addition, if the string begins with `*' 120
119 then an error is signaled if the buffer is read-only. 121 In addition, if the string begins with `*', an error is signaled if
120 This happens before reading any arguments. 122 the buffer is read-only.
121 If the string begins with `@', then Emacs searches the key sequence 123 If the string begins with `@', Emacs searches the key sequence which
122 which invoked the command for its first mouse click (or any other 124 invoked the command for its first mouse click (or any other event
123 event which specifies a window), and selects that window before 125 which specifies a window).
124 reading any arguments. You may use both `@' and `*'; they are 126 If the string begins with `^' and `shift-select-mode' is non-nil,
125 processed in the order that they appear. 127 Emacs first calls the function `handle-shift-select'.
128 You may use `@', `*', and `^' together. They are processed in the
129 order that they appear, before reading any arguments.
126 usage: (interactive ARGS) */) 130 usage: (interactive ARGS) */)
127 (args) 131 (args)
128 Lisp_Object args; 132 Lisp_Object args;
129 { 133 {
130 return Qnil; 134 return Qnil;
445 449
446 Fselect_window (tem, Qnil); 450 Fselect_window (tem, Qnil);
447 } 451 }
448 string++; 452 string++;
449 } 453 }
454 else if (*string == '^')
455 {
456 if (! NILP (Vshift_select_mode))
457 call0 (Qhandle_shift_selection);
458 string++;
459 }
450 else break; 460 else break;
451 } 461 }
452 462
453 /* Count the number of arguments the interactive spec would have 463 /* Count the number of arguments the interactive spec would have
454 us give to the function. */ 464 us give to the function. */
903 staticpro (&Qminus); 913 staticpro (&Qminus);
904 914
905 Qplus = intern ("+"); 915 Qplus = intern ("+");
906 staticpro (&Qplus); 916 staticpro (&Qplus);
907 917
918 Qhandle_shift_selection = intern ("handle-shift-selection");
919 staticpro (&Qhandle_shift_selection);
920
908 Qcall_interactively = intern ("call-interactively"); 921 Qcall_interactively = intern ("call-interactively");
909 staticpro (&Qcall_interactively); 922 staticpro (&Qcall_interactively);
910 923
911 Qcommand_debug_status = intern ("command-debug-status"); 924 Qcommand_debug_status = intern ("command-debug-status");
912 staticpro (&Qcommand_debug_status); 925 staticpro (&Qcommand_debug_status);
960 When the option is non-nil, deactivation of the mark 973 When the option is non-nil, deactivation of the mark
961 turns off region highlighting, but commands that use the mark 974 turns off region highlighting, but commands that use the mark
962 behave as if the mark were still active. */); 975 behave as if the mark were still active. */);
963 Vmark_even_if_inactive = Qt; 976 Vmark_even_if_inactive = Qt;
964 977
978 DEFVAR_LISP ("shift-select-mode", &Vshift_select_mode,
979 doc: /* When non-nil, shifted motion keys activate the mark momentarily.
980
981 While the mark is activated in this way, any shift-translated point
982 motion key extends the region, and if Transient Mark mode was off, it
983 is temporarily turned on. Furthermore, the mark will be deactivated
984 by any subsequent point motion key that was not shift-translated, or
985 by any action that normally deactivates the mark in Transient Mark
986 mode.
987
988 See `this-command-keys-shift-translated' for the meaning of
989 shift-translation. */);
990 Vshift_select_mode = Qt;
991
965 DEFVAR_LISP ("mouse-leave-buffer-hook", &Vmouse_leave_buffer_hook, 992 DEFVAR_LISP ("mouse-leave-buffer-hook", &Vmouse_leave_buffer_hook,
966 doc: /* Hook to run when about to switch windows with a mouse command. 993 doc: /* Hook to run when about to switch windows with a mouse command.
967 Its purpose is to give temporary modes such as Isearch mode 994 Its purpose is to give temporary modes such as Isearch mode
968 a way to turn themselves off when a mouse command switches windows. */); 995 a way to turn themselves off when a mouse command switches windows. */);
969 Vmouse_leave_buffer_hook = Qnil; 996 Vmouse_leave_buffer_hook = Qnil;