summaryrefslogtreecommitdiff
path: root/lisp/org/org-table.el
diff options
context:
space:
mode:
authorKyle Meyer <kyle@kyleam.com>2023-01-22 21:53:39 -0500
committerKyle Meyer <kyle@kyleam.com>2023-01-22 21:53:39 -0500
commit647cc9c65e7c2b691267bde7333eff6cc8d9132a (patch)
treef22dae70d8878049b099dcb49d6f3524797282f9 /lisp/org/org-table.el
parentb3814b43f6017d48bde2ddd12821e83948ee19dc (diff)
downloademacs-647cc9c65e7c2b691267bde7333eff6cc8d9132a.tar.gz
Update to Org 9.6.1-16-ge37e9b
Diffstat (limited to 'lisp/org/org-table.el')
-rw-r--r--lisp/org/org-table.el10
1 files changed, 7 insertions, 3 deletions
diff --git a/lisp/org/org-table.el b/lisp/org/org-table.el
index fac9e68c124..5116b1127f7 100644
--- a/lisp/org/org-table.el
+++ b/lisp/org/org-table.el
@@ -1229,7 +1229,7 @@ Return t when the line exists, nil if it does not exist."
(if (looking-at "|[^|\n]+")
(let* ((pos (match-beginning 0))
(match (match-string 0))
- (len (org-string-width match)))
+ (len (save-match-data (org-string-width match))))
(replace-match (concat "|" (make-string (1- len) ?\ )))
(goto-char (+ 2 pos))
(substring match 1)))))
@@ -1725,8 +1725,12 @@ In particular, this does handle wide and invisible characters."
(setq s (mapconcat (lambda (x) (if (member x '(?| ?+)) "|" " ")) s ""))
(while (string-match "|\\([ \t]*?[^ \t\r\n|][^\r\n|]*\\)|" s)
(setq s (replace-match
- (concat "|" (make-string (org-string-width (match-string 1 s))
- ?\ ) "|")
+ (concat "|"
+ (make-string
+ (save-match-data
+ (org-string-width (match-string 1 s)))
+ ?\ )
+ "|")
t t s)))
s))