aboutsummaryrefslogtreecommitdiffstats
path: root/lisp
diff options
context:
space:
mode:
authorAlan Mackenzie2015-12-28 16:01:05 +0000
committerAlan Mackenzie2015-12-28 16:01:05 +0000
commit326ffcce5fbbb0ca368cfa08a33101dbbcaa2ace (patch)
tree1b86615b5bed5089446aa9c5a8ae0619703aa3b0 /lisp
parent17ab0d10e1db9cc4924ceb778e5c4e6bb9a90c3d (diff)
downloademacs-326ffcce5fbbb0ca368cfa08a33101dbbcaa2ace.tar.gz
emacs-326ffcce5fbbb0ca368cfa08a33101dbbcaa2ace.zip
Allow line comments ending with escaped NL to be continued to the next line.
Use this in C, C++, and Objective C Modes. Fixes bug#22246 * src/syntax.c (comment-end-can-be-escaped): New buffer local variable. (forw-comment, back-comment): On encountering an end of comment character, test whether it is escaped when `comment-end-can-be-escaped' is non-nil. * doc/lispref/syntax.texi (Control Parsing): Describe `comment-end-can-be-escaped'. * etc/NEWS (Lisp Changes): Describe `comment-end-can-be-escaped'. * lisp/progmodes/cc-langs.el: New c-lang-setvar `comment-end-can-be-escaped'.
Diffstat (limited to 'lisp')
-rw-r--r--lisp/progmodes/cc-langs.el8
1 files changed, 8 insertions, 0 deletions
diff --git a/lisp/progmodes/cc-langs.el b/lisp/progmodes/cc-langs.el
index 5b670833d45..1a07c4cd699 100644
--- a/lisp/progmodes/cc-langs.el
+++ b/lisp/progmodes/cc-langs.el
@@ -1433,6 +1433,14 @@ properly."
1433 "\\)\\s *")) 1433 "\\)\\s *"))
1434(c-lang-setvar comment-start-skip (c-lang-const comment-start-skip)) 1434(c-lang-setvar comment-start-skip (c-lang-const comment-start-skip))
1435 1435
1436(c-lang-defconst comment-end-can-be-escaped
1437 "When non-nil, escaped EOLs inside comments are valid.
1438This works in Emacs >= 25.1."
1439 t nil
1440 (c c++ objc) t)
1441(c-lang-setvar comment-end-can-be-escaped
1442 (c-lang-const comment-end-can-be-escaped))
1443
1436(c-lang-defconst c-syntactic-ws-start 1444(c-lang-defconst c-syntactic-ws-start
1437 ;; Regexp matching any sequence that can start syntactic whitespace. 1445 ;; Regexp matching any sequence that can start syntactic whitespace.
1438 ;; The only uncertain case is '#' when there are cpp directives. 1446 ;; The only uncertain case is '#' when there are cpp directives.