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 /doc/lispref/syntax.texi | |
| 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 'doc/lispref/syntax.texi')
| -rw-r--r-- | doc/lispref/syntax.texi | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/doc/lispref/syntax.texi b/doc/lispref/syntax.texi index 7a984e3d87b..831ebd12f55 100644 --- a/doc/lispref/syntax.texi +++ b/doc/lispref/syntax.texi | |||
| @@ -945,6 +945,14 @@ whitespace by the functions in this section and by @code{forward-sexp}, | |||
| 945 | The behavior of @code{parse-partial-sexp} is also affected by | 945 | The behavior of @code{parse-partial-sexp} is also affected by |
| 946 | @code{parse-sexp-lookup-properties} (@pxref{Syntax Properties}). | 946 | @code{parse-sexp-lookup-properties} (@pxref{Syntax Properties}). |
| 947 | 947 | ||
| 948 | @defvar comment-end-can-be-escaped | ||
| 949 | If this buffer local variable is non-@code{nil}, a single character | ||
| 950 | which usually terminates a comment doesn't do so when that character | ||
| 951 | is escaped. This is used in C and C++ Modes, where line comments | ||
| 952 | starting with @samp{//} can be continued onto the next line by | ||
| 953 | escaping the newline with @samp{\}. | ||
| 954 | @end defvar | ||
| 955 | |||
| 948 | You can use @code{forward-comment} to move forward or backward over | 956 | You can use @code{forward-comment} to move forward or backward over |
| 949 | one comment or several comments. | 957 | one comment or several comments. |
| 950 | 958 | ||