From 6d25a31264b762489937cbf4279367a5aa014431 Mon Sep 17 00:00:00 2001 From: Stefan Monnier Date: Tue, 26 Feb 2008 19:41:53 +0000 Subject: [PATCH] (set-mark-command): Deactivate mark on second C-SPC C-SPC when using transient-mark-mode. --- etc/NEWS | 2 ++ lisp/ChangeLog | 5 +++++ lisp/simple.el | 4 +++- 3 files changed, 10 insertions(+), 1 deletion(-) diff --git a/etc/NEWS b/etc/NEWS index da00a9cc2bc..b8cc452404c 100644 --- a/etc/NEWS +++ b/etc/NEWS @@ -136,6 +136,8 @@ the currently selected Emacs frame. ** Emacs now supports the SVG image format through librsvg2. +** C-SPC C-SPC in transient-mark-mode pushes a mark without activating it. + ** transient-mark-mode is now enabled by default. ** If you set find-file-confirm-nonexistent-file to t, then C-x C-f diff --git a/lisp/ChangeLog b/lisp/ChangeLog index 4aea9bfb446..2693e1e27b5 100644 --- a/lisp/ChangeLog +++ b/lisp/ChangeLog @@ -1,3 +1,8 @@ +2008-02-26 Stefan Monnier + + * simple.el (set-mark-command): Deactivate mark on second C-SPC C-SPC + when using transient-mark-mode. + 2008-02-26 Jan Dj$(Q)Z(Brv * progmodes/grep.el (grep-mode-tool-bar-map): Change place on next diff --git a/lisp/simple.el b/lisp/simple.el index 0ae64b550b7..53343dad2b5 100644 --- a/lisp/simple.el +++ b/lisp/simple.el @@ -3499,6 +3499,9 @@ purposes. See the documentation of `set-mark' for more information." mark-active (null transient-mark-mode)) (setq transient-mark-mode 'lambda) (message "Transient-mark-mode temporarily enabled")) + ((and (eq last-command 'set-mark-command) + transient-mark-mode) + (deactivate-mark)) (t (push-mark-command nil)))) @@ -4598,7 +4601,6 @@ The variable `selective-display' has a separate value for each buffer." (princ "." t)) (defvaralias 'indicate-unused-lines 'indicate-empty-lines) -(defvaralias 'default-indicate-unused-lines 'default-indicate-empty-lines) (defun toggle-truncate-lines (&optional arg) "Toggle whether to fold or truncate long lines for the current buffer. -- 2.39.5