diff options
| author | Alan Mackenzie | 2015-12-28 16:01:05 +0000 |
|---|---|---|
| committer | Alan Mackenzie | 2015-12-28 16:01:05 +0000 |
| commit | 326ffcce5fbbb0ca368cfa08a33101dbbcaa2ace (patch) | |
| tree | 1b86615b5bed5089446aa9c5a8ae0619703aa3b0 /lisp/progmodes | |
| parent | 17ab0d10e1db9cc4924ceb778e5c4e6bb9a90c3d (diff) | |
| download | emacs-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/progmodes')
| -rw-r--r-- | lisp/progmodes/cc-langs.el | 8 |
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. | ||
| 1438 | This 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. |