* c-style comments in c++-mode
@ 2007-02-11 10:24 Dale Mellor
0 siblings, 0 replies; 13+ messages in thread
From: Dale Mellor @ 2007-02-11 10:24 UTC (permalink / raw)
To: help-gnu-emacs
What's the quickest way to tell c++-mode to insert c-style comments?
^ permalink raw reply [flat|nested] 13+ messages in thread
* Re: c-style comments in c++-mode
[not found] <mailman.4334.1171189521.2155.help-gnu-emacs@gnu.org>
@ 2007-02-11 10:36 ` Hadron
2007-02-11 13:27 ` Dale Mellor
[not found] ` <mailman.4338.1171200489.2155.help-gnu-emacs@gnu.org>
2007-02-11 21:23 ` Stefan Monnier
1 sibling, 2 replies; 13+ messages in thread
From: Hadron @ 2007-02-11 10:36 UTC (permalink / raw)
To: help-gnu-emacs
Dale Mellor <dale@rdmp.org> writes:
> What's the quickest way to tell c++-mode to insert c-style comments?
M-;
^ permalink raw reply [flat|nested] 13+ messages in thread
* Re: c-style comments in c++-mode
2007-02-11 10:36 ` Hadron
@ 2007-02-11 13:27 ` Dale Mellor
[not found] ` <mailman.4338.1171200489.2155.help-gnu-emacs@gnu.org>
1 sibling, 0 replies; 13+ messages in thread
From: Dale Mellor @ 2007-02-11 13:27 UTC (permalink / raw)
To: Hadron; +Cc: help-gnu-emacs
That doesn't work; it puts C++-style comments in.
On Sun, 2007-02-11 at 11:36 +0100, Hadron wrote:
> Dale Mellor <dale@rdmp.org> writes:
>
> > What's the quickest way to tell c++-mode to insert c-style comments?
>
> M-;
^ permalink raw reply [flat|nested] 13+ messages in thread
* Re: c-style comments in c++-mode
[not found] ` <mailman.4338.1171200489.2155.help-gnu-emacs@gnu.org>
@ 2007-02-11 17:02 ` Stack
2007-02-11 23:15 ` Dale Mellor
0 siblings, 1 reply; 13+ messages in thread
From: Stack @ 2007-02-11 17:02 UTC (permalink / raw)
To: help-gnu-emacs
Dale,
[ top posting fixed ]
Dale Mellor <dale@rdmp.org> writes:
>>> What's the quickest way to tell c++-mode to insert c-style comments?
>> M-;
> That doesn't work; it puts C++-style comments in.
This might help: http://www.phys.ufl.edu/docs/emacs/emacs_285.html
Cheers,
Stack
--
"It's time for the human race to enter the solar system!"
- Dan Quayle, former U.S. Vice President on the concept of a manned
mission to Mars
^ permalink raw reply [flat|nested] 13+ messages in thread
* Re: c-style comments in c++-mode
[not found] <mailman.4334.1171189521.2155.help-gnu-emacs@gnu.org>
2007-02-11 10:36 ` Hadron
@ 2007-02-11 21:23 ` Stefan Monnier
2007-02-11 21:35 ` Ralf Angeli
` (2 more replies)
1 sibling, 3 replies; 13+ messages in thread
From: Stefan Monnier @ 2007-02-11 21:23 UTC (permalink / raw)
To: help-gnu-emacs
> What's the quickest way to tell c++-mode to insert c-style comments?
(add-hook 'c++-mode-hook
(lambda () (setq comment-start "/* ") (setq comment-end " */")))
-- Stefan
^ permalink raw reply [flat|nested] 13+ messages in thread
* Re: c-style comments in c++-mode
2007-02-11 21:23 ` Stefan Monnier
@ 2007-02-11 21:35 ` Ralf Angeli
2007-02-11 23:17 ` Dale Mellor
2007-02-12 16:49 ` Stefan Monnier
2007-02-11 23:16 ` Dale Mellor
2007-02-12 9:18 ` Hadron
2 siblings, 2 replies; 13+ messages in thread
From: Ralf Angeli @ 2007-02-11 21:35 UTC (permalink / raw)
To: help-gnu-emacs
* Stefan Monnier (2007-02-11) writes:
>> What's the quickest way to tell c++-mode to insert c-style comments?
>
> (add-hook 'c++-mode-hook
> (lambda () (setq comment-start "/* ") (setq comment-end " */")))
Or with a CC Mode style ...
--
Ralf
^ permalink raw reply [flat|nested] 13+ messages in thread
* Re: c-style comments in c++-mode
2007-02-11 17:02 ` Stack
@ 2007-02-11 23:15 ` Dale Mellor
0 siblings, 0 replies; 13+ messages in thread
From: Dale Mellor @ 2007-02-11 23:15 UTC (permalink / raw)
To: Stack; +Cc: help-gnu-emacs
On Sun, 2007-02-11 at 17:02 +0000, Stack wrote:
> Dale,
>
> [ top posting fixed ]
>
> Dale Mellor <dale@rdmp.org> writes:
>
> >>> What's the quickest way to tell c++-mode to insert c-style comments?
> >> M-;
> > That doesn't work; it puts C++-style comments in.
>
> This might help: http://www.phys.ufl.edu/docs/emacs/emacs_285.html
No, that doesn't help.
^ permalink raw reply [flat|nested] 13+ messages in thread
* Re: c-style comments in c++-mode
2007-02-11 21:23 ` Stefan Monnier
2007-02-11 21:35 ` Ralf Angeli
@ 2007-02-11 23:16 ` Dale Mellor
2007-02-12 9:18 ` Hadron
2 siblings, 0 replies; 13+ messages in thread
From: Dale Mellor @ 2007-02-11 23:16 UTC (permalink / raw)
To: Stefan Monnier; +Cc: help-gnu-emacs
On Sun, 2007-02-11 at 16:23 -0500, Stefan Monnier wrote:
> > What's the quickest way to tell c++-mode to insert c-style comments?
>
> (add-hook 'c++-mode-hook
> (lambda () (setq comment-start "/* ") (setq comment-end " */")))
Thanks, that's exactly what I needed. Your help is very much
appreciated.
^ permalink raw reply [flat|nested] 13+ messages in thread
* Re: c-style comments in c++-mode
2007-02-11 21:35 ` Ralf Angeli
@ 2007-02-11 23:17 ` Dale Mellor
2007-02-12 16:49 ` Stefan Monnier
1 sibling, 0 replies; 13+ messages in thread
From: Dale Mellor @ 2007-02-11 23:17 UTC (permalink / raw)
To: angeli; +Cc: help-gnu-emacs
On Sun, 2007-02-11 at 22:35 +0100, Ralf Angeli wrote:
> * Stefan Monnier (2007-02-11) writes:
>
> >> What's the quickest way to tell c++-mode to insert c-style comments?
> >
> > (add-hook 'c++-mode-hook
> > (lambda () (setq comment-start "/* ") (setq comment-end " */")))
>
> Or with a CC Mode style ...
I don't understand, what do you mean?
^ permalink raw reply [flat|nested] 13+ messages in thread
* Re: c-style comments in c++-mode
2007-02-11 21:23 ` Stefan Monnier
2007-02-11 21:35 ` Ralf Angeli
2007-02-11 23:16 ` Dale Mellor
@ 2007-02-12 9:18 ` Hadron
2 siblings, 0 replies; 13+ messages in thread
From: Hadron @ 2007-02-12 9:18 UTC (permalink / raw)
To: help-gnu-emacs
Stefan Monnier <monnier@iro.umontreal.ca> writes:
>> What's the quickest way to tell c++-mode to insert c-style comments?
>
> (add-hook 'c++-mode-hook
> (lambda () (setq comment-start "/* ") (setq comment-end " */")))
>
>
> -- Stefan
Does my line
(c-set-style "K&R") ; offset customizations not in my-c-style
accomplish the same thing?
^ permalink raw reply [flat|nested] 13+ messages in thread
* Re: c-style comments in c++-mode
2007-02-11 21:35 ` Ralf Angeli
2007-02-11 23:17 ` Dale Mellor
@ 2007-02-12 16:49 ` Stefan Monnier
2007-02-13 14:28 ` Ankur Jain
1 sibling, 1 reply; 13+ messages in thread
From: Stefan Monnier @ 2007-02-12 16:49 UTC (permalink / raw)
To: help-gnu-emacs
>>> What's the quickest way to tell c++-mode to insert c-style comments?
>> (add-hook 'c++-mode-hook
>> (lambda () (setq comment-start "/* ") (setq comment-end " */")))
> Or with a CC Mode style ...
Probably, but I use too many major modes to be bothered to learn each and
every one's new idiosyncratic way to configure it. Especially since Emacs
provides perfectly good generic ways to do that.
Stefan
^ permalink raw reply [flat|nested] 13+ messages in thread
* Re: c-style comments in c++-mode
2007-02-12 16:49 ` Stefan Monnier
@ 2007-02-13 14:28 ` Ankur Jain
2007-02-13 15:11 ` Stefan Monnier
0 siblings, 1 reply; 13+ messages in thread
From: Ankur Jain @ 2007-02-13 14:28 UTC (permalink / raw)
To: Stefan Monnier; +Cc: help-gnu-emacs
[-- Attachment #1.1: Type: text/plain, Size: 949 bytes --]
Can we use both style of comments, somehow.
I mean, instead of replacing c++ mode comments completely, can we assign
keyboard shortcut for inserting c mode style comments? Or may be some other
better method to use both styles.
On 2/12/07, Stefan Monnier <monnier@iro.umontreal.ca> wrote:
>
> >>> What's the quickest way to tell c++-mode to insert c-style comments?
> >> (add-hook 'c++-mode-hook
> >> (lambda () (setq comment-start "/* ") (setq comment-end "
> */")))
> > Or with a CC Mode style ...
>
> Probably, but I use too many major modes to be bothered to learn each and
> every one's new idiosyncratic way to configure it. Especially since Emacs
> provides perfectly good generic ways to do that.
>
>
> Stefan
> _______________________________________________
> help-gnu-emacs mailing list
> help-gnu-emacs@gnu.org
> http://lists.gnu.org/mailman/listinfo/help-gnu-emacs
>
--
Regards
Ankur Jain
http://ankurjain.org
[-- Attachment #1.2: Type: text/html, Size: 1586 bytes --]
[-- Attachment #2: Type: text/plain, Size: 152 bytes --]
_______________________________________________
help-gnu-emacs mailing list
help-gnu-emacs@gnu.org
http://lists.gnu.org/mailman/listinfo/help-gnu-emacs
^ permalink raw reply [flat|nested] 13+ messages in thread
* Re: c-style comments in c++-mode
2007-02-13 14:28 ` Ankur Jain
@ 2007-02-13 15:11 ` Stefan Monnier
0 siblings, 0 replies; 13+ messages in thread
From: Stefan Monnier @ 2007-02-13 15:11 UTC (permalink / raw)
To: Ankur Jain; +Cc: help-gnu-emacs
> Can we use both style of comments, somehow.
Of course. You can always insert the other style by hand, for example.
> I mean, instead of replacing c++ mode comments completely, can we assign
> keyboard shortcut for inserting c mode style comments? Or may be some other
> better method to use both styles.
Sure. Coding it is trivial. The difficult aspect is to find a convenient
user interface for it. The difficulty is that it should be more convenient
than doing the edit by hand, which is often pretty simple to do.
Maybe a good feature would be a toggling function that changes the style of
the comment-around-point. That would be a bit less trivial to code.
Stefan
> On 2/12/07, Stefan Monnier <monnier@iro.umontreal.ca> wrote:
>>
>> >>> What's the quickest way to tell c++-mode to insert c-style comments?
>> >> (add-hook 'c++-mode-hook
>> >> (lambda () (setq comment-start "/* ") (setq comment-end "
>> */")))
>> > Or with a CC Mode style ...
>>
>> Probably, but I use too many major modes to be bothered to learn each and
>> every one's new idiosyncratic way to configure it. Especially since Emacs
>> provides perfectly good generic ways to do that.
>>
>>
>> Stefan
>> _______________________________________________
>> help-gnu-emacs mailing list
>> help-gnu-emacs@gnu.org
>> http://lists.gnu.org/mailman/listinfo/help-gnu-emacs
>>
> --
> Regards
> Ankur Jain
> http://ankurjain.org
^ permalink raw reply [flat|nested] 13+ messages in thread
end of thread, other threads:[~2007-02-13 15:11 UTC | newest]
Thread overview: 13+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2007-02-11 10:24 c-style comments in c++-mode Dale Mellor
[not found] <mailman.4334.1171189521.2155.help-gnu-emacs@gnu.org>
2007-02-11 10:36 ` Hadron
2007-02-11 13:27 ` Dale Mellor
[not found] ` <mailman.4338.1171200489.2155.help-gnu-emacs@gnu.org>
2007-02-11 17:02 ` Stack
2007-02-11 23:15 ` Dale Mellor
2007-02-11 21:23 ` Stefan Monnier
2007-02-11 21:35 ` Ralf Angeli
2007-02-11 23:17 ` Dale Mellor
2007-02-12 16:49 ` Stefan Monnier
2007-02-13 14:28 ` Ankur Jain
2007-02-13 15:11 ` Stefan Monnier
2007-02-11 23:16 ` Dale Mellor
2007-02-12 9:18 ` Hadron
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).