[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: How to use c-style to comment a region?

From: William Xue
Subject: Re: How to use c-style to comment a region?
Date: Fri, 11 May 2007 10:04:47 +0800
User-agent: Opera Mail/9.20 (Win32)

On Thu, 10 May 2007 16:50:20 +0800, martin rudalics <address@hidden> 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,

reply via email to

[Prev in Thread] Current Thread [Next in Thread]