aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorStefan Monnier2014-10-31 11:31:27 -0400
committerStefan Monnier2014-10-31 11:31:27 -0400
commit95af181d665ffe7f0361c3f468445ac8e4a7858e (patch)
tree8098ba4cb570c1906cf739072e2acd769ffb4cb7
parent08f558056d6b7aeb7337c070e98071db7477f428 (diff)
downloademacs-95af181d665ffe7f0361c3f468445ac8e4a7858e.tar.gz
emacs-95af181d665ffe7f0361c3f468445ac8e4a7858e.zip
* lisp/emulation/cua-base.el (cua-delete-region): Use delete-active-region.
(cua--last-deleted-region-pos, cua--last-deleted-region-text): Remove. Fixes: debbugs:18886
-rw-r--r--lisp/ChangeLog6
-rw-r--r--lisp/emulation/cua-base.el21
2 files changed, 8 insertions, 19 deletions
diff --git a/lisp/ChangeLog b/lisp/ChangeLog
index b4dc92d442e..dd9e4b13846 100644
--- a/lisp/ChangeLog
+++ b/lisp/ChangeLog
@@ -1,3 +1,9 @@
12014-10-31 Stefan Monnier <monnier@iro.umontreal.ca>
2
3 * emulation/cua-base.el (cua-delete-region): Use delete-active-region
4 (bug#18886).
5 (cua--last-deleted-region-pos, cua--last-deleted-region-text): Remove.
6
12014-10-31 Eli Zaretskii <eliz@gnu.org> 72014-10-31 Eli Zaretskii <eliz@gnu.org>
2 8
3 * Makefile.in (repo-update): Fix a typo and slightly reword 9 * Makefile.in (repo-update): Fix a typo and slightly reword
diff --git a/lisp/emulation/cua-base.el b/lisp/emulation/cua-base.el
index c57188338ce..2f321f74b97 100644
--- a/lisp/emulation/cua-base.el
+++ b/lisp/emulation/cua-base.el
@@ -790,26 +790,12 @@ Repeating prefix key when region is active works as a single prefix key."
790 790
791;;; Region specific commands 791;;; Region specific commands
792 792
793(defvar cua--last-deleted-region-pos nil)
794(defvar cua--last-deleted-region-text nil)
795
796(defun cua-delete-region () 793(defun cua-delete-region ()
797 "Delete the active region. 794 "Delete the active region.
798Save a copy in register 0 if `cua-delete-copy-to-register-0' is non-nil." 795Save a copy in register 0 if `cua-delete-copy-to-register-0' is non-nil."
799 (interactive) 796 (interactive)
800 (let ((start (mark)) (end (point))) 797 (require 'delsel)
801 (or (<= start end) 798 (delete-active-region))
802 (setq start (prog1 end (setq end start))))
803 (setq cua--last-deleted-region-text
804 (funcall region-extract-function t))
805 (if cua-delete-copy-to-register-0
806 (set-register ?0 cua--last-deleted-region-text))
807 (setq cua--last-deleted-region-pos
808 (cons (current-buffer)
809 (and (consp buffer-undo-list)
810 (car buffer-undo-list))))
811 (cua--deactivate)
812 (/= start end)))
813 799
814(defun cua-copy-region (arg) 800(defun cua-copy-region (arg)
815 "Copy the region to the kill ring. 801 "Copy the region to the kill ring.
@@ -1357,9 +1343,6 @@ If ARG is the atom `-', scroll upward by nearly full screen."
1357 c-beginning-of-statement c-end-of-statement)) 1343 c-beginning-of-statement c-end-of-statement))
1358 (put cmd 'CUA 'move)) 1344 (put cmd 'CUA 'move))
1359 1345
1360;; Only called if pc-selection-mode is t, which means pc-select is loaded.
1361(declare-function pc-selection-mode "pc-select" (&optional arg))
1362
1363;; State prior to enabling cua-mode 1346;; State prior to enabling cua-mode
1364;; Value is a list with the following elements: 1347;; Value is a list with the following elements:
1365;; delete-selection-mode 1348;; delete-selection-mode