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

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

Re: inserting comment headings


From: Paolo Gianrossi
Subject: Re: inserting comment headings
Date: Mon, 19 Jan 2004 23:28:44 GMT

On Mon, 19 Jan 2004 23:57:25 +0100
Patrick Drechsler <patrick.drechsler@gmx.net> wrote:

> 
> Kevin Rodgers wrote on 19 Jan 2004 23:38:33 MET:
> 
> > Patrick Drechsler wrote:
> >
> >> Tim X. wrote on 19 Jan 2004 09:35:45 MET:
> 
> [...]
> 
> >> [...M-;, M-j...]
> >> Thanks for the answers, I already use these commands
> >> frequently. But this is not quit what I was looking for.
> >> I wanted to include the `-----------------' stuff after the
> >> comment automatically:
> >> ;;* comment -----------------------------------------------
> >>             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
> >> Any ideas?
> >
> >
> > (defun insert-comment-heading (comment)
> >   "Insert COMMENT, preceded by \";;* \" and followed by \" ---...\"."
> >   (interactive "sComment: ")
> >   (insert ";;* " comment " " (make-string (- (window-width)
> >                                              (+ (length comment) 5)
> >                                              1)
> >                                           ?-))
> >   (newline))
> 
> Cool! Thank you very much Kevin! 
> 
> Now I just have to figure out how to let this function detect the
> mode emacs is in. But I'll go ahead and try that on my own.

don't want to spoil your research :) but you might not need that... each mode 
defines comments... Won't say more if you don't ask, you might be having fun 
with this... 

cheers
paolino


reply via email to

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