diff options
| author | Alan Mackenzie <acm@muc.de> | 2019-07-27 12:55:53 +0000 |
|---|---|---|
| committer | Alan Mackenzie <acm@muc.de> | 2019-07-27 12:55:53 +0000 |
| commit | 2f646633e0e29201c8fa0e39f4baec3a14491639 (patch) | |
| tree | e82bc5e2164d640d35c88d4af21026d7a1fc8ce0 /lisp | |
| parent | 1d4355261d2bf8d7244c66e7ce560f2a6fcaa4a7 (diff) | |
| download | emacs-2f646633e0e29201c8fa0e39f4baec3a14491639.tar.gz | |
CC Mode: Stop /**/ spuriously fontifying as a doc comment under gtkdoc
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.
Diffstat (limited to 'lisp')
| -rw-r--r-- | lisp/progmodes/cc-fonts.el | 2 | ||||
| -rw-r--r-- | lisp/progmodes/cc-langs.el | 4 |
2 files changed, 3 insertions, 3 deletions
diff --git a/lisp/progmodes/cc-fonts.el b/lisp/progmodes/cc-fonts.el index d8842c8184f..f58caf2f1ae 100644 --- a/lisp/progmodes/cc-fonts.el +++ b/lisp/progmodes/cc-fonts.el @@ -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) diff --git a/lisp/progmodes/cc-langs.el b/lisp/progmodes/cc-langs.el index 8a4f8f59515..72c0fdd0d2d 100644 --- a/lisp/progmodes/cc-langs.el +++ b/lisp/progmodes/cc-langs.el @@ -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)) |
