From c1c0a7e1f39fda9f95bb94ecc5f39b189d69a76c Mon Sep 17 00:00:00 2001 From: Andrew Burgess Date: Mon, 17 May 2021 13:09:22 +0100 Subject: [PATCH] gdb: additional settings for emacs in .dir-locals.el Two additional settings for developers who use emacs: 1. Set brace-list-open to 0 for C and C++ modes, this ensures we format things like: enum blah { .... }; Instead of the default for the emacs GNU style: enum blah { ... }; The former seems to be the GDB style. 2. Set sentence-end-double-space to t. This is actually the default value for this setting, but if anyone has customised this to nil in general, then forcing this back to t for GDB files will give a better behaviour for the paragraph filling. gdb/ChangeLog: * .dir-locals.el: Set sentence-end-double-space for all modes, and set brace-list-open to 0 for C and C++ modes. gdbserver/ChangeLog: * .dir-locals.el: Set sentence-end-double-space for all modes, and set brace-list-open to 0 for C and C++ modes. gdbsupport/ChangeLog: * .dir-locals.el: Set sentence-end-double-space for all modes, and set brace-list-open to 0 for C and C++ modes. --- gdb/.dir-locals.el | 5 ++++- gdb/ChangeLog | 5 +++++ gdbserver/.dir-locals.el | 5 ++++- gdbserver/ChangeLog | 5 +++++ gdbsupport/.dir-locals.el | 5 ++++- gdbsupport/ChangeLog | 5 +++++ 6 files changed, 27 insertions(+), 3 deletions(-) diff --git a/gdb/.dir-locals.el b/gdb/.dir-locals.el index 94c07dc6850..16641bb8831 100644 --- a/gdb/.dir-locals.el +++ b/gdb/.dir-locals.el @@ -22,12 +22,14 @@ (tcl-mode . ((tcl-indent-level . 4) (tcl-continued-indent-level . 4) (indent-tabs-mode . t))) - (nil . ((bug-reference-url-format . "http://sourceware.org/bugzilla/show_bug.cgi?id=%s"))) + (nil . ((bug-reference-url-format . "http://sourceware.org/bugzilla/show_bug.cgi?id=%s") + (sentence-end-double-space . t))) (c-mode . ((c-file-style . "GNU") (mode . c++) (indent-tabs-mode . t) (tab-width . 8) (c-basic-offset . 2) + (eval . (c-set-offset 'brace-list-open 0)) (eval . (c-set-offset 'innamespace 0)) )) (c++-mode . ((eval . (when (fboundp 'c-toggle-comment-style) @@ -36,6 +38,7 @@ (tab-width . 8) (c-file-style . "GNU") (c-basic-offset . 2) + (eval . (c-set-offset 'brace-list-open 0)) (eval . (c-set-offset 'innamespace 0)) )) ) diff --git a/gdb/ChangeLog b/gdb/ChangeLog index 4589251f022..7759707ff46 100644 --- a/gdb/ChangeLog +++ b/gdb/ChangeLog @@ -1,3 +1,8 @@ +2021-05-17 Andrew Burgess + + * .dir-locals.el: Set sentence-end-double-space for all modes, and + set brace-list-open to 0 for C and C++ modes. + 2021-05-17 Tom Tromey * dwarf2/loc.c (dwarf2_evaluate_loc_desc::get_frame_base): Throw diff --git a/gdbserver/.dir-locals.el b/gdbserver/.dir-locals.el index 94c07dc6850..16641bb8831 100644 --- a/gdbserver/.dir-locals.el +++ b/gdbserver/.dir-locals.el @@ -22,12 +22,14 @@ (tcl-mode . ((tcl-indent-level . 4) (tcl-continued-indent-level . 4) (indent-tabs-mode . t))) - (nil . ((bug-reference-url-format . "http://sourceware.org/bugzilla/show_bug.cgi?id=%s"))) + (nil . ((bug-reference-url-format . "http://sourceware.org/bugzilla/show_bug.cgi?id=%s") + (sentence-end-double-space . t))) (c-mode . ((c-file-style . "GNU") (mode . c++) (indent-tabs-mode . t) (tab-width . 8) (c-basic-offset . 2) + (eval . (c-set-offset 'brace-list-open 0)) (eval . (c-set-offset 'innamespace 0)) )) (c++-mode . ((eval . (when (fboundp 'c-toggle-comment-style) @@ -36,6 +38,7 @@ (tab-width . 8) (c-file-style . "GNU") (c-basic-offset . 2) + (eval . (c-set-offset 'brace-list-open 0)) (eval . (c-set-offset 'innamespace 0)) )) ) diff --git a/gdbserver/ChangeLog b/gdbserver/ChangeLog index 7e7e3f29980..79c60b09474 100644 --- a/gdbserver/ChangeLog +++ b/gdbserver/ChangeLog @@ -1,3 +1,8 @@ +2021-05-17 Andrew Burgess + + * .dir-locals.el: Set sentence-end-double-space for all modes, and + set brace-list-open to 0 for C and C++ modes. + 2021-05-08 Simon Marchi * linux-low.cc (linux_process_target::wait_for_event_filtered): diff --git a/gdbsupport/.dir-locals.el b/gdbsupport/.dir-locals.el index 94c07dc6850..16641bb8831 100644 --- a/gdbsupport/.dir-locals.el +++ b/gdbsupport/.dir-locals.el @@ -22,12 +22,14 @@ (tcl-mode . ((tcl-indent-level . 4) (tcl-continued-indent-level . 4) (indent-tabs-mode . t))) - (nil . ((bug-reference-url-format . "http://sourceware.org/bugzilla/show_bug.cgi?id=%s"))) + (nil . ((bug-reference-url-format . "http://sourceware.org/bugzilla/show_bug.cgi?id=%s") + (sentence-end-double-space . t))) (c-mode . ((c-file-style . "GNU") (mode . c++) (indent-tabs-mode . t) (tab-width . 8) (c-basic-offset . 2) + (eval . (c-set-offset 'brace-list-open 0)) (eval . (c-set-offset 'innamespace 0)) )) (c++-mode . ((eval . (when (fboundp 'c-toggle-comment-style) @@ -36,6 +38,7 @@ (tab-width . 8) (c-file-style . "GNU") (c-basic-offset . 2) + (eval . (c-set-offset 'brace-list-open 0)) (eval . (c-set-offset 'innamespace 0)) )) ) diff --git a/gdbsupport/ChangeLog b/gdbsupport/ChangeLog index ae27e7502a1..b790a972300 100644 --- a/gdbsupport/ChangeLog +++ b/gdbsupport/ChangeLog @@ -1,3 +1,8 @@ +2021-05-17 Andrew Burgess + + * .dir-locals.el: Set sentence-end-double-space for all modes, and + set brace-list-open to 0 for C and C++ modes. + 2021-05-08 Simon Marchi * Makefile.in: Re-generate. -- 2.30.2