branch: elpa/raku-mode
commit 98e3cbfabf135de4f31d769b91a39905d073fe3f
Author: Hinrik Örn Sigurðsson <[email protected]>
Commit: Hinrik Örn Sigurðsson <[email protected]>
Always use a limit with `looking-back'
Not doing so causes a warning in Emacs 25.
---
perl6-font-lock.el | 11 ++++++-----
1 file changed, 6 insertions(+), 5 deletions(-)
diff --git a/perl6-font-lock.el b/perl6-font-lock.el
index f9fedbab0d..7a38b0ba77 100644
--- a/perl6-font-lock.el
+++ b/perl6-font-lock.el
@@ -250,18 +250,19 @@ OPEN-ANGLES is the opening delimiter (e.g. \"«\" or
\"<<\")."
(let* ((angle-length (length open-angles))
(open-angle (string-to-char (car (split-string open-angles "" t))))
(close-angle (matching-paren open-angle))
- (quote-beg (- (point) angle-length)))
+ (quote-beg (- (point) angle-length))
+ (line-beg (save-excursion (and (beginning-of-line) (point)))))
(unless (or (looking-at "[-=]")
(looking-back (rx-to-string `(and (char "+~=!")
,open-angle)) 2))
(when (or (or (not (looking-at "[\s\n]"))
(not (looking-back (rx-to-string `(and (char "\s\n")
,open-angle)) 2)))
(looking-at (rx-to-string `(and ,open-angle (1+ (char
"\s\n")) ,close-angle)))
- (looking-back (rx-to-string `(and "=" (1+ space)
,open-angle)))
- (looking-back (rx-to-string `(and "\(" (0+ space)
,open-angle)))
+ (looking-back (rx-to-string `(and "=" (1+ space)
,open-angle)) line-beg)
+ (looking-back (rx-to-string `(and "\(" (0+ space)
,open-angle)) line-beg)
(or (looking-at "\s*$")
- (looking-back (rx-to-string `(and line-start (0+ space)
,open-angle))))
+ (looking-back (rx-to-string `(and line-start (0+ space)
,open-angle)) line-beg))
(looking-back (rx-to-string `(and symbol-start (or "enum"
"for" "any" "all" "none")
- (0+ space) (opt "\)") (0+ space)
,open-angle))))
+ (0+ space) (opt "\)") (0+ space)
,open-angle)) line-beg))
(put-text-property quote-beg (1+ quote-beg)
'syntax-table (string-to-syntax "|"))
(perl6-forward-brackets open-angle close-angle angle-length)