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

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

[elpa] externals/org ceb99b8600 1/2: org-table-fix-formulas: Ensure shif


From: ELPA Syncer
Subject: [elpa] externals/org ceb99b8600 1/2: org-table-fix-formulas: Ensure shifting columns after removing invalid
Date: Wed, 5 Oct 2022 01:58:01 -0400 (EDT)

branch: externals/org
commit ceb99b86006f9a10a772860c72dd473cb15a72aa
Author: Ihor Radchenko <yantar92@gmail.com>
Commit: Ihor Radchenko <yantar92@gmail.com>

    org-table-fix-formulas: Ensure shifting columns after removing invalid
    
    * lisp/org-table.el (org-table-fix-formulas): Search from the
    beginning of table formula when shifting moved column numbers.
    
    Reported-by: Uwe Brauer <oub@mat.ucm.es>
    Link: https://orgmode.org/list/87r1gaw0av.fsf@mat.ucm.es
---
 lisp/org-table.el | 15 ++++++++-------
 1 file changed, 8 insertions(+), 7 deletions(-)

diff --git a/lisp/org-table.el b/lisp/org-table.el
index 7903903ddc..50e2bcc136 100644
--- a/lisp/org-table.el
+++ b/lisp/org-table.el
@@ -2270,13 +2270,14 @@ For all numbers larger than LIMIT, shift them by DELTA."
                 (format "@%d\\$[0-9]+=.*?\\(::\\|$\\)" remove))))
            s n a)
        (when remove
-          (while (re-search-forward re2 (line-end-position) t)
-           (unless (save-match-data (org-in-regexp "remote([^)]+?)"))
-             (if (equal (char-before (match-beginning 0)) ?.)
-                 (user-error
-                  "Change makes TBLFM term %s invalid, use undo to recover"
-                  (match-string 0))
-               (replace-match "")))))
+          (save-excursion
+            (while (re-search-forward re2 (line-end-position) t)
+             (unless (save-match-data (org-in-regexp "remote([^)]+?)"))
+               (if (equal (char-before (match-beginning 0)) ?.)
+                   (user-error
+                    "Change makes TBLFM term %s invalid, use undo to recover"
+                    (match-string 0))
+                 (replace-match ""))))))
         (while (re-search-forward re (line-end-position) t)
          (unless (save-match-data (org-in-regexp "remote([^)]+?)"))
            (setq s (match-string 1) n (string-to-number s))



reply via email to

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