diff options
| -rw-r--r-- | lisp/ChangeLog | 18 | ||||
| -rw-r--r-- | lisp/delsel.el | 10 | ||||
| -rw-r--r-- | lisp/register.el | 18 |
3 files changed, 29 insertions, 17 deletions
diff --git a/lisp/ChangeLog b/lisp/ChangeLog index c489bd362b1..fafeb959d43 100644 --- a/lisp/ChangeLog +++ b/lisp/ChangeLog | |||
| @@ -1,3 +1,10 @@ | |||
| 1 | 2013-12-08 Stefan Monnier <monnier@iro.umontreal.ca> | ||
| 2 | |||
| 3 | Make registers and delete-selection-mode work on rectangles. | ||
| 4 | * register.el (describe-register-1): Don't modify the register's value. | ||
| 5 | (copy-to-register): Obey region-extract-function. | ||
| 6 | * delsel.el (delete-active-region): Obey region-extract-function. | ||
| 7 | |||
| 1 | 2013-12-08 Leo Liu <sdl.web@gmail.com> | 8 | 2013-12-08 Leo Liu <sdl.web@gmail.com> |
| 2 | 9 | ||
| 3 | * progmodes/flymake.el (flymake, flymake-error-bitmap) | 10 | * progmodes/flymake.el (flymake, flymake-error-bitmap) |
| @@ -29,8 +36,7 @@ | |||
| 29 | 36 | ||
| 30 | 2013-12-07 Lars Magne Ingebrigtsen <larsi@gnus.org> | 37 | 2013-12-07 Lars Magne Ingebrigtsen <larsi@gnus.org> |
| 31 | 38 | ||
| 32 | * net/shr.el (shr-tag-img): Don't bug out on <img src=""> | 39 | * net/shr.el (shr-tag-img): Don't bug out on <img src=""> data. |
| 33 | data. | ||
| 34 | 40 | ||
| 35 | 2013-12-06 Michael Albinus <michael.albinus@gmx.de> | 41 | 2013-12-06 Michael Albinus <michael.albinus@gmx.de> |
| 36 | 42 | ||
| @@ -42,8 +48,8 @@ | |||
| 42 | 48 | ||
| 43 | 2013-12-06 Dmitry Gutov <dgutov@yandex.ru> | 49 | 2013-12-06 Dmitry Gutov <dgutov@yandex.ru> |
| 44 | 50 | ||
| 45 | * progmodes/ruby-mode.el (ruby-syntax-propertize-function): Touch | 51 | * progmodes/ruby-mode.el (ruby-syntax-propertize-function): |
| 46 | up the last change. | 52 | Touch up the last change. |
| 47 | 53 | ||
| 48 | 2013-12-06 Leo Liu <sdl.web@gmail.com> | 54 | 2013-12-06 Leo Liu <sdl.web@gmail.com> |
| 49 | 55 | ||
| @@ -73,8 +79,8 @@ | |||
| 73 | 79 | ||
| 74 | 2013-12-06 Dmitry Gutov <dgutov@yandex.ru> | 80 | 2013-12-06 Dmitry Gutov <dgutov@yandex.ru> |
| 75 | 81 | ||
| 76 | * progmodes/octave.el (inferior-octave-completion-table): Turn | 82 | * progmodes/octave.el (inferior-octave-completion-table): |
| 77 | back into function, use `completion-table-with-cache' | 83 | Turn back into function, use `completion-table-with-cache' |
| 78 | (Bug#11906). Update all references. | 84 | (Bug#11906). Update all references. |
| 79 | 85 | ||
| 80 | * minibuffer.el (completion-table-with-cache): New function. | 86 | * minibuffer.el (completion-table-with-cache): New function. |
diff --git a/lisp/delsel.el b/lisp/delsel.el index 07a7a37db34..3c9a6561cde 100644 --- a/lisp/delsel.el +++ b/lisp/delsel.el | |||
| @@ -78,8 +78,8 @@ any selection." | |||
| 78 | "Delete the active region. | 78 | "Delete the active region. |
| 79 | If KILLP in not-nil, the active region is killed instead of deleted." | 79 | If KILLP in not-nil, the active region is killed instead of deleted." |
| 80 | (if killp | 80 | (if killp |
| 81 | (kill-region (point) (mark)) | 81 | (kill-region (point) (mark) t) |
| 82 | (delete-region (point) (mark))) | 82 | (funcall region-extract-function 'delete-only)) |
| 83 | t) | 83 | t) |
| 84 | 84 | ||
| 85 | (defun delete-selection-helper (type) | 85 | (defun delete-selection-helper (type) |
| @@ -197,9 +197,9 @@ then it takes a second \\[keyboard-quit] to abort the minibuffer." | |||
| 197 | (define-key minibuffer-local-completion-map "\C-g" 'abort-recursive-edit) | 197 | (define-key minibuffer-local-completion-map "\C-g" 'abort-recursive-edit) |
| 198 | (define-key minibuffer-local-must-match-map "\C-g" 'abort-recursive-edit) | 198 | (define-key minibuffer-local-must-match-map "\C-g" 'abort-recursive-edit) |
| 199 | (define-key minibuffer-local-isearch-map "\C-g" 'abort-recursive-edit) | 199 | (define-key minibuffer-local-isearch-map "\C-g" 'abort-recursive-edit) |
| 200 | (dolist (sym '(self-insert-command self-insert-iso yank clipboard-yank | 200 | (dolist (sym '(self-insert-command yank clipboard-yank |
| 201 | insert-register delete-backward-char backward-delete-char-untabify | 201 | insert-register |
| 202 | delete-char newline-and-indent newline open-line)) | 202 | newline-and-indent newline open-line)) |
| 203 | (put sym 'delete-selection nil)) | 203 | (put sym 'delete-selection nil)) |
| 204 | ;; continue standard unloading | 204 | ;; continue standard unloading |
| 205 | nil) | 205 | nil) |
diff --git a/lisp/register.el b/lisp/register.el index 2e22502cfeb..623b1f2c0c8 100644 --- a/lisp/register.el +++ b/lisp/register.el | |||
| @@ -364,6 +364,7 @@ The Lisp value REGISTER is a character." | |||
| 364 | (princ (car val)))) | 364 | (princ (car val)))) |
| 365 | 365 | ||
| 366 | ((stringp val) | 366 | ((stringp val) |
| 367 | (setq val (copy-sequence val)) | ||
| 367 | (if (eq yank-excluded-properties t) | 368 | (if (eq yank-excluded-properties t) |
| 368 | (set-text-properties 0 (length val) nil val) | 369 | (set-text-properties 0 (length val) nil val) |
| 369 | (remove-list-of-text-properties 0 (length val) | 370 | (remove-list-of-text-properties 0 (length val) |
| @@ -417,19 +418,24 @@ Interactively, second arg is non-nil if prefix arg is supplied." | |||
| 417 | (error "Register does not contain text")))) | 418 | (error "Register does not contain text")))) |
| 418 | (if (not arg) (exchange-point-and-mark))) | 419 | (if (not arg) (exchange-point-and-mark))) |
| 419 | 420 | ||
| 420 | (defun copy-to-register (register start end &optional delete-flag) | 421 | (defun copy-to-register (register start end &optional delete-flag region) |
| 421 | "Copy region into register REGISTER. | 422 | "Copy region into register REGISTER. |
| 422 | With prefix arg, delete as well. | 423 | With prefix arg, delete as well. |
| 423 | Called from program, takes four args: REGISTER, START, END and DELETE-FLAG. | 424 | Called from program, takes four args: REGISTER, START, END and DELETE-FLAG. |
| 424 | START and END are buffer positions indicating what to copy." | 425 | START and END are buffer positions indicating what to copy. |
| 426 | The optional argument REGION if non-nil, indicates that we're not just copying | ||
| 427 | some text between START and END, but we're copying the region." | ||
| 425 | (interactive (list (register-read-with-preview "Copy to register: ") | 428 | (interactive (list (register-read-with-preview "Copy to register: ") |
| 426 | (region-beginning) | 429 | (region-beginning) |
| 427 | (region-end) | 430 | (region-end) |
| 428 | current-prefix-arg)) | 431 | current-prefix-arg |
| 429 | (set-register register (filter-buffer-substring start end)) | 432 | t)) |
| 433 | (set-register register (if region | ||
| 434 | (funcall region-extract-function delete-flag) | ||
| 435 | (prog1 (filter-buffer-substring start end) | ||
| 436 | (if delete-flag (delete-region start end))))) | ||
| 430 | (setq deactivate-mark t) | 437 | (setq deactivate-mark t) |
| 431 | (cond (delete-flag | 438 | (cond (delete-flag) |
| 432 | (delete-region start end)) | ||
| 433 | ((called-interactively-p 'interactive) | 439 | ((called-interactively-p 'interactive) |
| 434 | (indicate-copied-region)))) | 440 | (indicate-copied-region)))) |
| 435 | 441 | ||