From: Stefan Monnier Date: Tue, 27 May 2014 14:59:08 +0000 (-0400) Subject: * lisp/simple.el (deactivate-mark): Set mark-active to nil even if deactivation X-Git-Tag: emacs-24.3.92~155 X-Git-Url: http://git.eshelyaron.com/gitweb/?a=commitdiff_plain;h=9828d523192e9fc02b9aa78a84a8c012c8cc2a75;p=emacs.git * lisp/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. --- diff --git a/lisp/ChangeLog b/lisp/ChangeLog index fe34854ab53..51ce071ba74 100644 --- a/lisp/ChangeLog +++ b/lisp/ChangeLog @@ -1,5 +1,9 @@ 2014-05-27 Stefan Monnier + * 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). diff --git a/lisp/simple.el b/lisp/simple.el index f8499744194..7bcd6cf7e71 100644 --- a/lisp/simple.el +++ b/lisp/simple.el @@ -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)