emacs-diffs
[Top][All Lists]
Advanced

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

[Emacs-diffs] emacs-24 r117648: * lisp/emulation/cua-base.el (cua-delete


From: Stefan Monnier
Subject: [Emacs-diffs] emacs-24 r117648: * lisp/emulation/cua-base.el (cua-delete-region): Use delete-active-region.
Date: Fri, 31 Oct 2014 15:31:38 +0000
User-agent: Bazaar (2.6b2)

------------------------------------------------------------
revno: 117648
revision-id: address@hidden
parent: address@hidden
fixes bug: http://debbugs.gnu.org/cgi/bugreport.cgi?bug=18886
committer: Stefan Monnier <address@hidden>
branch nick: emacs-24
timestamp: Fri 2014-10-31 11:31:27 -0400
message:
  * lisp/emulation/cua-base.el (cua-delete-region): Use delete-active-region.
  (cua--last-deleted-region-pos, cua--last-deleted-region-text): Remove.
modified:
  lisp/ChangeLog                 changelog-20091113204419-o5vbwnq5f7feedwu-1432
  lisp/emulation/cua-base.el     cuabase.el-20091113204419-o5vbwnq5f7feedwu-2415
=== modified file 'lisp/ChangeLog'
--- a/lisp/ChangeLog    2014-10-31 09:32:11 +0000
+++ b/lisp/ChangeLog    2014-10-31 15:31:27 +0000
@@ -1,3 +1,9 @@
+2014-10-31  Stefan Monnier  <address@hidden>
+
+       * emulation/cua-base.el (cua-delete-region): Use delete-active-region
+       (bug#18886).
+       (cua--last-deleted-region-pos, cua--last-deleted-region-text): Remove.
+
 2014-10-31  Eli Zaretskii  <address@hidden>
 
        * Makefile.in (repo-update): Fix a typo and slightly reword

=== modified file 'lisp/emulation/cua-base.el'
--- a/lisp/emulation/cua-base.el        2014-10-30 19:19:49 +0000
+++ b/lisp/emulation/cua-base.el        2014-10-31 15:31:27 +0000
@@ -790,26 +790,12 @@
 
 ;;; Region specific commands
 
-(defvar cua--last-deleted-region-pos nil)
-(defvar cua--last-deleted-region-text nil)
-
 (defun cua-delete-region ()
   "Delete the active region.
 Save a copy in register 0 if `cua-delete-copy-to-register-0' is non-nil."
   (interactive)
-  (let ((start (mark)) (end (point)))
-    (or (<= start end)
-       (setq start (prog1 end (setq end start))))
-    (setq cua--last-deleted-region-text
-          (funcall region-extract-function t))
-    (if cua-delete-copy-to-register-0
-       (set-register ?0 cua--last-deleted-region-text))
-    (setq cua--last-deleted-region-pos
-         (cons (current-buffer)
-               (and (consp buffer-undo-list)
-                    (car buffer-undo-list))))
-    (cua--deactivate)
-    (/= start end)))
+  (require 'delsel)
+  (delete-active-region))
 
 (defun cua-copy-region (arg)
   "Copy the region to the kill ring.
@@ -1357,9 +1343,6 @@
    c-beginning-of-statement c-end-of-statement))
   (put cmd 'CUA 'move))
 
-;; Only called if pc-selection-mode is t, which means pc-select is loaded.
-(declare-function pc-selection-mode "pc-select" (&optional arg))
-
 ;; State prior to enabling cua-mode
 ;; Value is a list with the following elements:
 ;;   delete-selection-mode


reply via email to

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