From 22f4fba8a903874ba63f8f479fa40b1dfe12850f Mon Sep 17 00:00:00 2001 From: Juri Linkov Date: Wed, 10 Jun 2020 02:03:06 +0300 Subject: [PATCH] * lisp/emulation/cua-rect.el (cua--rectangle-region-insert): New function. Add cua--insert-rectangle around region-insert-function (bug#41440). --- lisp/emulation/cua-rect.el | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/lisp/emulation/cua-rect.el b/lisp/emulation/cua-rect.el index e99bb33dfb1..663995a0a11 100644 --- a/lisp/emulation/cua-rect.el +++ b/lisp/emulation/cua-rect.el @@ -1412,7 +1412,7 @@ With prefix arg, indent to that column." (add-function :around region-extract-function #'cua--rectangle-region-extract) (add-function :around region-insert-function - #'cua--insert-rectangle) + #'cua--rectangle-region-insert) (add-function :around redisplay-highlight-region-function #'cua--rectangle-highlight-for-redisplay) @@ -1422,6 +1422,10 @@ With prefix arg, indent to that column." ;; already do it elsewhere. (funcall redisplay-unhighlight-region-function (nth 3 args)))) +(defun cua--rectangle-region-insert (orig &rest args) + (if (not cua--rectangle) (apply orig args) + (funcall #'cua--insert-rectangle (car args)))) + (defun cua--rectangle-region-extract (orig &optional delete) (cond ((not cua--rectangle) -- 2.39.5