emacs-diffs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Emacs-diffs] trunk r115459: * lisp/delsel.el (delete-selection-mode): D


From: Stefan Monnier
Subject: [Emacs-diffs] trunk r115459: * lisp/delsel.el (delete-selection-mode): Don't enable transient-mark-mode.
Date: Wed, 11 Dec 2013 14:42:37 +0000
User-agent: Bazaar (2.6b2)

------------------------------------------------------------
revno: 115459
revision-id: address@hidden
parent: address@hidden
committer: Stefan Monnier <address@hidden>
branch nick: trunk
timestamp: Wed 2013-12-11 09:42:34 -0500
message:
  * 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.
modified:
  etc/NEWS                       news-20100311060928-aoit31wvzf25yr1z-1
  lisp/ChangeLog                 changelog-20091113204419-o5vbwnq5f7feedwu-1432
  lisp/delsel.el                 delsel.el-20091113204419-o5vbwnq5f7feedwu-540
=== modified file 'etc/NEWS'
--- a/etc/NEWS  2013-12-08 16:08:45 +0000
+++ b/etc/NEWS  2013-12-11 14:42:34 +0000
@@ -247,7 +247,7 @@
 
 * Changes in Specialized Modes and Packages in Emacs 24.4
 
-** The backtrace debugger can display local vars with `v'.
+** `delete-selection-mode' can be used without transient-mark-mode.
 
 ** prolog-use-smie has been removed, along with the non-SMIE indentation code.
 
@@ -257,10 +257,6 @@
 
 ** sh-script now uses its SMIE indentation algorithm by default.
 
-** The debugger's `e' command evaluates the code in the context at point.
-This includes using the lexical environment at point, which means that
-`e' now lets you access lexical variables as well.
-
 ** `eshell' now supports visual subcommands and options
 Eshell has been able to handle "visual" commands (interactive,
 non-line oriented commands such as top that require display
@@ -318,6 +314,12 @@
 ** completing-read-multiple's separator can now be a regexp.
 The default separator is changed to allow surrounding spaces around the comma.
 
+** The backtrace debugger and local variables:
+*** The debugger's `e' command evaluates the code in the context at point.
+This includes using the lexical environment at point, which means that
+`e' now lets you access lexical variables as well.
+*** The backtrace debugger can display local vars with `v'.
+
 ** Battery
 
 *** Battery information via the BSD `apm' utility is now supported.

=== modified file 'lisp/ChangeLog'
--- a/lisp/ChangeLog    2013-12-11 14:27:15 +0000
+++ b/lisp/ChangeLog    2013-12-11 14:42:34 +0000
@@ -1,5 +1,10 @@
 2013-12-11  Stefan Monnier  <address@hidden>
 
+       * 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.
+
        * emacs-lisp/trace.el (trace-make-advice): Don't deactivate the mark.
 
        * simple.el (normal-erase-is-backspace-mode): Map kp-delete identically

=== modified file 'lisp/delsel.el'
--- a/lisp/delsel.el    2013-12-11 01:11:24 +0000
+++ b/lisp/delsel.el    2013-12-11 14:42:34 +0000
@@ -71,8 +71,7 @@
   :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 @@
                        (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 @@
 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 @@
   (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)


reply via email to

[Prev in Thread] Current Thread [Next in Thread]