summaryrefslogtreecommitdiff
path: root/lisp
diff options
context:
space:
mode:
authorRichard M. Stallman <rms@gnu.org>1994-08-30 00:36:48 +0000
committerRichard M. Stallman <rms@gnu.org>1994-08-30 00:36:48 +0000
commit3d144086a276a8473a4389955fbd34bbf05fd1d8 (patch)
treee53902caad9dc591473dfe404d9873f6ad100b93 /lisp
parent14fa46bd5d2a21583aa66a6aeec50cf3d5ba07fe (diff)
downloademacs-3d144086a276a8473a4389955fbd34bbf05fd1d8.tar.gz
(set-mark): When POS is nil, always clear mark-active.
Diffstat (limited to 'lisp')
-rw-r--r--lisp/simple.el8
1 files changed, 6 insertions, 2 deletions
diff --git a/lisp/simple.el b/lisp/simple.el
index 8dc5fa1af74..1725dd6585b 100644
--- a/lisp/simple.el
+++ b/lisp/simple.el
@@ -1335,8 +1335,12 @@ store it in a Lisp variable. Example:
(setq mark-active t)
(run-hooks 'activate-mark-hook)
(set-marker (mark-marker) pos (current-buffer)))
- (deactivate-mark)
- (set-marker (mark-marker) pos (current-buffer))))
+ ;; 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.
+ (setq mark-active nil)
+ (run-hooks 'deactivate-mark-hook)
+ (set-marker (mark-marker) nil)))
(defvar mark-ring nil
"The list of saved former marks of the current buffer,