* Automatically set the comment style to what we use
@ 2017-06-16 13:39 Eli Zaretskii
2017-06-22 9:45 ` Yao Qi
0 siblings, 1 reply; 6+ messages in thread
From: Eli Zaretskii @ 2017-06-16 13:39 UTC (permalink / raw)
To: gdb-patches
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)))))
)
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: Automatically set the comment style to what we use
2017-06-16 13:39 Automatically set the comment style to what we use Eli Zaretskii
@ 2017-06-22 9:45 ` Yao Qi
2017-06-22 15:03 ` Eli Zaretskii
2017-06-22 15:04 ` Eli Zaretskii
0 siblings, 2 replies; 6+ messages in thread
From: Yao Qi @ 2017-06-22 9:45 UTC (permalink / raw)
To: Eli Zaretskii; +Cc: gdb-patches
On Fri, Jun 16, 2017 at 2:38 PM, Eli Zaretskii <eliz@gnu.org> wrote:
> 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.)
>
Hi Eli,
How does this change affect the people writing code
using new emacs? I still manually type comment
starting and ending sequences every day.
--
Yao (齐尧)
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: Automatically set the comment style to what we use
2017-06-22 9:45 ` Yao Qi
@ 2017-06-22 15:03 ` Eli Zaretskii
2017-06-22 15:04 ` Eli Zaretskii
1 sibling, 0 replies; 6+ messages in thread
From: Eli Zaretskii @ 2017-06-22 15:03 UTC (permalink / raw)
To: Yao Qi; +Cc: gdb-patches
> From: Yao Qi <qiyaoltc@gmail.com>
> Date: Thu, 22 Jun 2017 10:45:45 +0100
> Cc: "gdb-patches@sourceware.org" <gdb-patches@sourceware.org>
>
> On Fri, Jun 16, 2017 at 2:38 PM, Eli Zaretskii <eliz@gnu.org> wrote:
> > 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.)
>
> How does this change affect the people writing code
> using new emacs? I still manually type comment
> starting and ending sequences every day.
Emacs has a command to open a comment: 'M-;' (without the quotes).
When you type this in C mode, Emacs inserts "/* */" and puts the
cursor inside the comment, so you could type the text. In C++ mode,
'M-;' inserts "// " and puts the cursor after it. With the above new
feature, you can now get "/* */" in C++ mode if you toggle the style.
Does that answer your question? (I've stopped typing the comment
starting and ending sequences long ago, I always use 'M-;'.)
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: Automatically set the comment style to what we use
2017-06-22 9:45 ` Yao Qi
2017-06-22 15:03 ` Eli Zaretskii
@ 2017-06-22 15:04 ` Eli Zaretskii
2017-06-22 15:14 ` Yao Qi
1 sibling, 1 reply; 6+ messages in thread
From: Eli Zaretskii @ 2017-06-22 15:04 UTC (permalink / raw)
To: Yao Qi; +Cc: gdb-patches
And btw, what about the patch I suggested? Is it OK to push it?
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: Automatically set the comment style to what we use
2017-06-22 15:04 ` Eli Zaretskii
@ 2017-06-22 15:14 ` Yao Qi
2017-07-01 15:49 ` Eli Zaretskii
0 siblings, 1 reply; 6+ messages in thread
From: Yao Qi @ 2017-06-22 15:14 UTC (permalink / raw)
To: Eli Zaretskii; +Cc: gdb-patches
On Thu, Jun 22, 2017 at 4:04 PM, Eli Zaretskii <eliz@gnu.org> wrote:
> And btw, what about the patch I suggested? Is it OK to push it?
Yes, please.
--
Yao (齐尧)
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: Automatically set the comment style to what we use
2017-06-22 15:14 ` Yao Qi
@ 2017-07-01 15:49 ` Eli Zaretskii
0 siblings, 0 replies; 6+ messages in thread
From: Eli Zaretskii @ 2017-07-01 15:49 UTC (permalink / raw)
To: Yao Qi; +Cc: gdb-patches
> From: Yao Qi <qiyaoltc@gmail.com>
> Date: Thu, 22 Jun 2017 16:14:04 +0100
> Cc: "gdb-patches@sourceware.org" <gdb-patches@sourceware.org>
>
> On Thu, Jun 22, 2017 at 4:04 PM, Eli Zaretskii <eliz@gnu.org> wrote:
> > And btw, what about the patch I suggested? Is it OK to push it?
>
> Yes, please.
Thanks, pushed to master.
^ permalink raw reply [flat|nested] 6+ messages in thread
end of thread, other threads:[~2017-07-01 15:49 UTC | newest]
Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2017-06-16 13:39 Automatically set the comment style to what we use Eli Zaretskii
2017-06-22 9:45 ` Yao Qi
2017-06-22 15:03 ` Eli Zaretskii
2017-06-22 15:04 ` Eli Zaretskii
2017-06-22 15:14 ` Yao Qi
2017-07-01 15:49 ` Eli Zaretskii
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).