aboutsummaryrefslogtreecommitdiff
path: root/gdb/.dir-locals.el
diff options
context:
space:
mode:
authorAntoine Tremblay <antoine.tremblay@ericsson.com>2016-12-20 08:42:10 -0500
committerAntoine Tremblay <antoine.tremblay@ericsson.com>2016-12-20 08:42:10 -0500
commitff71884063d048e8f8c03de27d2bac343df4f77a (patch)
tree144dc8f8e5bf006e2916b0ccf1cdb1733dc757d3 /gdb/.dir-locals.el
parent11dd08e9a0a2b7115aac32d9599f1bdb0ad12ea6 (diff)
downloadgdb-ff71884063d048e8f8c03de27d2bac343df4f77a.zip
gdb-ff71884063d048e8f8c03de27d2bac343df4f77a.tar.gz
gdb-ff71884063d048e8f8c03de27d2bac343df4f77a.tar.bz2
Set emacs default mode for the GDB directory to C++
Since GDB has switched to C++ but the file names are still .c emacs does not load the proper mode when opening files in the gdb directory. This patch fixes that by enabling c++ mode. This patch also fixes indentation tweaks as discussed in this thread: https://sourceware.org/ml/gdb-patches/2016-12/msg00074.html Indent with gdb-code-style.el included and the .dir-locals.el is as such: namespace TestNameSpace { class test { public: test test() {} int m_a; }; struct teststruct { int a; } } gdb/ChangeLog: * .dir-locals.el: Set c++ mode for the directory and set indent properly. * gdb-code-style.el: Set c-set-offset 'innamespace as a safe value to be used in .dir-locals.el.
Diffstat (limited to 'gdb/.dir-locals.el')
-rw-r--r--gdb/.dir-locals.el7
1 files changed, 6 insertions, 1 deletions
diff --git a/gdb/.dir-locals.el b/gdb/.dir-locals.el
index fbd9309..c32846a 100644
--- a/gdb/.dir-locals.el
+++ b/gdb/.dir-locals.el
@@ -20,5 +20,10 @@
(indent-tabs-mode . t)))
(nil . ((bug-reference-url-format . "http://sourceware.org/bugzilla/show_bug.cgi?id=%s")))
(c-mode . ((c-file-style . "GNU")
- (indent-tabs-mode . t)))
+ (mode . c++)
+ (indent-tabs-mode . t)
+ (tab-width . 8)
+ (c-basic-offset . 2)
+ (eval . (c-set-offset 'innamespace 0))
+ ))
)