unofficial mirror of emacs-devel@gnu.org 
 help / color / mirror / code / Atom feed
From: "William Xue" <william.xue@gmail.com>
To: "martin rudalics" <rudalics@gmx.at>
Cc: emacs-devel@gnu.org
Subject: Re: How to use c-style to comment a region?
Date: Fri, 11 May 2007 10:04:47 +0800	[thread overview]
Message-ID: <op.tr4319tuhkv0w5@williamnb> (raw)
In-Reply-To: <4642DCCC.2020003@gmx.at>

On Thu, 10 May 2007 16:50:20 +0800, martin rudalics <rudalics@gmx.at>  
wrote:

>  > That's not my request, I only want a command or a keybinding.
>
> You could try to bind
>
> (defun my-cpp-comment-region (beg end &optional arg)
>    (interactive "*r\nP")
>    (let ((comment-start "/* ")
> 	(comment-end " */"))
>      (comment-region beg end arg)))
>
> to a key.

I bind it to C-; and it works very well.

Thank you very much!

>
> BTW with comment-styles box / box-multi and newline terminated comment
> syntax `comment-region' comments out the entire text from the beginning
> of the region till EOL.  The attached patch should cure that.



-- 
Sincerely yours,
William

  parent reply	other threads:[~2007-05-11  2:04 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2007-05-10  1:46 How to use c-style to comment a region? William Xue
2007-05-10  8:50 ` martin rudalics
2007-05-10 17:22   ` Stefan Monnier
2007-05-10 21:40     ` martin rudalics
2007-05-11  2:04   ` William Xue [this message]
2007-05-10 21:14 ` Alan Mackenzie
2007-05-11  2:10   ` William Xue

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=op.tr4319tuhkv0w5@williamnb \
    --to=william.xue@gmail.com \
    --cc=emacs-devel@gnu.org \
    --cc=rudalics@gmx.at \
    /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.
Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs.git

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