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

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

[nongnu] elpa/raku-mode 014a7b44fd 010/253: Abort Perl 6 detection if we


From: ELPA Syncer
Subject: [nongnu] elpa/raku-mode 014a7b44fd 010/253: Abort Perl 6 detection if we reach end of file
Date: Sat, 29 Jan 2022 08:28:34 -0500 (EST)

branch: elpa/raku-mode
commit 014a7b44fdd789af0c77bc1cb1e0d23d7b8af0ad
Author: Hinrik Örn Sigurðsson <hinrik.sig@gmail.com>
Commit: Hinrik Örn Sigurðsson <hinrik.sig@gmail.com>

    Abort Perl 6 detection if we reach end of file
    
    This was causing an infinite loop when opening e.g. an empty .pl file.
---
 perl6-mode.el | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/perl6-mode.el b/perl6-mode.el
index 59940e1661..3b9ab84812 100644
--- a/perl6-mode.el
+++ b/perl6-mode.el
@@ -75,7 +75,9 @@
          (let ((keep-going t)
                (found-perl6 nil))
            (while keep-going
-             (cond ((looking-at "^ *\\(?:#.*\\)?$")
+             (cond ((eq (point) (point-max))
+                    (setq keep-going nil))
+                   ((looking-at "^ *\\(?:#.*\\)?$")
                     nil)
                    ((looking-at perl6-magic-pattern)
                     (setq keep-going nil



reply via email to

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