* 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.
+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)
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>
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>
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.
"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)
(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)
(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)
(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))))