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

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

Re: Two questions....


From: Pascal Bourguignon
Subject: Re: Two questions....
Date: 04 Jun 2003 15:49:37 +0200
User-agent: Gnus/5.09 (Gnus v5.9.0) 21.3.50.pjb1.1

robert.thorpe@antenova.com (Rob Thorpe) writes:
> > 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")

You  may  need  to  use   a  different  table  for  comment-start  and
comment-end.  For  example, in emacs-lisp-mode,  comment-start is ";",
but generally  you want at least  two semi-colon to  avoid sending the
comment on the  right, particularly for such "header"  comment. In the
case of c++-mode, you get "// " but you may prefer "/* "...

But that's the principle.


-- 
__Pascal_Bourguignon__                   http://www.informatimago.com/
----------------------------------------------------------------------
Do not adjust your mind, there is a fault in reality.


reply via email to

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