emacs-diffs
[Top][All Lists]
Advanced

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

master 0b48e2d: Fix infloop in Modula-2 mode


From: Lars Ingebrigtsen
Subject: master 0b48e2d: Fix infloop in Modula-2 mode
Date: Tue, 25 May 2021 00:19:10 -0400 (EDT)

branch: master
commit 0b48e2d258cb3c0ad5d12c5b4aaf9b4b69101763
Author: Gregory Heytings <gregory@heytings.org>
Commit: Lars Ingebrigtsen <larsi@gnus.org>

    Fix infloop in Modula-2 mode
    
    * lisp/progmodes/modula2.el (m2-smie-refine-colon): Stop looping
    when point does not move with forward-sexp (Bug#48011).
---
 lisp/progmodes/modula2.el | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)

diff --git a/lisp/progmodes/modula2.el b/lisp/progmodes/modula2.el
index 2a0374a..a8d644d 100644
--- a/lisp/progmodes/modula2.el
+++ b/lisp/progmodes/modula2.el
@@ -201,7 +201,10 @@
          ((zerop (length tok))
           (let ((forward-sexp-function nil))
             (condition-case nil
-                (forward-sexp -1)
+                (let ((p (point)))
+                  (forward-sexp -1)
+                  (when (= p (point))
+                    (setq res ":")))
               (scan-error (setq res ":")))))
          ((member tok '("|" "OF" "..")) (setq res ":-case"))
          ((member tok '(":" "END" ";" "BEGIN" "VAR" "RECORD" "PROCEDURE"))



reply via email to

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