1
Fork 0
mirror of git://git.sv.gnu.org/emacs.git synced 2025-12-13 01:20:28 -08:00
emacs/lisp/progmodes
Alan Mackenzie 94ad13b93c Allow C++ nested brace-list-entries to be better indented.
This fixes bug #24431.  The key change of this bug fix is correctly analyzing
nested brace lists when the opening element stands on the same line as both
its introductory brace and an enclosing parameter list parenthesis.

* list/progmodes/cc-align.el (c-lineup-under-anchor): New line-up function.

* list/progmodes/cc-engine.el (c-looking-at-or-maybe-in-bracelist): Accept the
presence of exactly an identifier between an open parenthesis and an open
brace as evidence of the brace starting a brace list.
(c-looking-at-statement-block): New function, extracted from
c-looking-at-inexpr-block.  Enhance it to analyze inner blocks recursively
when needed.
(c-looking-at-inexpr-block): Extract new function (see above) and call it.
(c-add-stmt-syntax): Enhance, with new &optional parameter, to supply the
prime syntactic symbol with a fixed anchor point.  When this is used, restrict
all added syntactic symbols to those having an anchor point on the same line.
Add, in addition to the current additional symbols, c-brace-list-entry when
needed; use c-looking-at-statement-block to determine the latter.
(c-guess-basic-syntax, CASE 9D): Use c-add-stmt-syntax rather than just
c-add-syntax, to assemble the syntactic context of a 'brace-list-entry, thus
getting, possibly, several accompanying syntactic entries.

* lisp/progmodes/cc-styles.el (c-style-alist, "gnu" style): New entry for
'brace-list-intro, namely c-lineup-arglist-intro-after-paren.

* lisp/progmodes/cc-vars.el (c-offsets-alist): Change the factory default
offset for 'brace-list-entry from 0 to c-lineup-under-anchor.

* doc/misc/cc-mode.texi (Syntactic Symbols): Amend the definition of
brace-list-intro.
(Brace List Symbols): Amend the example to show the new analysis of brace
lists when the first element comes on the same line as the opening brace.
(Misc Line-Up): Document the new line-up function c-lineup-under-anchor.
2017-02-01 20:20:09 +00:00
..
ada-mode.el Update copyright year to 2017 2016-12-31 19:42:26 -08:00
ada-prj.el Avoid add-to-list on local variables 2017-01-04 00:40:45 -05:00
ada-stmt.el Update copyright year to 2017 2016-12-31 19:42:26 -08:00
ada-xref.el Avoid add-to-list on local variables 2017-01-04 00:40:45 -05:00
antlr-mode.el Merge from origin/emacs-25 2017-01-01 01:10:47 -08:00
asm-mode.el Update copyright year to 2017 2016-12-31 19:42:26 -08:00
autoconf.el Update copyright year to 2017 2016-12-31 19:42:26 -08:00
bat-mode.el Update copyright year to 2017 2016-12-31 19:42:26 -08:00
bug-reference.el Update copyright year to 2017 2016-12-31 19:42:26 -08:00
cc-align.el Allow C++ nested brace-list-entries to be better indented. 2017-02-01 20:20:09 +00:00
cc-awk.el Update copyright year to 2017 2016-12-31 19:42:26 -08:00
cc-bytecomp.el Update copyright year to 2017 2016-12-31 19:42:26 -08:00
cc-cmds.el Merge from origin/emacs-25 2017-01-01 01:10:47 -08:00
cc-defs.el Merge from origin/emacs-25 2017-01-01 01:10:47 -08:00
cc-engine.el Allow C++ nested brace-list-entries to be better indented. 2017-02-01 20:20:09 +00:00
cc-fonts.el Merge from origin/emacs-25 2017-01-01 01:10:47 -08:00
cc-guess.el Update copyright year to 2017 2016-12-31 19:42:26 -08:00
cc-langs.el Handle syntactic WS cache properties more accurately at buffer changes. 2017-01-11 18:25:39 +00:00
cc-menus.el Update copyright year to 2017 2016-12-31 19:42:26 -08:00
cc-mode.el Fix low-level handling of (big) C macros. 2017-01-21 15:16:49 +00:00
cc-styles.el Allow C++ nested brace-list-entries to be better indented. 2017-02-01 20:20:09 +00:00
cc-vars.el Allow C++ nested brace-list-entries to be better indented. 2017-02-01 20:20:09 +00:00
cfengine.el Update copyright year to 2017 2016-12-31 19:42:26 -08:00
cmacexp.el Update copyright year to 2017 2016-12-31 19:42:26 -08:00
compile.el Merge from origin/emacs-25 2017-01-01 01:10:47 -08:00
cperl-mode.el Merge from origin/emacs-25 2017-01-01 01:10:47 -08:00
cpp.el Merge from origin/emacs-25 2017-01-01 01:10:47 -08:00
cwarn.el Update copyright year to 2017 2016-12-31 19:42:26 -08:00
dcl-mode.el Update copyright year to 2017 2016-12-31 19:42:26 -08:00
ebnf-abn.el Update copyright year to 2017 2016-12-31 19:42:26 -08:00
ebnf-bnf.el Update copyright year to 2017 2016-12-31 19:42:26 -08:00
ebnf-dtd.el Update copyright year to 2017 2016-12-31 19:42:26 -08:00
ebnf-ebx.el Update copyright year to 2017 2016-12-31 19:42:26 -08:00
ebnf-iso.el Update copyright year to 2017 2016-12-31 19:42:26 -08:00
ebnf-otz.el Update copyright year to 2017 2016-12-31 19:42:26 -08:00
ebnf-yac.el Update copyright year to 2017 2016-12-31 19:42:26 -08:00
ebnf2ps.el Merge from origin/emacs-25 2017-01-01 01:10:47 -08:00
ebrowse.el Update copyright year to 2017 2016-12-31 19:42:26 -08:00
elisp-mode.el Merge from origin/emacs-25 2017-01-01 01:10:47 -08:00
etags.el Merge from origin/emacs-25 2017-01-01 01:10:47 -08:00
executable.el Update copyright year to 2017 2016-12-31 19:42:26 -08:00
f90.el Update copyright year to 2017 2016-12-31 19:42:26 -08:00
flymake.el Merge from origin/emacs-25 2017-01-01 01:10:47 -08:00
fortran.el Update copyright year to 2017 2016-12-31 19:42:26 -08:00
gdb-mi.el Merge from origin/emacs-25 2017-01-01 01:10:47 -08:00
glasses.el Update copyright year to 2017 2016-12-31 19:42:26 -08:00
grep.el Merge from origin/emacs-25 2017-01-01 01:10:47 -08:00
gud.el Merge from origin/emacs-25 2017-01-01 01:10:47 -08:00
hideif.el Merge from origin/emacs-25 2017-01-01 01:10:47 -08:00
hideshow.el lisp/*.el: Fix some warnings 2017-01-29 19:34:35 +01:00
icon.el Update copyright year to 2017 2016-12-31 19:42:26 -08:00
idlw-complete-structtag.el Update copyright year to 2017 2016-12-31 19:42:26 -08:00
idlw-help.el Update copyright year to 2017 2016-12-31 19:42:26 -08:00
idlw-shell.el Avoid add-to-list on local variables 2017-01-04 00:40:45 -05:00
idlw-toolbar.el Update copyright year to 2017 2016-12-31 19:42:26 -08:00
idlwave.el Update copyright year to 2017 2016-12-31 19:42:26 -08:00
inf-lisp.el Update copyright year to 2017 2016-12-31 19:42:26 -08:00
js.el Say JavaScript, not Javascript 2017-01-29 23:01:42 +02:00
ld-script.el Update copyright year to 2017 2016-12-31 19:42:26 -08:00
m4-mode.el Update copyright year to 2017 2016-12-31 19:42:26 -08:00
make-mode.el Merge from origin/emacs-25 2017-01-01 01:10:47 -08:00
mantemp.el Update copyright year to 2017 2016-12-31 19:42:26 -08:00
meta-mode.el Update copyright year to 2017 2016-12-31 19:42:26 -08:00
mixal-mode.el Update copyright year to 2017 2016-12-31 19:42:26 -08:00
modula2.el lisp/net/*.el, lisp/progmodes/*.el: Fix docstring typos. 2014-03-14 01:22:33 +01:00
octave.el Merge from origin/emacs-25 2017-01-01 01:10:47 -08:00
opascal.el Update copyright year to 2017 2016-12-31 19:42:26 -08:00
pascal.el Update copyright year to 2017 2016-12-31 19:42:26 -08:00
perl-mode.el Update copyright year to 2017 2016-12-31 19:42:26 -08:00
prog-mode.el Merge from origin/emacs-25 2017-01-01 01:10:47 -08:00
project.el Update copyright year to 2017 2016-12-31 19:42:26 -08:00
prolog.el Merge from origin/emacs-25 2017-01-01 01:10:47 -08:00
ps-mode.el Merge from origin/emacs-25 2017-01-01 01:10:47 -08:00
python.el python-mode: Fix detection for opening blocks. 2017-01-26 20:14:19 -05:00
ruby-mode.el Merge from origin/emacs-25 2017-01-01 01:10:47 -08:00
scheme.el Merge from origin/emacs-25 2017-01-01 01:10:47 -08:00
sh-script.el Remove sh-mode's skeleton-end-hook 2017-01-01 16:36:22 -05:00
simula.el Update copyright year to 2017 2016-12-31 19:42:26 -08:00
sql.el lisp/*.el: Fix some warnings 2017-01-29 19:34:35 +01:00
subword.el Update copyright year to 2017 2016-12-31 19:42:26 -08:00
tcl.el Update copyright year to 2017 2016-12-31 19:42:26 -08:00
vera-mode.el Update copyright year to 2017 2016-12-31 19:42:26 -08:00
verilog-mode.el Merge from origin/emacs-25 2017-01-01 01:10:47 -08:00
vhdl-mode.el * lisp/progmodes/vhdl-mode.el: Avoid add-to-list on local vars 2017-01-24 11:31:11 -05:00
which-func.el Merge from origin/emacs-25 2017-01-01 01:10:47 -08:00
xref.el Escape dash in xref rgrep regexp 2017-01-29 23:01:42 +02:00
xscheme.el Update copyright year to 2017 2016-12-31 19:42:26 -08:00