From: Alan Mackenzie <acm@muc.de>
To: saneman <ddd@sdf.com>
Cc: help-gnu-emacs@gnu.org
Subject: Re: Add functions to C-mode?
Date: Sun, 20 Apr 2008 12:01:15 +0000 [thread overview]
Message-ID: <20080420120115.GB1133@muc.de> (raw)
In-Reply-To: <4809d165$0$90270$14726298@news.sunsite.dk>
Hi, Saneman!
On Sat, Apr 19, 2008 at 01:04:06PM +0200, saneman wrote:
> I would like to add/change the comment/uncomment function in the C-mode
> for emacs.
> Currently it only works when a piece of text is selected and then /* */
> is inserted.
OK, just to check, "it" here means "M-;" (or your newly bound C-d), bound
to `comment-dwim', doesn't it?
I'm not sure about "selected" (I don't use delete-selection-mode and
stuff like that), but the "/* */" style of comments is fixed for C.
Somebody asked some while ago for a way to change this to "//", and I'm
planning to add a command to CC Mode (probably C-c C-;) in the next
release to toggle the commenting style.
> I would like to change the function to just insert // even though some
> text might not be selected.
In the meantime, you could use the following workaround. M-; (or your
C-d ;-) will then insert "// ".
(defun sm-do-line-comments ()
(setq comment-start "// ")
(setq comment-end ""))
(add-hook 'c-mode-hook 'sm-do-line-comments)
> Is that possible?
Hey, what sort of a question is that? This is Emacs. :-)
--
Alan Mackenzie (Nuremberg, Germany).
next prev parent reply other threads:[~2008-04-20 12:01 UTC|newest]
Thread overview: 17+ messages / expand[flat|nested] mbox.gz Atom feed top
2008-04-19 11:04 Add functions to C-mode? saneman
2008-04-19 13:01 ` Ph. Ivaldi
2008-04-19 17:16 ` David Hansen
[not found] ` <mailman.10583.1208625909.18990.help-gnu-emacs@gnu.org>
2008-04-19 21:08 ` Jason Rumney
2008-04-20 7:17 ` David Hansen
2008-04-20 12:26 ` Eli Zaretskii
2008-04-20 12:42 ` David Hansen
2008-04-20 13:51 ` Eli Zaretskii
2008-04-22 9:36 ` David Hansen
[not found] ` <mailman.10609.1208696003.18990.help-gnu-emacs@gnu.org>
2008-04-20 13:28 ` Richard G Riley
2008-04-22 9:39 ` David Hansen
2008-04-20 12:01 ` Alan Mackenzie [this message]
[not found] ` <mailman.10605.1208691810.18990.help-gnu-emacs@gnu.org>
2008-04-21 7:36 ` saneman
2008-04-21 10:51 ` Alan Mackenzie
[not found] ` <mailman.10650.1208777518.18990.help-gnu-emacs@gnu.org>
2008-04-21 11:49 ` Richard G Riley
2008-04-21 20:35 ` Alan Mackenzie
[not found] ` <mailman.10668.1208809134.18990.help-gnu-emacs@gnu.org>
2008-04-22 4:00 ` Richard G Riley
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
List information: https://www.gnu.org/software/emacs/
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20080420120115.GB1133@muc.de \
--to=acm@muc.de \
--cc=ddd@sdf.com \
--cc=help-gnu-emacs@gnu.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
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).