From mboxrd@z Thu Jan 1 00:00:00 1970 Path: main.gmane.org!not-for-mail From: Kevin Dziulko Newsgroups: gmane.emacs.help Subject: Re: Two questions.... Date: Tue, 3 Jun 2003 08:10:47 -0400 (EDT) Sender: help-gnu-emacs-bounces+gnu-help-gnu-emacs=m.gmane.org@gnu.org Message-ID: References: <8an0h0rvea.fsf@sm.intel.com> NNTP-Posting-Host: main.gmane.org Mime-Version: 1.0 Content-Type: TEXT/PLAIN; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable X-Trace: main.gmane.org 1054643709 4895 80.91.224.249 (3 Jun 2003 12:35:09 GMT) X-Complaints-To: usenet@main.gmane.org NNTP-Posting-Date: Tue, 3 Jun 2003 12:35:09 +0000 (UTC) Original-X-From: help-gnu-emacs-bounces+gnu-help-gnu-emacs=m.gmane.org@gnu.org Tue Jun 03 14:35:03 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 19NB0J-0001G7-00 for ; Tue, 03 Jun 2003 14:35:03 +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 19NAps-0001BX-Ek for gnu-help-gnu-emacs@m.gmane.org; Tue, 03 Jun 2003 08:24:16 -0400 Original-Received: from list by monty-python.gnu.org with tmda-scanned (Exim 4.20) id 19NAl4-0008WG-9f for help-gnu-emacs@gnu.org; Tue, 03 Jun 2003 08:19:18 -0400 Original-Received: from mail by monty-python.gnu.org with spam-scanned (Exim 4.20) id 19NAk0-0008LG-9G for help-gnu-emacs@gnu.org; Tue, 03 Jun 2003 08:18:15 -0400 Original-Received: from klaatu.canisius.edu ([138.92.8.100]) by monty-python.gnu.org with esmtp (Exim 4.20) id 19NAcq-0006I5-NW for help-gnu-emacs@gnu.org; Tue, 03 Jun 2003 08:10:48 -0400 Original-Received: from localhost (dziulko@localhost) by klaatu.canisius.edu (8.11.6/8.11.6) with ESMTP id h53CAll11347 for ; Tue, 3 Jun 2003 08:10:47 -0400 Original-To: help-gnu-emacs@gnu.org In-Reply-To: <8an0h0rvea.fsf@sm.intel.com> X-MIME-Autoconverted: from 8bit to quoted-printable by klaatu.canisius.edu id h53CAll11347 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:10526 X-Report-Spam: http://spam.gmane.org/gmane.emacs.help:10526 I do this all the time. I've put some standard company headers into file= s=20 (header.c, header.pl, etc.) and then just use C-x i to insert the file at= =20 the current point. This works well for pre-existing files. You could=20 also record a simple macro and bind it to a key. I also use auto-insert=20 so I can have standard templates for any new *.c or *.pl files I create,=20 which will then automaticlly contain the standard headers. =20 On Mon, 2 Jun 2003, Balaji Venkataraman wrote: > >>>>> "Kai" =3D=3D Kai Gro=DFjohann writes: >=20 > Kai> Urban Gabor writes: >=20 > >> 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 depe= ndig > >> on the programming language (mode) you use. Is there a genereal > >> solution? >=20 > Kai> I hit M-;. (This is new in Emacs 21.) -- This line is not bl= ank. >=20 > 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. >=20 > Meaning if I'm in C mode I want to say "M-x insert-my-header" and it do= es >=20 > // Filename:=20 > // Date started: >=20 > but in Perl mode it does >=20 > # Filename: > # Date started: >=20 > 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! >=20