emacs-elpa-diffs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[elpa] externals/speedrect b101eaea01 48/90: calc-yank: no save-excursio


From: ELPA Syncer
Subject: [elpa] externals/speedrect b101eaea01 48/90: calc-yank: no save-excursion needed
Date: Fri, 6 Dec 2024 18:59:13 -0500 (EST)

branch: externals/speedrect
commit b101eaea0194f0fcb6a07444457de693df62b748
Author: JD Smith <93749+jdtsmith@users.noreply.github.com>
Commit: JD Smith <93749+jdtsmith@users.noreply.github.com>

    calc-yank: no save-excursion needed
---
 speedrect.el | 35 +++++++++++++++++------------------
 1 file changed, 17 insertions(+), 18 deletions(-)

diff --git a/speedrect.el b/speedrect.el
index 046b33a133..2ad67e217c 100644
--- a/speedrect.el
+++ b/speedrect.el
@@ -183,24 +183,23 @@ each side of the inserted text."
             (height (+ (count-lines b e)
                        (if (eq (char-before e) ?\n) 1 0)))
             crect lr)
-       (save-excursion
-         (with-current-buffer buf
-           (let* ((cstart (progn (calc-cursor-stack-index 1)
-                                 (if (and calc-line-numbering (looking-at 
"[0-9]+: "))
-                                     (match-end 0)
-                                   (point))))
-                  (cend (progn (calc-cursor-stack-index 0) (line-end-position 
0))))
-             (setq crect (extract-rectangle cstart cend))))
-         (if (eq (length crect) height)
-             (progn
-               (setq lr (speedrect--lr-space crect))
-               (push nil crect) ; dummy, for consuming in apply-on-rectangle
-               (apply-on-rectangle 'speedrect--replace-with-rect
-                                   start end crect
-                                   (max 0 (1- (car lr)))
-                                   (min 0 (- (1- (cdr lr))))))
-           (user-error "Row count of calc matrix (%d) does not match rectangle 
height (%d)"
-                       (length crect) height))))
+       (with-current-buffer buf
+         (let* ((cstart (progn (calc-cursor-stack-index 1)
+                               (if (and calc-line-numbering (looking-at 
"[0-9]+: "))
+                                   (match-end 0)
+                                 (point))))
+                (cend (progn (calc-cursor-stack-index 0) (line-end-position 
0))))
+           (setq crect (extract-rectangle cstart cend))))
+       (if (eq (length crect) height)
+           (progn
+             (setq lr (speedrect--lr-space crect))
+             (push nil crect) ; dummy, for consuming in apply-on-rectangle
+             (apply-on-rectangle 'speedrect--replace-with-rect
+                                 start end crect
+                                 (max 0 (1- (car lr)))
+                                 (min 0 (- (1- (cdr lr))))))
+         (user-error "Row count of calc matrix (%d) does not match rectangle 
height (%d)"
+                     (length crect) height)))
     (user-error "Calc rectangle yank not possible here")))
 
 (defun speedrect-transient-map-info ()



reply via email to

[Prev in Thread] Current Thread [Next in Thread]