From mboxrd@z Thu Jan 1 00:00:00 1970 Path: main.gmane.org!not-for-mail From: Oliver Lohmann Newsgroups: gmane.emacs.help Subject: Re: Inserting standard blocks of text. Date: Sun, 27 Apr 2003 11:35:09 +0200 Organization: FH-Wedel Sender: help-gnu-emacs-bounces+gnu-help-gnu-emacs=m.gmane.org@gnu.org Message-ID: <8545400692.20030427113509@yahoo.de> References: <20030426154937.27823.qmail@linuxmail.org> Reply-To: Oliver Lohmann NNTP-Posting-Host: main.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit X-Trace: main.gmane.org 1051436089 411 80.91.224.249 (27 Apr 2003 09:34:49 GMT) X-Complaints-To: usenet@main.gmane.org NNTP-Posting-Date: Sun, 27 Apr 2003 09:34:49 +0000 (UTC) Original-X-From: help-gnu-emacs-bounces+gnu-help-gnu-emacs=m.gmane.org@gnu.org Sun Apr 27 11:34:48 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 199iYa-00006O-00 for ; Sun, 27 Apr 2003 11:34:48 +0200 Original-Received: from localhost ([127.0.0.1] helo=monty-python.gnu.org) by monty-python.gnu.org with esmtp (Exim 4.10.13) id 199iYU-0006Mn-09 for gnu-help-gnu-emacs@m.gmane.org; Sun, 27 Apr 2003 05:34:42 -0400 Original-Received: from list by monty-python.gnu.org with tmda-scanned (Exim 4.10.13) id 199iYE-000618-00 for help-gnu-emacs@gnu.org; Sun, 27 Apr 2003 05:34:26 -0400 Original-Received: from mail by monty-python.gnu.org with spam-scanned (Exim 4.10.13) id 199iY8-0005pS-00 for help-gnu-emacs@gnu.org; Sun, 27 Apr 2003 05:34:20 -0400 Original-Received: from smtp014.mail.yahoo.com ([216.136.173.58]) by monty-python.gnu.org with smtp (Exim 4.10.13) id 199iXz-0005Jx-00 for help-gnu-emacs@gnu.org; Sun, 27 Apr 2003 05:34:11 -0400 Original-Received: from pd9514994.dip.t-dialin.net (HELO 127.0.0.1) (nagash2270@217.81.73.148 with plain) by smtp.mail.vip.sc5.yahoo.com with SMTP; 27 Apr 2003 09:34:09 -0000 X-Mailer: The Bat! (v1.61) X-Priority: 3 (Normal) Original-To: help-gnu-emacs@gnu.org In-Reply-To: <20030426154937.27823.qmail@linuxmail.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:8894 X-Report-Spam: http://spam.gmane.org/gmane.emacs.help:8894 Hello Mike, Saturday, April 26, 2003, 5:49:37 PM, you wrote: > Is there a way to have a block of text that can be pasted in a > file at any time (something that will not be overwritten when > you do a Ctrl-k etc...). I would like to put a standard header in fron > of all my functions when I'm programming. It will always be the same. > It would be nice to not have to open a file, copy the header, > switch back to the file I'm working on, and then paste it in. What's about writing a skeleton combined with an abbrev? Kind of this (c-style): (define-skeleton my-comment "insert-skeleton for comments" >"/*****************************************************" \n >"* "(skeleton-read "function title: ") \n >"* " \n >"* " _ \n >"* " \n >"* " \n >"*****************************************************/" \n) (define-abbrev c-mode-abbrev-table "cmnt" "" 'my-comment) just put it in your .emacs file and switch to c-mode type 'cmnt' an it will expand. you could also define a keyboard shortcut for your purpose. feel free to define it for other abbrev-tables (m-x list-abbrevs). i think this solution is more comfortable and flexible as the insert-file. -- Best regards, Oliver Lohmann ____________ ______ \ \~~~\ \ \ / Fachhochschule Wedel \ \ \ \ \ / Feldstrasse 143 \ \== \ \==\/ D-22880 Wedel \ \ \ \ Fachbereich \ / \ / Medieninformatik \/ \/ http://www.fh-wedel.de/