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

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

[elpa] externals/valign a04e1e7 096/198: * valign.el (valign--beginning-


From: Stefan Monnier
Subject: [elpa] externals/valign a04e1e7 096/198: * valign.el (valign--beginning-of-table): Fix infinite loop.
Date: Tue, 1 Dec 2020 18:19:24 -0500 (EST)

branch: externals/valign
commit a04e1e707d43eeeb184389b057df6740065af9e9
Author: Yuan Fu <casouri@gmail.com>
Commit: Yuan Fu <casouri@gmail.com>

    * valign.el (valign--beginning-of-table): Fix infinite loop.
---
 valign.el | 11 +++++++----
 1 file changed, 7 insertions(+), 4 deletions(-)

diff --git a/valign.el b/valign.el
index 97daf84..76428b8 100644
--- a/valign.el
+++ b/valign.el
@@ -290,10 +290,13 @@ Start from point, stop at LIMIT."
 Assumes point is on a table."
   (beginning-of-line)
   (let ((p (point)))
-    (while (looking-at "[ \t]*|")
-      (setq p (point))
-      (forward-line -1)
-      (beginning-of-line))
+    (catch 'abort
+      (while (looking-at "[ \t]*|")
+        (setq p (point))
+        (if (eq (point) (point-min))
+            (throw 'abort nil))
+        (forward-line -1)
+        (beginning-of-line)))
     (goto-char p)))
 
 (defun valign--end-of-table ()



reply via email to

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