mirror of
https://git.savannah.gnu.org/git/emacs/org-mode.git
synced 2024-11-24 07:20:29 +00:00
orgtbl-gather-send-defs: Fix infinite loop when table is at bob
* lisp/org-table.el (orgtbl-gather-send-defs): Avoid infinite loop when table is at the beginning of buffer. Reported-by: Rustom Mody <rustompmody@gmail.com> Link: https://orgmode.org/list/CAJ+Teoehk30LKVCTwMy0uREBHkNVBvrOLDZYboUQ4wBV6Fnwzw@mail.gmail.com
This commit is contained in:
parent
a0950e9432
commit
84945f9de0
@ -5477,14 +5477,16 @@ a radio table."
|
|||||||
(goto-char (org-table-begin))
|
(goto-char (org-table-begin))
|
||||||
(let (rtn)
|
(let (rtn)
|
||||||
(forward-line -1)
|
(forward-line -1)
|
||||||
(while (looking-at "[ \t]*#\\+ORGTBL[: \t][ \t]*SEND[ \t]+\\([^ \t\r\n]+\\)[ \t]+\\([^ \t\r\n]+\\)\\([ \t]+.*\\)?")
|
(catch :bob
|
||||||
(let ((name (org-no-properties (match-string 1)))
|
(while (looking-at "[ \t]*#\\+ORGTBL[: \t][ \t]*SEND[ \t]+\\([^ \t\r\n]+\\)[ \t]+\\([^ \t\r\n]+\\)\\([ \t]+.*\\)?")
|
||||||
(transform (intern (match-string 2)))
|
(let ((name (org-no-properties (match-string 1)))
|
||||||
(params (if (match-end 3)
|
(transform (intern (match-string 2)))
|
||||||
(read (concat "(" (match-string 3) ")")))))
|
(params (if (match-end 3)
|
||||||
(push (list :name name :transform transform :params params)
|
(read (concat "(" (match-string 3) ")")))))
|
||||||
rtn)
|
(push (list :name name :transform transform :params params)
|
||||||
(forward-line -1)))
|
rtn)
|
||||||
|
(when (bobp) (throw :bob nil))
|
||||||
|
(forward-line -1))))
|
||||||
rtn)))
|
rtn)))
|
||||||
|
|
||||||
(defun orgtbl-send-replace-tbl (name text)
|
(defun orgtbl-send-replace-tbl (name text)
|
||||||
|
Loading…
Reference in New Issue
Block a user