From mboxrd@z Thu Jan 1 00:00:00 1970 Path: main.gmane.org!not-for-mail From: Pascal Bourguignon Newsgroups: gmane.emacs.help Subject: Re: Two questions.... Date: 04 Jun 2003 15:49:37 +0200 Organization: informatimago.com Sender: help-gnu-emacs-bounces+gnu-help-gnu-emacs=m.gmane.org@gnu.org Message-ID: <87u1b6dkb2.fsf@thalassa.informatimago.com> References: <84vfvoubrx.fsf@lucy.is.informatik.uni-duisburg.de> <8an0h0rvea.fsf@sm.intel.com> <1a61f7e5.0306030505.3a07617b@posting.google.com> NNTP-Posting-Host: main.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Trace: main.gmane.org 1054735197 26508 80.91.224.249 (4 Jun 2003 13:59:57 GMT) X-Complaints-To: usenet@main.gmane.org NNTP-Posting-Date: Wed, 4 Jun 2003 13:59:57 +0000 (UTC) Original-X-From: help-gnu-emacs-bounces+gnu-help-gnu-emacs=m.gmane.org@gnu.org Wed Jun 04 15:59:50 2003 Return-path: Original-Received: from monty-python.gnu.org ([199.232.76.173]) by main.gmane.org with esmtp (Exim 3.35 #1 (Debian)) id 19NYnu-0006sq-00 for ; Wed, 04 Jun 2003 15:59:50 +0200 Original-Received: from localhost ([127.0.0.1] helo=monty-python.gnu.org) by monty-python.gnu.org with esmtp (Exim 4.20) id 19NYgO-0004yS-OG for gnu-help-gnu-emacs@m.gmane.org; Wed, 04 Jun 2003 09:52:04 -0400 Original-Path: shelby.stanford.edu!newsfeed.stanford.edu!logbridge.uoregon.edu!fu-berlin.de!uni-berlin.de!thalassa.informatimago.COM!not-for-mail Original-Newsgroups: gnu.emacs.help Original-Lines: 32 Original-NNTP-Posting-Host: thalassa.informatimago.com (195.114.85.198) Original-X-Trace: fu-berlin.de 1054734577 10922054 195.114.85.198 (16 [41911]) User-Agent: Gnus/5.09 (Gnus v5.9.0) 21.3.50.pjb1.1 Original-Xref: shelby.stanford.edu gnu.emacs.help:114097 Original-To: help-gnu-emacs@gnu.org X-BeenThere: help-gnu-emacs@gnu.org X-Mailman-Version: 2.1b5 Precedence: list List-Id: Users list for the GNU Emacs text editor List-Help: List-Post: List-Subscribe: , List-Archive: List-Unsubscribe: , Errors-To: help-gnu-emacs-bounces+gnu-help-gnu-emacs=m.gmane.org@gnu.org Xref: main.gmane.org gmane.emacs.help:10591 X-Report-Spam: http://spam.gmane.org/gmane.emacs.help:10591 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.