unofficial mirror of help-gnu-emacs@gnu.org
 help / color / mirror / Atom feed
* c++-mode and multiline comments
@ 2009-06-23 16:39 Michal
  2009-06-23 19:06 ` Alan Mackenzie
       [not found] ` <mailman.1161.1245783881.2239.help-gnu-emacs@gnu.org>
  0 siblings, 2 replies; 5+ messages in thread
From: Michal @ 2009-06-23 16:39 UTC (permalink / raw)
  To: help-gnu-emacs


Hallo Group Readers!

pressing M-j in the following position:
int main() {   /*
                * <CURSOR HERE>


makes emacs start new line inented to the comment above and "* " added.

but, when:
int main() {   /*<CURSOR HERE>


and I press M-j, then cursor goes to new line but does not add "* ".
Is it possible to configure multiline comments to do so?

best regards
Michal


^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: c++-mode and multiline comments
  2009-06-23 16:39 c++-mode and multiline comments Michal
@ 2009-06-23 19:06 ` Alan Mackenzie
       [not found] ` <mailman.1161.1245783881.2239.help-gnu-emacs@gnu.org>
  1 sibling, 0 replies; 5+ messages in thread
From: Alan Mackenzie @ 2009-06-23 19:06 UTC (permalink / raw)
  To: Michal; +Cc: help-gnu-emacs

Hi, Michal!

On Tue, Jun 23, 2009 at 06:39:39PM +0200, Michal wrote:

> Hallo Group Readers!

> pressing M-j in the following position:
> int main() {   /*
>                 * <CURSOR HERE>


> makes emacs start new line inented to the comment above and "* " added.

Yes.  It looks at the _second_ line, and copies the "comment prefix" onto
the new line

> but, when:
> int main() {   /*<CURSOR HERE>


> and I press M-j, then cursor goes to new line but does not add "* ".

Yes, because there's no second line to take the comment prefix from.

> Is it possible to configure multiline comments to do so?

Yes.  Set the style variable `c-block-comment-prefix' to "* ".  This
variable is precisely for what you want, and it is documented on page
"Custom Filling and Breaking" of the CC Mode manual (which you surely
have).

For all the fancy ways you can set a style variable, see page "Custom
Filling and Breaking"; if you can't be bothered reading this, the
simplest way to set the variable is to simply set it early on in your
.emacs, say with

    (setq c-block-comment-prefix "* ")

.

All the best!

> best regards
> Michal

-- 
Alan Mackenzie (Nuremberg, Germany).




^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: c++-mode and multiline comments
       [not found] ` <mailman.1161.1245783881.2239.help-gnu-emacs@gnu.org>
@ 2009-06-24 11:35   ` Michal
  2009-06-24 14:37     ` Alan Mackenzie
       [not found]     ` <mailman.1200.1245854178.2239.help-gnu-emacs@gnu.org>
  0 siblings, 2 replies; 5+ messages in thread
From: Michal @ 2009-06-24 11:35 UTC (permalink / raw)
  To: help-gnu-emacs



Hallo Alan!

Thank You for Your answer.
I looked at help to 'c-block-comment-prefix' and it is written there:

  This variable is not used for C++ line
  style comments.

should I worry about it somehow?

best regards,
Michal


^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: c++-mode and multiline comments
  2009-06-24 11:35   ` Michal
@ 2009-06-24 14:37     ` Alan Mackenzie
       [not found]     ` <mailman.1200.1245854178.2239.help-gnu-emacs@gnu.org>
  1 sibling, 0 replies; 5+ messages in thread
From: Alan Mackenzie @ 2009-06-24 14:37 UTC (permalink / raw)
  To: Michal; +Cc: help-gnu-emacs

Hi, Michal!

On Wed, Jun 24, 2009 at 01:35:38PM +0200, Michal wrote:

> Hallo Alan!

> Thank You for Your answer.
> I looked at help to 'c-block-comment-prefix' and it is written there:

>   This variable is not used for C++ line
>   style comments.

> should I worry about it somehow?

No, not at all!  Line comments all start off with "//" and end at EOL, so
there's no need for anything like `c-block-comment-prefix'.

> best regards,
> Michal

-- 
Alan Mackenzie (Nuremberg, Germany).




^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: c++-mode and multiline comments
       [not found]     ` <mailman.1200.1245854178.2239.help-gnu-emacs@gnu.org>
@ 2009-06-24 14:58       ` Michal
  0 siblings, 0 replies; 5+ messages in thread
From: Michal @ 2009-06-24 14:58 UTC (permalink / raw)
  To: help-gnu-emacs

Alan Mackenzie <acm@muc.de> writes:

> No, not at all!  Line comments all start off with "//" and end at EOL, so
> there's no need for anything like `c-block-comment-prefix'.

thank You

best regards,
Michal


^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2009-06-24 14:58 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2009-06-23 16:39 c++-mode and multiline comments Michal
2009-06-23 19:06 ` Alan Mackenzie
     [not found] ` <mailman.1161.1245783881.2239.help-gnu-emacs@gnu.org>
2009-06-24 11:35   ` Michal
2009-06-24 14:37     ` Alan Mackenzie
     [not found]     ` <mailman.1200.1245854178.2239.help-gnu-emacs@gnu.org>
2009-06-24 14:58       ` Michal

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).