diff options
| author | Alan Mackenzie | 2019-07-27 12:55:53 +0000 |
|---|---|---|
| committer | Alan Mackenzie | 2019-07-27 12:55:53 +0000 |
| commit | 2f646633e0e29201c8fa0e39f4baec3a14491639 (patch) | |
| tree | e82bc5e2164d640d35c88d4af21026d7a1fc8ce0 | |
| parent | 1d4355261d2bf8d7244c66e7ce560f2a6fcaa4a7 (diff) | |
| download | emacs-2f646633e0e29201c8fa0e39f4baec3a14491639.tar.gz emacs-2f646633e0e29201c8fa0e39f4baec3a14491639.zip | |
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.
| -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'.") | |||
| 2798 | 2798 | ||
| 2799 | (defconst gtkdoc-font-lock-keywords | 2799 | (defconst gtkdoc-font-lock-keywords |
| 2800 | `((,(lambda (limit) | 2800 | `((,(lambda (limit) |
| 2801 | (c-font-lock-doc-comments "/\\*\\*\\([^*\n\r].*\\)?$" limit | 2801 | (c-font-lock-doc-comments "/\\*\\*\\([^*/\n\r].*\\)?$" limit |
| 2802 | gtkdoc-font-lock-doc-comments) | 2802 | gtkdoc-font-lock-doc-comments) |
| 2803 | (c-font-lock-doc-comments "/\\*< " limit | 2803 | (c-font-lock-doc-comments "/\\*< " limit |
| 2804 | gtkdoc-font-lock-doc-protection) | 2804 | 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." | |||
| 1652 | current line, if any, or nil in those languages without block | 1652 | current line, if any, or nil in those languages without block |
| 1653 | comments. When a match is found, submatch 1 contains the comment | 1653 | comments. When a match is found, submatch 1 contains the comment |
| 1654 | ender." | 1654 | ender." |
| 1655 | t "\\(\\*/\\)\\([^*]\\|\\*+[^/]\\)*$" | 1655 | t "\\(\\*/\\)\\([^*]\\|\\*+\\([^*/]\\|$\\)\\)*$" |
| 1656 | awk nil) | 1656 | awk nil) |
| 1657 | (c-lang-defvar c-last-c-comment-end-on-line-re | 1657 | (c-lang-defvar c-last-c-comment-end-on-line-re |
| 1658 | (c-lang-const c-last-c-comment-end-on-line-re)) | 1658 | (c-lang-const c-last-c-comment-end-on-line-re)) |
| @@ -1662,7 +1662,7 @@ ender." | |||
| 1662 | current ine, if any, or nil in those languages without block | 1662 | current ine, if any, or nil in those languages without block |
| 1663 | comments. When a match is found, submatch 1 contains the comment | 1663 | comments. When a match is found, submatch 1 contains the comment |
| 1664 | starter." | 1664 | starter." |
| 1665 | t "\\(/\\*\\)\\([^*]\\|\\*+[^/]\\)*$" | 1665 | t "\\(/\\*\\)\\([^*]\\|\\*+\\([^*/]\\|$\\)\\)*$" |
| 1666 | awk nil) | 1666 | awk nil) |
| 1667 | (c-lang-defvar c-last-open-c-comment-start-on-line-re | 1667 | (c-lang-defvar c-last-open-c-comment-start-on-line-re |
| 1668 | (c-lang-const c-last-open-c-comment-start-on-line-re)) | 1668 | (c-lang-const c-last-open-c-comment-start-on-line-re)) |