Commit 536a17e3 authored by Stefan Monnier's avatar Stefan Monnier
Browse files

* lisp/simple.el (set-mark): Ensure mark-active is nil if the mark is nil.

Deactivate the mark before setting it to nil.
(activate-mark): Do nothing if region is already active.

Fixes: debbugs:16975
parent 3d8bb58a
2014-03-11 Stefan Monnier <monnier@iro.umontreal.ca>
* simple.el (set-mark): Ensure mark-active is nil if the mark is nil
(bug#16975). Deactivate the mark before setting it to nil.
(activate-mark): Do nothing if region is already active.
2014-03-11 Juanma Barranquero <lekktu@gmail.com>
* frameset.el (frameset--target-display): Remove definition; declare.
......@@ -42,8 +48,8 @@
2014-03-10 Leo Liu <sdl.web@gmail.com>
* emacs-lisp/eldoc.el (eldoc-minibuffer-message): Clear
eldoc-last-message. (Bug#16920)
* emacs-lisp/eldoc.el (eldoc-minibuffer-message):
Clear eldoc-last-message. (Bug#16920)
2014-03-10 Stefan Monnier <monnier@iro.umontreal.ca>
......
......@@ -4392,12 +4392,12 @@ run `deactivate-mark-hook'."
"Activate the mark.
If NO-TMM is non-nil, leave `transient-mark-mode' alone."
(when (mark t)
(unless (and mark-active transient-mark-mode)
(force-mode-line-update)) ;Refresh toolbar (bug#16382).
(setq mark-active t)
(unless (or transient-mark-mode no-tmm)
(setq transient-mark-mode 'lambda))
(run-hooks 'activate-mark-hook)))
(unless (region-active-p)
(force-mode-line-update) ;Refresh toolbar (bug#16382).
(setq mark-active t)
(unless (or transient-mark-mode no-tmm)
(setq transient-mark-mode 'lambda))
(run-hooks 'activate-mark-hook))))
(defun set-mark (pos)
"Set this buffer's mark to POS. Don't use this function!
......@@ -4415,14 +4415,18 @@ To remember a location for internal use in the Lisp program,
store it in a Lisp variable. Example:
(let ((beg (point))) (forward-line 1) (delete-region beg (point)))."
(set-marker (mark-marker) pos (current-buffer))
(if pos
(activate-mark 'no-tmm)
(progn
(set-marker (mark-marker) pos (current-buffer))
(activate-mark 'no-tmm))
;; Normally we never clear mark-active except in Transient Mark mode.
;; But when we actually clear out the mark value too, we must
;; clear mark-active in any mode.
(deactivate-mark t)))
(deactivate-mark t)
;; `deactivate-mark' sometimes leaves mark-active non-nil, but
;; it should never be nil if the mark is nil.
(setq mark-active nil)
(set-marker (mark-marker) nil)))
(defcustom use-empty-active-region nil
"Whether \"region-aware\" commands should act on empty regions.
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment