[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: Two questions....
From: |
Rob Thorpe |
Subject: |
Re: Two questions.... |
Date: |
3 Jun 2003 06:05:31 -0700 |
Balaji Venkataraman <bvenkata+nospam@sm.intel.com> wrote in message
news:<8an0h0rvea.fsf@sm.intel.com>...
> >>>>> "Kai" == Kai Großjohann <kai.grossjohann@gmx.net> writes:
>
> Kai> Urban Gabor <gabaux@freemail.hu> writes:
>
> >> 2. I generaly do C/C++ and Perl editing with emacs. It would be very
> >> convenient to ha a generic macro, which insert an empty comment in
> >> the code. My problem is, that the formar of the comment is dependig
> >> on the programming language (mode) you use. Is there a genereal
> >> solution?
>
> Kai> I hit M-;. (This is new in Emacs 21.) -- This line is not blank.
>
> If I understand Urban correctly, he wants to insert a new comment block -
> like say some header text - he does not want to know how to (un)comment
> existing lines etc.
>
> Meaning if I'm in C mode I want to say "M-x insert-my-header" and it does
>
> // Filename:
> // Date started:
>
> but in Perl mode it does
>
> # Filename:
> # Date started:
>
> At least that's what I've wished for a while. Thought I'd learn enough elisp
> to write a function to do that. But when is the question!
In any particular mode this is given by the value of comment-start.
(insert comment-start "Filename:" comment-end "\n")
etc
Re: Two questions...., Holger Sparr, 2003/06/02