]> git.eshelyaron.com Git - emacs.git/commitdiff
* lisp/simple.el (deactivate-mark, set-mark-command, handle-shift-selection):
authorStefan Monnier <monnier@iro.umontreal.ca>
Tue, 1 Jul 2014 18:13:28 +0000 (14:13 -0400)
committerStefan Monnier <monnier@iro.umontreal.ca>
Tue, 1 Jul 2014 18:13:28 +0000 (14:13 -0400)
Don't keep transient-mark-mode buffer-local when not needed.

Fixes: debbugs:6316
lisp/ChangeLog
lisp/simple.el

index 054bef5697d3ba55260e1faa9a0769e886c74b99..6f279c7b45474cc736082520fb50e308cc7ac0e3 100644 (file)
@@ -1,5 +1,8 @@
 2014-07-01  Stefan Monnier  <monnier@iro.umontreal.ca>
 
+       * simple.el (deactivate-mark, set-mark-command, handle-shift-selection):
+       Don't keep transient-mark-mode buffer-local when not needed (bug#6316).
+
        * xt-mouse.el (turn-on-xterm-mouse-tracking-on-terminal)
        (turn-off-xterm-mouse-tracking-on-terminal): Don't burp if the terminal
        is suspended (bug#17857).
index a8689aaf2e3b1f8378ee9d1dbd387a884765c96e..6fd50197a10d2c44fb67360ee2306aa705dc2efd 100644 (file)
@@ -4527,9 +4527,11 @@ run `deactivate-mark-hook'."
     (when mark-active (force-mode-line-update)) ;Refresh toolbar (bug#16382).
     (cond
      ((eq (car-safe transient-mark-mode) 'only)
-      (setq transient-mark-mode (cdr transient-mark-mode)))
+      (setq transient-mark-mode (cdr transient-mark-mode))
+      (if (eq transient-mark-mode (default-value 'transient-mark-mode))
+          (kill-local-variable 'transient-mark-mode)))
      ((eq transient-mark-mode 'lambda)
-      (setq transient-mark-mode nil)))
+      (kill-local-variable 'transient-mark-mode)))
     (setq mark-active nil)
     (run-hooks 'deactivate-mark-hook)
     (redisplay--update-region-highlight (selected-window))))
@@ -4756,7 +4758,7 @@ Novice Emacs Lisp programmers often try to use the mark for the wrong
 purposes.  See the documentation of `set-mark' for more information."
   (interactive "P")
   (cond ((eq transient-mark-mode 'lambda)
-        (setq transient-mark-mode nil))
+        (kill-local-variable 'transient-mark-mode))
        ((eq (car-safe transient-mark-mode) 'only)
         (deactivate-mark)))
   (cond
@@ -4894,6 +4896,8 @@ its earlier value."
            (push-mark nil nil t)))
         ((eq (car-safe transient-mark-mode) 'only)
          (setq transient-mark-mode (cdr transient-mark-mode))
+         (if (eq transient-mark-mode (default-value 'transient-mark-mode))
+             (kill-local-variable 'transient-mark-mode))
          (deactivate-mark))))
 
 (define-minor-mode transient-mark-mode