aboutsummaryrefslogtreecommitdiffstats
path: root/doc
diff options
context:
space:
mode:
authorAlan Mackenzie2019-04-20 11:30:55 +0000
committerAlan Mackenzie2019-04-20 11:30:55 +0000
commita85befa4aa52033bd6d9927144b358529ec2b360 (patch)
tree2c536fc9d7bd53809984e55b52efb945b8951f36 /doc
parent6f334b6bc0f0c343bbf34c3fee0848aadb5d1d84 (diff)
downloademacs-a85befa4aa52033bd6d9927144b358529ec2b360.tar.gz
emacs-a85befa4aa52033bd6d9927144b358529ec2b360.zip
Fix Pike Mode's autodoc doc comments style's continued lines.
* lisp/progmodes/cc-engine.el (c-forward-sws, c-backward-sws): Recognize matches of c-doc-line-join-re as syntactic whitespace. (c-find-decl-prefix-search): Recognize and move over matches of c-doc-line-join-re as whitespace. (c-find-decl-spots): Before moving backward a char, check (bobp). Before moving forward over a comment, check it isn't possibly a "bright" comment. * lisp/progmodes/cc-fonts.el (c-get-doc-comment-style): New function, extracted from c-compose-keywords-list. (c-compose-keywords-list): Call the above new function. (pike-font-lock-keywords, pike-font-lock-keywords-2) (pike-font-lock-keywords-3): Call c-set-doc-comment-res. (c-doc-line-join-re, c-doc-bright-comment-start-re, c-doc-line-join-end-ch): New variables. (c-set-doc-comment-re-element, c-set-doc-comment-char-list): New macros. (c-set-doc-comment-res): New function. (c-font-lock-doc-comments): For consistency and repeatability, in a sequence of C++ style doc comments, don't fontify the region between BOL and the comment marker. (autodoc-line-join-re, autodoc-bright-comment-start-re) (autodoc-line-join-end-ch): New variables. * lisp/progmodes/cc-mode.el (c-doc-fl-decl-start, c-doc-fl-decl-end): New functions. (c-change-expand-fl-region, c-context-expand-fl-region): Call the above two new functions for extra possibilities for the start and end of a construct. * doc/misc/cc-mode.texi (Doc Comments): Add a sentence drawing attention to the possibility of fontifying constructs within a doc comment.
Diffstat (limited to 'doc')
-rw-r--r--doc/misc/cc-mode.texi5
1 files changed, 4 insertions, 1 deletions
diff --git a/doc/misc/cc-mode.texi b/doc/misc/cc-mode.texi
index f73a7fb57cb..6db2c96f2dc 100644
--- a/doc/misc/cc-mode.texi
+++ b/doc/misc/cc-mode.texi
@@ -2140,7 +2140,10 @@ with @code{c-doc-comment-style}: Supply a variable or function
2140in @code{c-doc-comment-style}. If it's a variable, it's prepended to 2140in @code{c-doc-comment-style}. If it's a variable, it's prepended to
2141@code{font-lock-keywords}. If it's a function, it's called at mode 2141@code{font-lock-keywords}. If it's a function, it's called at mode
2142initialization and the result is prepended. For an example, see 2142initialization and the result is prepended. For an example, see
2143@code{javadoc-font-lock-keywords} in @file{cc-fonts.el}. 2143@code{javadoc-font-lock-keywords} in @file{cc-fonts.el}. It is even
2144possible, to a limited extent, to fontify constructs inside a doc
2145comment with other faces. For an example, see pike autodoc comment
2146style towards the end of @file{cc-fonts-el}.
2144 2147
2145If you add support for another doc comment style, please consider 2148If you add support for another doc comment style, please consider
2146contributing it: send a note to @email{bug-cc-mode@@gnu.org}. 2149contributing it: send a note to @email{bug-cc-mode@@gnu.org}.