1 new commit in cc-mode:
https://bitbucket.org/xemacs/cc-mode/commits/d578a1da1615/
Changeset: d578a1da1615
User: acm
Date: 2017-10-26 18:17:41+00:00
Summary: Fix another "wrong side of point" error in CC Mode.
This fixes (a follow-up to) bug #28850.
A internal generated form for scanning text to fontify had a LIMIT parameter.
It also locally bound LIMIT to a value possibly beyond the original LIMIT,
allowing point to move beyond the original LIMIT, and to create the wrong side
error. Fix it by checking point is not beyond LIMIT in the outer context
before using it.
* cc-fonts.el (c-make-font-lock-search-form): Add a new parameter CHECK-POINT
which, when non-nil, directs the function to generate a check on point.
(c-make-font-lock-context-search-function): Invoke the above function with new
argument value t.
Affected #: 1 file
diff -r 92de7b41bfc97db49178d2f7317ce6583584ed94 -r
d578a1da16151441048b84552790befc5db43f00 cc-fonts.el
--- a/cc-fonts.el
+++ b/cc-fonts.el
@@ -286,12 +286,17 @@
nil)))))
res))))
- (defun c-make-font-lock-search-form (regexp highlights)
+ (defun c-make-font-lock-search-form (regexp highlights &optional check-point)
;; Return a lisp form which will fontify every occurrence of REGEXP
;; (a regular expression, NOT a function) between POINT and `limit'
;; with HIGHLIGHTS, a list of highlighters as specified on page
- ;; "Search-based Fontification" in the elisp manual.
- `(while (re-search-forward ,regexp limit t)
+ ;; "Search-based Fontification" in the elisp manual. If CHECK-POINT
+ ;; is non-nil, we will check (< (point) limit) in the main loop.
+ `(while
+ ,(if check-point
+ `(and (< (point) limit)
+ (re-search-forward ,regexp limit t))
+ `(re-search-forward ,regexp limit t))
(unless (progn
(goto-char (match-beginning 0))
(c-skip-comments-and-strings limit))
@@ -470,7 +475,9 @@
,(c-make-font-lock-search-form
regexp highlights)))))
state-stanzas)
- ,(c-make-font-lock-search-form (car normal) (cdr normal))
+ ;; In the next form, check that point hasn't been moved beyond
+ ;; `limit' in any of the above stanzas.
+ ,(c-make-font-lock-search-form (car normal) (cdr normal) t)
nil))))
(eval-after-load "edebug"
Repository URL:
https://bitbucket.org/xemacs/cc-mode/
--
This is a commit notification from
bitbucket.org. You are receiving
this because you have the service enabled, addressing the recipient of
this email.