summaryrefslogtreecommitdiff
path: root/lisp/delsel.el
diff options
context:
space:
mode:
authorStefan Monnier <monnier@iro.umontreal.ca>2013-12-11 09:42:34 -0500
committerStefan Monnier <monnier@iro.umontreal.ca>2013-12-11 09:42:34 -0500
commit4b72c12bf8e7231aba333ee1c2c354c35c0dd77c (patch)
tree4c4ecbac91108fcef435be1e882cd8c50c5be46c /lisp/delsel.el
parente82af72d50e789123f3aba16c7389c688c49469a (diff)
* 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.
Diffstat (limited to 'lisp/delsel.el')
-rw-r--r--lisp/delsel.el17
1 files changed, 10 insertions, 7 deletions
diff --git a/lisp/delsel.el b/lisp/delsel.el
index f0c6996834..87e84e59de 100644
--- a/lisp/delsel.el
+++ b/lisp/delsel.el
@@ -71,8 +71,7 @@ any selection."
:global t :group 'editing-basics
(if (not delete-selection-mode)
(remove-hook 'pre-command-hook 'delete-selection-pre-hook)
- (add-hook 'pre-command-hook 'delete-selection-pre-hook)
- (transient-mark-mode t)))
+ (add-hook 'pre-command-hook 'delete-selection-pre-hook)))
(defun delete-active-region (&optional killp)
"Delete the active region.
@@ -122,7 +121,11 @@ If KILLP in not-nil, the active region is killed instead of deleted."
(fboundp 'mouse-region-match)
(mouse-region-match))
(current-kill 1))
- (delete-active-region))
+ (let ((pos (copy-marker (region-beginning))))
+ (delete-active-region)
+ ;; If the region was, say, rectangular, make sure we yank
+ ;; from the top, to "replace".
+ (goto-char pos)))
((eq type 'supersede)
(let ((empty-region (= (point) (mark))))
(delete-active-region)
@@ -192,7 +195,7 @@ See `delete-selection-helper'."
In Delete Selection mode, if the mark is active, just deactivate it;
then it takes a second \\[keyboard-quit] to abort the minibuffer."
(interactive)
- (if (and delete-selection-mode transient-mark-mode mark-active)
+ (if (and delete-selection-mode (region-active-p))
(setq deactivate-mark t)
(abort-recursive-edit)))
@@ -209,9 +212,9 @@ then it takes a second \\[keyboard-quit] to abort the minibuffer."
(define-key minibuffer-local-completion-map "\C-g" 'abort-recursive-edit)
(define-key minibuffer-local-must-match-map "\C-g" 'abort-recursive-edit)
(define-key minibuffer-local-isearch-map "\C-g" 'abort-recursive-edit)
- (dolist (sym '(self-insert-command insert-char quoted-insert yank clipboard-yank
- insert-register
- reindent-then-newline-and-indent newline-and-indent newline open-line))
+ (dolist (sym '(self-insert-command insert-char quoted-insert yank
+ clipboard-yank insert-register newline-and-indent
+ reindent-then-newline-and-indent newline open-line))
(put sym 'delete-selection nil))
;; continue standard unloading
nil)