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

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

[nongnu] elpa/raku-mode 1ef289eb4d 012/253: Consider 4096 be eof when lo


From: ELPA Syncer
Subject: [nongnu] elpa/raku-mode 1ef289eb4d 012/253: Consider 4096 be eof when looking for the next line
Date: Sat, 29 Jan 2022 08:28:35 -0500 (EST)

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

    Consider 4096 be eof when looking for the next line
    
    Here I'm also fixing a bug introduced in af61f78 where it would fail to
    skip over whitespace/comments.
---
 perl6-mode.el | 11 ++++++-----
 1 file changed, 6 insertions(+), 5 deletions(-)

diff --git a/perl6-mode.el b/perl6-mode.el
index 9dfe46732c..0580f5c4f2 100644
--- a/perl6-mode.el
+++ b/perl6-mode.el
@@ -73,18 +73,19 @@
     (and (and (stringp buffer-file-name)
               (string-match "\\.\\(?:t\\|p[lm]\\)\\'" buffer-file-name))
          (let ((keep-going t)
-               (found-perl6 nil))
+               (found-perl6 nil)
+               (max-pos (min 4096 (point-max))))
            (while keep-going
-             (cond ((eq (point) (point-max))
+             (cond ((>= (point) max-pos)
                     (setq keep-going nil))
-                   ((re-search-forward "^ *\\(?:#.*\\)?$" 4096 'noerror)
+                   ((looking-at "^ *\\(?:#.*\\)?$")
                     nil)
-                   ((re-search-forward perl6-magic-pattern 4096 'noerror)
+                   ((looking-at perl6-magic-pattern)
                     (setq keep-going nil
                           found-perl6 t))
                    (t
                     (setq keep-going nil)))
-             (search-forward "\n" 4096 'noerror))
+             (beginning-of-line 2))
            found-perl6))))
 
 ;;;###autoload



reply via email to

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