[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Emacs-diffs] master 30b0c5b: Change default offset of CC Mode syntactic
From: |
Alan Mackenzie |
Subject: |
[Emacs-diffs] master 30b0c5b: Change default offset of CC Mode syntactic symbol inlambda to 0 |
Date: |
Sun, 2 Jun 2019 10:08:36 -0400 (EDT) |
branch: master
commit 30b0c5bf42efb27b7afc5a7cf715bae2fe09923c
Author: Alan Mackenzie <address@hidden>
Commit: Alan Mackenzie <address@hidden>
Change default offset of CC Mode syntactic symbol inlambda to 0
It's previous default was c-lineup-inexpr-block. This change is mainly to
prevent excessive indentation of the innards of C++ lambda functions.
* lisp/progmodes/cc-vars.el (c-offsets-alist): Amend the offset for inlambda
to 0.
* doc/misc/cc-mode.texi (FAQ): Amend the answer to the question about this
matter.
---
doc/misc/cc-mode.texi | 12 +++++++-----
lisp/progmodes/cc-vars.el | 2 +-
2 files changed, 8 insertions(+), 6 deletions(-)
diff --git a/doc/misc/cc-mode.texi b/doc/misc/cc-mode.texi
index df6709e..ab1c8e6 100644
--- a/doc/misc/cc-mode.texi
+++ b/doc/misc/cc-mode.texi
@@ -7431,13 +7431,15 @@ could amend your C++ Mode hook like this:
@emph{How do I stop my C++ lambda expressions being indented way over
to the right?}
-Change the offset associated with @code{inlambda} from its default,
-the function @code{c-lineup-inexpr-block}, to 0. For example, if you
-are setting offsets in a hook function you might include the following
-line:
+This is now the default, so you don't need to do anything. To restore
+the previous default, indenting lambda expressions to the right of the
+constructs which introduce them, change the offset associated with
address@hidden from 0 to @code{c-lineup-inexpr-block}. For example,
+if you are setting offsets in a hook function you might include the
+following line:
@example
-(c-set-offset 'inlambda 0)
+(c-set-offset 'inlambda 'c-lineup-inexpr-block)
@end example
For details of the different ways you can make this setting,
diff --git a/lisp/progmodes/cc-vars.el b/lisp/progmodes/cc-vars.el
index b818bce..79bd6a9 100644
--- a/lisp/progmodes/cc-vars.el
+++ b/lisp/progmodes/cc-vars.el
@@ -1210,7 +1210,7 @@ can always override the use of `c-default-style' by
making calls to
(template-args-cont . (c-lineup-template-args +))
;; Anchor pos: Boi at the decl start. This might be changed;
;; the logical position is clearly the opening '<'.
- (inlambda . c-lineup-inexpr-block)
+ (inlambda . 0)
;; Anchor pos: None.
(lambda-intro-cont . +)
;; Anchor pos: Boi at the lambda start.
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- [Emacs-diffs] master 30b0c5b: Change default offset of CC Mode syntactic symbol inlambda to 0,
Alan Mackenzie <=