help-gnu-emacs
[Top][All Lists]
Advanced

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

Re: command to insert comment in c mode


From: Chmouel Boudjnah
Subject: Re: command to insert comment in c mode
Date: Sun, 05 Jan 2003 02:46:48 +0100
User-agent: Gnus/5.090008 (Oort Gnus v0.08) Emacs/21.2 (i386-msvc-nt5.0.2195)

kani <harazy@telocity.com> writes:

> first of all, execuse the newbie question. is there is a command or to 
> insert a comment block in C mode ? that is, when i press key combination, a 
> /* and */
>  are inserted and cursor left in the middle of comment block.

M-; is the tip to make this automatically[1] set this in your .emacs to
auto-fill automatically the comments (but not the code) :

(defun my-c-mode-hook () 
  (set (make-local-variable 'fill-nobreak-predicate)
           (lambda () (not (eq (get-text-property (point) 'face) 
'font-lock-comment-face))))
)
(add-hook 'c-mode-hook 'my-c-mode-hook)


Footnotes: 
[1]  i guess i got this code from somewhere on
http://www.emacswiki.org/

-- 
Chmouel -- http://www.chmouel.com/


reply via email to

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