emacs-diffs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Emacs-diffs] emacs lisp/ChangeLog lisp/simple.el src/ChangeL...


From: Stefan Monnier
Subject: [Emacs-diffs] emacs lisp/ChangeLog lisp/simple.el src/ChangeL...
Date: Thu, 26 Mar 2009 17:08:00 +0000

CVSROOT:        /sources/emacs
Module name:    emacs
Changes by:     Stefan Monnier <monnier>        09/03/26 17:07:59

Modified files:
        lisp           : ChangeLog simple.el 
        src            : ChangeLog callint.c 

Log message:
        * callint.c (Fcall_interactively): For '^' just delegate the work to
        handle-shift-selection.
        (syms_of_callint): Move declaration of shift-select-mode to simple.el.
        * simple.el (shift-select-mode): Move declaration from callint.c.
        (handle-shift-selection): Remove `deactivate' arg and check
        shift-select-mode instead.

CVSWeb URLs:
http://cvs.savannah.gnu.org/viewcvs/emacs/lisp/ChangeLog?cvsroot=emacs&r1=1.15525&r2=1.15526
http://cvs.savannah.gnu.org/viewcvs/emacs/lisp/simple.el?cvsroot=emacs&r1=1.979&r2=1.980
http://cvs.savannah.gnu.org/viewcvs/emacs/src/ChangeLog?cvsroot=emacs&r1=1.7451&r2=1.7452
http://cvs.savannah.gnu.org/viewcvs/emacs/src/callint.c?cvsroot=emacs&r1=1.171&r2=1.172

Patches:
Index: lisp/ChangeLog
===================================================================
RCS file: /sources/emacs/emacs/lisp/ChangeLog,v
retrieving revision 1.15525
retrieving revision 1.15526
diff -u -b -r1.15525 -r1.15526
--- lisp/ChangeLog      26 Mar 2009 16:21:25 -0000      1.15525
+++ lisp/ChangeLog      26 Mar 2009 17:07:54 -0000      1.15526
@@ -1,3 +1,9 @@
+2009-03-26  Stefan Monnier  <address@hidden>
+
+       * simple.el (shift-select-mode): Move declaration from callint.c.
+       (handle-shift-selection): Remove `deactivate' arg and check
+       shift-select-mode instead.
+
 2009-03-26  Juanma Barranquero  <address@hidden>
 
        * align.el (align-large-region, align-perl-modes, align-rules-list)

Index: lisp/simple.el
===================================================================
RCS file: /sources/emacs/emacs/lisp/simple.el,v
retrieving revision 1.979
retrieving revision 1.980
diff -u -b -r1.979 -r1.980
--- lisp/simple.el      21 Mar 2009 18:38:40 -0000      1.979
+++ lisp/simple.el      26 Mar 2009 17:07:57 -0000      1.980
@@ -3746,23 +3746,34 @@
          (t (activate-mark)))
     nil))
 
-(defun handle-shift-selection (&optional deactivate)
+(defvar shift-select-mode t
+  "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.")
+
+(defun handle-shift-selection ()
   "Activate/deactivate mark depending on invocation thru ``shift translation.''
 
 \(See `this-command-keys-shift-translated' for the meaning of
 shift translation.)
 
 This is called whenever a command with a `^' character in its
-`interactive' spec is invoked while `shift-select-mode' is
-non-nil.
+`interactive' spec is invoked.
+Its behavior is controlled by `shift-select-mode'.
 
 If the command was invoked through shift translation, set the
 mark and activate the region temporarily, unless it was already
 set in this way.  If the command was invoked without shift
-translation, or if the optional argument DEACTIVATE is non-nil,
+translation, or if the region was activated by the mouse,
 deactivate the mark if the region is temporarily active."
-  (cond ((and this-command-keys-shift-translated
-             (null deactivate))
+  (cond ((and shift-select-mode this-command-keys-shift-translated)
         (unless (and mark-active
                      (eq (car-safe transient-mark-mode) 'only))
           (setq transient-mark-mode

Index: src/ChangeLog
===================================================================
RCS file: /sources/emacs/emacs/src/ChangeLog,v
retrieving revision 1.7451
retrieving revision 1.7452
diff -u -b -r1.7451 -r1.7452
--- src/ChangeLog       24 Mar 2009 17:37:32 -0000      1.7451
+++ src/ChangeLog       26 Mar 2009 17:07:57 -0000      1.7452
@@ -1,3 +1,9 @@
+2009-03-26  Stefan Monnier  <address@hidden>
+
+       * callint.c (Fcall_interactively): For '^' just delegate the work to
+       handle-shift-selection.
+       (syms_of_callint): Move declaration of shift-select-mode to simple.el.
+
 2009-03-24  Chong Yidong  <address@hidden>
 
        * editfns.c (Ffloat_time): Doc fix (Bug#2768).

Index: src/callint.c
===================================================================
RCS file: /sources/emacs/emacs/src/callint.c,v
retrieving revision 1.171
retrieving revision 1.172
diff -u -b -r1.171 -r1.172
--- src/callint.c       22 Mar 2009 15:07:10 -0000      1.171
+++ src/callint.c       26 Mar 2009 17:07:59 -0000      1.172
@@ -51,7 +51,7 @@
    even if mark_active is 0.  */
 Lisp_Object Vmark_even_if_inactive;
 
-Lisp_Object Vshift_select_mode, Qhandle_shift_selection;
+Lisp_Object Qhandle_shift_selection;
 
 Lisp_Object Vmouse_leave_buffer_hook, Qmouse_leave_buffer_hook;
 
@@ -454,14 +454,7 @@
        }
       else if (*string == '^')
        {
-         if (! NILP (Vshift_select_mode))
-           call1 (Qhandle_shift_selection, Qnil);
-         /* Even if shift-select-mode is off, temporarily active
-            regions could be set using the mouse, and should be
-            deactivated.  */
-         else if (CONSP (Vtransient_mark_mode)
-                  && EQ (XCAR (Vtransient_mark_mode), Qonly))
-           call1 (Qhandle_shift_selection, Qt);
+         call0 (Qhandle_shift_selection);
          string++;
        }
       else break;
@@ -994,20 +987,6 @@
 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




reply via email to

[Prev in Thread] Current Thread [Next in Thread]