Fix another "wrong side of point" error in CC Mode.
commitad68bbd0da4ed90117f09dc2344c0c3d9d728851
authorAlan Mackenzie <acm@muc.de>
Thu, 26 Oct 2017 18:29:39 +0000 (26 18:29 +0000)
committerAlan Mackenzie <acm@muc.de>
Thu, 26 Oct 2017 18:29:39 +0000 (26 18:29 +0000)
tree41327ffea2ac778e885d931a31249948fa7fb2bf
parent646e56e150ca08978d6ce736b12867b4958a0cd8
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.

* lisp/progmodes/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.
lisp/progmodes/cc-fonts.el