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

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

Re: inserting comment headings


From: Patrick Drechsler
Subject: Re: inserting comment headings
Date: Mon, 19 Jan 2004 23:57:25 +0100
User-agent: Gnus/5.110002 (No Gnus v0.2) Emacs/21.3.50 (gnu/linux)

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.

Cheers

Patrick
-- 
The shortest unit of time in the universe is the New York Second,
defined as the period of time between the traffic lights turning green
and the cab behind you honking. -- Terry Pratchett 'Lords and Ladies'


reply via email to

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