[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: inserting comment headings
From: |
Martin Stemplinger |
Subject: |
Re: inserting comment headings |
Date: |
Tue, 20 Jan 2004 23:59:40 +0100 |
User-agent: |
Gnus/5.1006 (Gnus v5.10.6) Emacs/21.3.50 (gnu/linux) |
On Mon Jan 19 2004 at 18:21, Martin Stemplinger
<mstemplingerNOSPAM@gmx.de> wrote:
> On Mon Jan 19 2004 at 10:04, Patrick Drechsler
> <patrick.drechsler@gmx.net> wrote:
>
>> I wanted to include the `-----------------' stuff after the
>> comment automatically:
>>
>> ;;* comment -----------------------------------------------
>> ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
>>
>> Any ideas?
>>
> You could write a little function that asks for the comment and
> inserts it accordingly.
In the meantime I had some spare time to come up with a solution:
(defun ms-insert-comment-at-line (comment)
"Insert a comment at the beginning of the current line."
(interactive "sComment:")
(forward-line 0)
(insert (comment-padright comment-start comment-add) " ** "
comment " " (make-string (- (window-width)
(+ (length comment) 5)
1)
?-))
(unless (string= "" comment-end)
(insert (comment-padleft comment-end comment-add))))
HTH
Martin
--
Remove NOSPAM to reply by mail
- inserting comment headings, Patrick Drechsler, 2004/01/18
- Re: inserting comment headings, leo, 2004/01/18
- Re: inserting comment headings, Kevin Rodgers, 2004/01/19
- Re: inserting comment headings, Patrick Drechsler, 2004/01/19
- Re: inserting comment headings, Paolo Gianrossi, 2004/01/19
- Re: inserting comment headings, Brad Collins, 2004/01/20
- Message not available
- Re: inserting comment headings, Sean Richards, 2004/01/20
- Re: inserting comment headings, Paolo Gianrossi, 2004/01/20
- Re: inserting comment headings, Patrick Drechsler, 2004/01/20
Re: inserting comment headings, Stefan Monnier, 2004/01/20