mirror of
git://git.sv.gnu.org/emacs.git
synced 2026-02-03 22:20:52 -08:00
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.
This commit is contained in:
parent
a92fa5f193
commit
00a2b82373
3 changed files with 29 additions and 17 deletions
|
|
@ -1,3 +1,10 @@
|
|||
2013-12-08 Stefan Monnier <monnier@iro.umontreal.ca>
|
||||
|
||||
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 <sdl.web@gmail.com>
|
||||
|
||||
* progmodes/flymake.el (flymake, flymake-error-bitmap)
|
||||
|
|
@ -29,8 +36,7 @@
|
|||
|
||||
2013-12-07 Lars Magne Ingebrigtsen <larsi@gnus.org>
|
||||
|
||||
* 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 <michael.albinus@gmx.de>
|
||||
|
||||
|
|
@ -42,8 +48,8 @@
|
|||
|
||||
2013-12-06 Dmitry Gutov <dgutov@yandex.ru>
|
||||
|
||||
* 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 <sdl.web@gmail.com>
|
||||
|
||||
|
|
@ -73,8 +79,8 @@
|
|||
|
||||
2013-12-06 Dmitry Gutov <dgutov@yandex.ru>
|
||||
|
||||
* 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.
|
||||
|
|
|
|||
|
|
@ -78,8 +78,8 @@ any selection."
|
|||
"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 @@ then it takes a second \\[keyboard-quit] to abort the minibuffer."
|
|||
(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)
|
||||
|
|
|
|||
|
|
@ -364,6 +364,7 @@ The Lisp value REGISTER is a character."
|
|||
(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 @@ Interactively, second arg is non-nil if prefix arg is supplied."
|
|||
(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))))
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue