* 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.
This commit is contained in:
Stefan Monnier 2014-05-27 10:59:08 -04:00
parent 53bc1e2982
commit 9828d52319
2 changed files with 11 additions and 11 deletions

View 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).

View 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)