Automatically set the comment style to what we use

Eli Zaretskii eliz@gnu.org
Fri Jun 16 13:39:00 GMT 2017


The development version of Emacs has a new feature, whereby one can
toggle the comment style and get the C style in C++ sources, the style
we use.  (I got annoyed by having to manually type the comment
starting and ending sequences, so I asked the CC mode maintainer to
add this, and he just did.)

So what do people think about the following addition to our
.dir-locals.el?  I verified that it's a no-op in versions of Emacs
which don't support this functionality.

diff --git a/gdb/.dir-locals.el b/gdb/.dir-locals.el
index a2aa196..48325b1 100644
--- a/gdb/.dir-locals.el
+++ b/gdb/.dir-locals.el
@@ -26,4 +26,6 @@ (
 	    (c-basic-offset . 2)
 	    (eval . (c-set-offset 'innamespace 0))
 	    ))
+ (c++-mode . ((eval . (when (fboundp 'c-toggle-comment-style)
+			(c-toggle-comment-style 1)))))
 )



More information about the Gdb-patches mailing list