1
Fork 0
mirror of git://git.sv.gnu.org/emacs.git synced 2025-12-15 10:30:25 -08:00

CC Mode: Fix wrong value of comment-start-skip, fixing half of bug #41952

Also add functions to enable correct use of CC Mode's filling functionality
from major modes which don't initialize CC Mode fully.  These modes are
currently js-mode and mhtml-mode.

* lisp/progmodes/cc-langs.el (comment-start-skip): Replace "\\(" by "\\(?:" so
that (match-end 1) isn't falsely taken to be the start of the comment.

* lisp/progmodes/cc-engine.el (c-foreign-truncate-lit-pos-cache)
(c-foreign-init-lit-pos-cache): New functions.
This commit is contained in:
Alan Mackenzie 2020-07-04 11:56:18 +00:00
parent 32b3856f85
commit 697942f9a0
2 changed files with 19 additions and 1 deletions

View file

@ -1769,7 +1769,7 @@ ender."
`comment-start-skip' is initialized from this."
;; Default: Allow the last char of the comment starter(s) to be
;; repeated, then allow any amount of horizontal whitespace.
t (concat "\\("
t (concat "\\(?:"
(c-concat-separated
(mapcar (lambda (cs)
(when cs