branch: elpa/raku-mode
commit 014a7b44fdd789af0c77bc1cb1e0d23d7b8af0ad
Author: Hinrik Örn Sigurðsson <[email protected]>
Commit: Hinrik Örn Sigurðsson <[email protected]>
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