This is the mail archive of the
gdb-patches@sourceware.org
mailing list for the GDB project.
Re: Automatically set the comment style to what we use
- From: Eli Zaretskii <eliz at gnu dot org>
- To: Yao Qi <qiyaoltc at gmail dot com>
- Cc: gdb-patches at sourceware dot org
- Date: Thu, 22 Jun 2017 18:03:33 +0300
- Subject: Re: Automatically set the comment style to what we use
- Authentication-results: sourceware.org; auth=none
- References: <83bmpo128p.fsf@gnu.org> <CAH=s-PMwmTiFXsz6m4fnQfDUK-x0CQgDsn8GTQmGu9xDX3Urgg@mail.gmail.com>
- Reply-to: Eli Zaretskii <eliz at gnu dot org>
> 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-;'.)