]> git.eshelyaron.com Git - emacs.git/commitdiff
* lisp/emulation/cua-rect.el (cua--rectangle-region-insert): New function.
authorJuri Linkov <juri@linkov.net>
Tue, 9 Jun 2020 23:03:06 +0000 (02:03 +0300)
committerJuri Linkov <juri@linkov.net>
Tue, 9 Jun 2020 23:03:06 +0000 (02:03 +0300)
Add cua--insert-rectangle around region-insert-function (bug#41440).

lisp/emulation/cua-rect.el

index e99bb33dfb1e284879030688aa9798741d30d075..663995a0a11072432b26018acd5b4a3255b7ce67 100644 (file)
@@ -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)