]> code.delx.au - gnu-emacs/commitdiff
* lisp/simple.el (deactivate-mark): Set mark-active to nil even if deactivation
authorStefan Monnier <monnier@iro.umontreal.ca>
Tue, 27 May 2014 14:59:08 +0000 (10:59 -0400)
committerStefan Monnier <monnier@iro.umontreal.ca>
Tue, 27 May 2014 14:59:08 +0000 (10:59 -0400)
is done via setting transient-mark-mode to nil, since one is
buffer-local and the other is global.

lisp/ChangeLog
lisp/simple.el

index fe34854ab533c01c1fb6a5525ac93abbed68226b..51ce071ba74a720392656e43a417dac819bec141 100644 (file)
@@ -1,5 +1,9 @@
 2014-05-27  Stefan Monnier  <monnier@iro.umontreal.ca>
 
+       * simple.el (deactivate-mark): Set mark-active to nil even if deactivation
+       is done via setting transient-mark-mode to nil, since one is
+       buffer-local and the other is global.
+
        * emacs-lisp/byte-opt.el (byte-optimize-binary-predicate): Don't assume
        there can't be more than 2 arguments (bug#17584).
 
index f84997441948c8a64d15a97b14dcbb9b2ceca2f8..7bcd6cf7e719e986bc5aec2422018baf2cb46432 100644 (file)
@@ -4412,17 +4412,13 @@ run `deactivate-mark-hook'."
             (x-set-selection 'PRIMARY
                               (funcall region-extract-function nil)))))
     (when mark-active (force-mode-line-update)) ;Refresh toolbar (bug#16382).
-    (if (and (null force)
-            (or (eq transient-mark-mode 'lambda)
-                (and (eq (car-safe transient-mark-mode) 'only)
-                     (null (cdr transient-mark-mode)))))
-       ;; When deactivating a temporary region, don't change
-       ;; `mark-active' or run `deactivate-mark-hook'.
-       (setq transient-mark-mode nil)
-      (if (eq (car-safe transient-mark-mode) 'only)
-         (setq transient-mark-mode (cdr transient-mark-mode)))
-      (setq mark-active nil)
-      (run-hooks 'deactivate-mark-hook))
+    (cond
+     ((eq (car-safe transient-mark-mode) 'only)
+      (setq transient-mark-mode (cdr transient-mark-mode)))
+     ((eq transient-mark-mode 'lambda)
+      (setq transient-mark-mode nil)))
+    (setq mark-active nil)
+    (run-hooks 'deactivate-mark-hook)
     (redisplay--update-region-highlight (selected-window))))
 
 (defun activate-mark (&optional no-tmm)