diff options
author | Chong Yidong <cyd@stupidchicken.com> | 2008-04-02 20:14:40 +0000 |
---|---|---|
committer | Chong Yidong <cyd@stupidchicken.com> | 2008-04-02 20:14:40 +0000 |
commit | f193f24711b350302e14a41a883d8dfd0aeb9e41 (patch) | |
tree | 5be2f09b4bcaddd04517e648e262e1b217c2c19f /src/callint.c | |
parent | c27e13c3dfbc0a59f8a15a9627bdc94effd06bf5 (diff) | |
download | emacs-f193f24711b350302e14a41a883d8dfd0aeb9e41.tar.gz |
(Vshift_select_mode): New var.
(Finteractive): Document new ^ spec.
(Fcall_interactively): Call handle-shift-selection if the ^ spec
is present.
Diffstat (limited to 'src/callint.c')
-rw-r--r-- | src/callint.c | 43 |
1 files changed, 35 insertions, 8 deletions
diff --git a/src/callint.c b/src/callint.c index 8a9f8322d9b..47c5cd5275c 100644 --- a/src/callint.c +++ b/src/callint.c @@ -51,6 +51,8 @@ Lisp_Object Qenable_recursive_minibuffers; even if mark_active is 0. */ Lisp_Object Vmark_even_if_inactive; +Lisp_Object Vshift_select_mode, Qhandle_shift_selection; + Lisp_Object Vmouse_leave_buffer_hook, Qmouse_leave_buffer_hook; Lisp_Object Qlist, Qlet, Qletx, Qsave_excursion, Qprogn, Qif, Qwhen; @@ -115,14 +117,16 @@ x -- Lisp expression read but not evaluated. X -- Lisp expression read and evaluated. z -- Coding system. Z -- Coding system, nil if no prefix arg. -In addition, if the string begins with `*' - then an error is signaled if the buffer is read-only. - This happens before reading any arguments. -If the string begins with `@', then Emacs searches the key sequence - which invoked the command for its first mouse click (or any other - event which specifies a window), and selects that window before - reading any arguments. You may use both `@' and `*'; they are - processed in the order that they appear. + +In addition, if the string begins with `*', an error is signaled if + the buffer is read-only. +If the string begins with `@', Emacs searches the key sequence which + invoked the command for its first mouse click (or any other event + which specifies a window). +If the string begins with `^' and `shift-select-mode' is non-nil, + Emacs first calls the function `handle-shift-select'. +You may use `@', `*', and `^' together. They are processed in the + order that they appear, before reading any arguments. usage: (interactive ARGS) */) (args) Lisp_Object args; @@ -447,6 +451,12 @@ invoke it. If KEYS is omitted or nil, the return value of } string++; } + else if (*string == '^') + { + if (! NILP (Vshift_select_mode)) + call0 (Qhandle_shift_selection); + string++; + } else break; } @@ -905,6 +915,9 @@ syms_of_callint () Qplus = intern ("+"); staticpro (&Qplus); + Qhandle_shift_selection = intern ("handle-shift-selection"); + staticpro (&Qhandle_shift_selection); + Qcall_interactively = intern ("call-interactively"); staticpro (&Qcall_interactively); @@ -962,6 +975,20 @@ turns off region highlighting, but commands that use the mark behave as if the mark were still active. */); Vmark_even_if_inactive = Qt; + DEFVAR_LISP ("shift-select-mode", &Vshift_select_mode, + doc: /* When non-nil, shifted motion keys activate the mark momentarily. + +While the mark is activated in this way, any shift-translated point +motion key extends the region, and if Transient Mark mode was off, it +is temporarily turned on. Furthermore, the mark will be deactivated +by any subsequent point motion key that was not shift-translated, or +by any action that normally deactivates the mark in Transient Mark +mode. + +See `this-command-keys-shift-translated' for the meaning of +shift-translation. */); + Vshift_select_mode = Qt; + DEFVAR_LISP ("mouse-leave-buffer-hook", &Vmouse_leave_buffer_hook, doc: /* Hook to run when about to switch windows with a mouse command. Its purpose is to give temporary modes such as Isearch mode |