diff options
author | Stefan Monnier <monnier@iro.umontreal.ca> | 2014-10-31 11:31:27 -0400 |
---|---|---|
committer | Stefan Monnier <monnier@iro.umontreal.ca> | 2014-10-31 11:31:27 -0400 |
commit | 95af181d665ffe7f0361c3f468445ac8e4a7858e (patch) | |
tree | 8098ba4cb570c1906cf739072e2acd769ffb4cb7 /lisp | |
parent | 08f558056d6b7aeb7337c070e98071db7477f428 (diff) | |
download | emacs-95af181d665ffe7f0361c3f468445ac8e4a7858e.tar.gz |
* 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
Diffstat (limited to 'lisp')
-rw-r--r-- | lisp/ChangeLog | 6 | ||||
-rw-r--r-- | lisp/emulation/cua-base.el | 21 |
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 @@ +2014-10-31 Stefan Monnier <monnier@iro.umontreal.ca> + + * 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 <eliz@gnu.org> * 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." ;;; 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 @@ If ARG is the atom `-', scroll upward by nearly full screen." 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 |