aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorStefan Monnier2013-12-11 09:42:34 -0500
committerStefan Monnier2013-12-11 09:42:34 -0500
commit4b72c12bf8e7231aba333ee1c2c354c35c0dd77c (patch)
tree4c4ecbac91108fcef435be1e882cd8c50c5be46c
parente82af72d50e789123f3aba16c7389c688c49469a (diff)
downloademacs-4b72c12bf8e7231aba333ee1c2c354c35c0dd77c.tar.gz
emacs-4b72c12bf8e7231aba333ee1c2c354c35c0dd77c.zip
* lisp/delsel.el (delete-selection-mode): Don't enable transient-mark-mode.
(delete-selection-helper): Make sure yank starts at the top of the deleted region. (minibuffer-keyboard-quit): Use region-active-p.
-rw-r--r--etc/NEWS12
-rw-r--r--lisp/ChangeLog5
-rw-r--r--lisp/delsel.el17
3 files changed, 22 insertions, 12 deletions
diff --git a/etc/NEWS b/etc/NEWS
index 8ee102487ae..b446d2709b3 100644
--- a/etc/NEWS
+++ b/etc/NEWS
@@ -247,7 +247,7 @@ You can pick the name of the function and the variables with `C-x 4 a'.
247 247
248* Changes in Specialized Modes and Packages in Emacs 24.4 248* Changes in Specialized Modes and Packages in Emacs 24.4
249 249
250** The backtrace debugger can display local vars with `v'. 250** `delete-selection-mode' can be used without transient-mark-mode.
251 251
252** prolog-use-smie has been removed, along with the non-SMIE indentation code. 252** prolog-use-smie has been removed, along with the non-SMIE indentation code.
253 253
@@ -257,10 +257,6 @@ file and letting SMIE learn from it.
257 257
258** sh-script now uses its SMIE indentation algorithm by default. 258** sh-script now uses its SMIE indentation algorithm by default.
259 259
260** The debugger's `e' command evaluates the code in the context at point.
261This includes using the lexical environment at point, which means that
262`e' now lets you access lexical variables as well.
263
264** `eshell' now supports visual subcommands and options 260** `eshell' now supports visual subcommands and options
265Eshell has been able to handle "visual" commands (interactive, 261Eshell has been able to handle "visual" commands (interactive,
266non-line oriented commands such as top that require display 262non-line oriented commands such as top that require display
@@ -318,6 +314,12 @@ Use `electric-indent-mode' instead.
318** completing-read-multiple's separator can now be a regexp. 314** completing-read-multiple's separator can now be a regexp.
319The default separator is changed to allow surrounding spaces around the comma. 315The default separator is changed to allow surrounding spaces around the comma.
320 316
317** The backtrace debugger and local variables:
318*** The debugger's `e' command evaluates the code in the context at point.
319This includes using the lexical environment at point, which means that
320`e' now lets you access lexical variables as well.
321*** The backtrace debugger can display local vars with `v'.
322
321** Battery 323** Battery
322 324
323*** Battery information via the BSD `apm' utility is now supported. 325*** Battery information via the BSD `apm' utility is now supported.
diff --git a/lisp/ChangeLog b/lisp/ChangeLog
index 2b1b2fe97c0..fa825ccaf33 100644
--- a/lisp/ChangeLog
+++ b/lisp/ChangeLog
@@ -1,5 +1,10 @@
12013-12-11 Stefan Monnier <monnier@iro.umontreal.ca> 12013-12-11 Stefan Monnier <monnier@iro.umontreal.ca>
2 2
3 * delsel.el (delete-selection-mode): Don't enable transient-mark-mode.
4 (delete-selection-helper): Make sure yank starts at the top of the
5 deleted region.
6 (minibuffer-keyboard-quit): Use region-active-p.
7
3 * emacs-lisp/trace.el (trace-make-advice): Don't deactivate the mark. 8 * emacs-lisp/trace.el (trace-make-advice): Don't deactivate the mark.
4 9
5 * simple.el (normal-erase-is-backspace-mode): Map kp-delete identically 10 * simple.el (normal-erase-is-backspace-mode): Map kp-delete identically
diff --git a/lisp/delsel.el b/lisp/delsel.el
index f0c6996834b..87e84e59dee 100644
--- a/lisp/delsel.el
+++ b/lisp/delsel.el
@@ -71,8 +71,7 @@ any selection."
71 :global t :group 'editing-basics 71 :global t :group 'editing-basics
72 (if (not delete-selection-mode) 72 (if (not delete-selection-mode)
73 (remove-hook 'pre-command-hook 'delete-selection-pre-hook) 73 (remove-hook 'pre-command-hook 'delete-selection-pre-hook)
74 (add-hook 'pre-command-hook 'delete-selection-pre-hook) 74 (add-hook 'pre-command-hook 'delete-selection-pre-hook)))
75 (transient-mark-mode t)))
76 75
77(defun delete-active-region (&optional killp) 76(defun delete-active-region (&optional killp)
78 "Delete the active region. 77 "Delete the active region.
@@ -122,7 +121,11 @@ If KILLP in not-nil, the active region is killed instead of deleted."
122 (fboundp 'mouse-region-match) 121 (fboundp 'mouse-region-match)
123 (mouse-region-match)) 122 (mouse-region-match))
124 (current-kill 1)) 123 (current-kill 1))
125 (delete-active-region)) 124 (let ((pos (copy-marker (region-beginning))))
125 (delete-active-region)
126 ;; If the region was, say, rectangular, make sure we yank
127 ;; from the top, to "replace".
128 (goto-char pos)))
126 ((eq type 'supersede) 129 ((eq type 'supersede)
127 (let ((empty-region (= (point) (mark)))) 130 (let ((empty-region (= (point) (mark))))
128 (delete-active-region) 131 (delete-active-region)
@@ -192,7 +195,7 @@ See `delete-selection-helper'."
192In Delete Selection mode, if the mark is active, just deactivate it; 195In Delete Selection mode, if the mark is active, just deactivate it;
193then it takes a second \\[keyboard-quit] to abort the minibuffer." 196then it takes a second \\[keyboard-quit] to abort the minibuffer."
194 (interactive) 197 (interactive)
195 (if (and delete-selection-mode transient-mark-mode mark-active) 198 (if (and delete-selection-mode (region-active-p))
196 (setq deactivate-mark t) 199 (setq deactivate-mark t)
197 (abort-recursive-edit))) 200 (abort-recursive-edit)))
198 201
@@ -209,9 +212,9 @@ then it takes a second \\[keyboard-quit] to abort the minibuffer."
209 (define-key minibuffer-local-completion-map "\C-g" 'abort-recursive-edit) 212 (define-key minibuffer-local-completion-map "\C-g" 'abort-recursive-edit)
210 (define-key minibuffer-local-must-match-map "\C-g" 'abort-recursive-edit) 213 (define-key minibuffer-local-must-match-map "\C-g" 'abort-recursive-edit)
211 (define-key minibuffer-local-isearch-map "\C-g" 'abort-recursive-edit) 214 (define-key minibuffer-local-isearch-map "\C-g" 'abort-recursive-edit)
212 (dolist (sym '(self-insert-command insert-char quoted-insert yank clipboard-yank 215 (dolist (sym '(self-insert-command insert-char quoted-insert yank
213 insert-register 216 clipboard-yank insert-register newline-and-indent
214 reindent-then-newline-and-indent newline-and-indent newline open-line)) 217 reindent-then-newline-and-indent newline open-line))
215 (put sym 'delete-selection nil)) 218 (put sym 'delete-selection nil))
216 ;; continue standard unloading 219 ;; continue standard unloading
217 nil) 220 nil)