]> git.eshelyaron.com Git - emacs.git/commitdiff
CC Mode: Stop /**/ spuriously fontifying as a doc comment under gtkdoc
authorAlan Mackenzie <acm@muc.de>
Sat, 27 Jul 2019 12:55:53 +0000 (12:55 +0000)
committerAlan Mackenzie <acm@muc.de>
Sat, 27 Jul 2019 12:55:53 +0000 (12:55 +0000)
Also fix infinite loops by correcting two regexps.

* lisp/progmodes/cc-langs.el (c-last-c-comment-end-on-line-re)
(c-last-open-c-comment-start-on-line-re): Correct the regexp fragments
"\\*+[^/]" to "\\*+\\([^*/]\\|$\\)".

* lisp/progmodes/cc-fonts.el (gtkdoc-font-lock-keywords): Disallow /**/ for
doc comment fontification.

lisp/progmodes/cc-fonts.el
lisp/progmodes/cc-langs.el

index d8842c8184f3de738f73e7b00198b538224b422d..f58caf2f1ae0d6e3368eb8a89a4d44a50e10fd63 100644 (file)
@@ -2798,7 +2798,7 @@ need for `pike-font-lock-extra-types'.")
 
 (defconst gtkdoc-font-lock-keywords
   `((,(lambda (limit)
-       (c-font-lock-doc-comments "/\\*\\*\\([^*\n\r].*\\)?$" limit
+       (c-font-lock-doc-comments "/\\*\\*\\([^*/\n\r].*\\)?$" limit
          gtkdoc-font-lock-doc-comments)
        (c-font-lock-doc-comments "/\\*< " limit
          gtkdoc-font-lock-doc-protection)
index 8a4f8f59515d93da637b3f71435ecd620759911a..72c0fdd0d2d6492d47be079f82617b283b0aeeeb 100644 (file)
@@ -1652,7 +1652,7 @@ backslash."
 current line, if any, or nil in those languages without block
 comments.  When a match is found, submatch 1 contains the comment
 ender."
-  t "\\(\\*/\\)\\([^*]\\|\\*+[^/]\\)*$"
+  t "\\(\\*/\\)\\([^*]\\|\\*+\\([^*/]\\|$\\)\\)*$"
   awk nil)
 (c-lang-defvar c-last-c-comment-end-on-line-re
               (c-lang-const c-last-c-comment-end-on-line-re))
@@ -1662,7 +1662,7 @@ ender."
 current ine, if any, or nil in those languages without block
 comments.  When a match is found, submatch 1 contains the comment
 starter."
-  t "\\(/\\*\\)\\([^*]\\|\\*+[^/]\\)*$"
+  t "\\(/\\*\\)\\([^*]\\|\\*+\\([^*/]\\|$\\)\\)*$"
   awk nil)
 (c-lang-defvar c-last-open-c-comment-start-on-line-re
               (c-lang-const c-last-open-c-comment-start-on-line-re))