[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Emacs-diffs] trunk r115415: Make registers and delete-selection-mode wo
From: |
Stefan Monnier |
Subject: |
[Emacs-diffs] trunk r115415: Make registers and delete-selection-mode work on rectangles. |
Date: |
Sun, 08 Dec 2013 04:20:57 +0000 |
User-agent: |
Bazaar (2.6b2) |
------------------------------------------------------------
revno: 115415
revision-id: address@hidden
parent: address@hidden
committer: Stefan Monnier <address@hidden>
branch nick: trunk
timestamp: Sat 2013-12-07 23:20:50 -0500
message:
Make registers and delete-selection-mode work on rectangles.
* lisp/register.el (describe-register-1): Don't modify the register's value.
(copy-to-register): Obey region-extract-function.
* lisp/delsel.el (delete-active-region): Obey region-extract-function.
modified:
lisp/ChangeLog changelog-20091113204419-o5vbwnq5f7feedwu-1432
lisp/delsel.el delsel.el-20091113204419-o5vbwnq5f7feedwu-540
lisp/register.el register.el-20091113204419-o5vbwnq5f7feedwu-104
=== modified file 'lisp/ChangeLog'
--- a/lisp/ChangeLog 2013-12-08 03:35:32 +0000
+++ b/lisp/ChangeLog 2013-12-08 04:20:50 +0000
@@ -1,3 +1,10 @@
+2013-12-08 Stefan Monnier <address@hidden>
+
+ Make registers and delete-selection-mode work on rectangles.
+ * register.el (describe-register-1): Don't modify the register's value.
+ (copy-to-register): Obey region-extract-function.
+ * delsel.el (delete-active-region): Obey region-extract-function.
+
2013-12-08 Leo Liu <address@hidden>
* progmodes/flymake.el (flymake, flymake-error-bitmap)
@@ -29,8 +36,7 @@
2013-12-07 Lars Magne Ingebrigtsen <address@hidden>
- * net/shr.el (shr-tag-img): Don't bug out on <img src="">
- data.
+ * net/shr.el (shr-tag-img): Don't bug out on <img src=""> data.
2013-12-06 Michael Albinus <address@hidden>
@@ -42,8 +48,8 @@
2013-12-06 Dmitry Gutov <address@hidden>
- * progmodes/ruby-mode.el (ruby-syntax-propertize-function): Touch
- up the last change.
+ * progmodes/ruby-mode.el (ruby-syntax-propertize-function):
+ Touch up the last change.
2013-12-06 Leo Liu <address@hidden>
@@ -73,8 +79,8 @@
2013-12-06 Dmitry Gutov <address@hidden>
- * progmodes/octave.el (inferior-octave-completion-table): Turn
- back into function, use `completion-table-with-cache'
+ * progmodes/octave.el (inferior-octave-completion-table):
+ Turn back into function, use `completion-table-with-cache'
(Bug#11906). Update all references.
* minibuffer.el (completion-table-with-cache): New function.
=== modified file 'lisp/delsel.el'
--- a/lisp/delsel.el 2013-10-29 16:11:50 +0000
+++ b/lisp/delsel.el 2013-12-08 04:20:50 +0000
@@ -78,8 +78,8 @@
"Delete the active region.
If KILLP in not-nil, the active region is killed instead of deleted."
(if killp
- (kill-region (point) (mark))
- (delete-region (point) (mark)))
+ (kill-region (point) (mark) t)
+ (funcall region-extract-function 'delete-only))
t)
(defun delete-selection-helper (type)
@@ -197,9 +197,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 self-insert-iso yank clipboard-yank
- insert-register delete-backward-char
backward-delete-char-untabify
- delete-char newline-and-indent newline open-line))
+ (dolist (sym '(self-insert-command yank clipboard-yank
+ insert-register
+ newline-and-indent newline open-line))
(put sym 'delete-selection nil))
;; continue standard unloading
nil)
=== modified file 'lisp/register.el'
--- a/lisp/register.el 2013-10-08 06:02:20 +0000
+++ b/lisp/register.el 2013-12-08 04:20:50 +0000
@@ -364,6 +364,7 @@
(princ (car val))))
((stringp val)
+ (setq val (copy-sequence val))
(if (eq yank-excluded-properties t)
(set-text-properties 0 (length val) nil val)
(remove-list-of-text-properties 0 (length val)
@@ -417,19 +418,24 @@
(error "Register does not contain text"))))
(if (not arg) (exchange-point-and-mark)))
-(defun copy-to-register (register start end &optional delete-flag)
+(defun copy-to-register (register start end &optional delete-flag region)
"Copy region into register REGISTER.
With prefix arg, delete as well.
Called from program, takes four args: REGISTER, START, END and DELETE-FLAG.
-START and END are buffer positions indicating what to copy."
+START and END are buffer positions indicating what to copy.
+The optional argument REGION if non-nil, indicates that we're not just copying
+some text between START and END, but we're copying the region."
(interactive (list (register-read-with-preview "Copy to register: ")
(region-beginning)
(region-end)
- current-prefix-arg))
- (set-register register (filter-buffer-substring start end))
+ current-prefix-arg
+ t))
+ (set-register register (if region
+ (funcall region-extract-function delete-flag)
+ (prog1 (filter-buffer-substring start end)
+ (if delete-flag (delete-region start end)))))
(setq deactivate-mark t)
- (cond (delete-flag
- (delete-region start end))
+ (cond (delete-flag)
((called-interactively-p 'interactive)
(indicate-copied-region))))
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- [Emacs-diffs] trunk r115415: Make registers and delete-selection-mode work on rectangles.,
Stefan Monnier <=