From mboxrd@z Thu Jan 1 00:00:00 1970 Path: main.gmane.org!not-for-mail From: kgold@watson.ibm.com (kgold) Newsgroups: gmane.emacs.help Subject: Re: Inserting standard blocks of text. Date: 28 Apr 2003 20:24:08 GMT Organization: IBM T.J. Watson Research Center Sender: help-gnu-emacs-bounces+gnu-help-gnu-emacs=m.gmane.org@gnu.org Message-ID: References: NNTP-Posting-Host: main.gmane.org X-Trace: main.gmane.org 1051562316 3654 80.91.224.249 (28 Apr 2003 20:38:36 GMT) X-Complaints-To: usenet@main.gmane.org NNTP-Posting-Date: Mon, 28 Apr 2003 20:38:36 +0000 (UTC) Original-X-From: help-gnu-emacs-bounces+gnu-help-gnu-emacs=m.gmane.org@gnu.org Mon Apr 28 22:38:34 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 19AFOU-0000we-00 for ; Mon, 28 Apr 2003 22:38:34 +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 19AFLW-0001O9-0A for gnu-help-gnu-emacs@m.gmane.org; Mon, 28 Apr 2003 16:35:30 -0400 Original-Path: shelby.stanford.edu!newsfeed.stanford.edu!news-spur1.maxwell.syr.edu!news.maxwell.syr.edu!news-out.visi.com!petbe.visi.com!nntp1.roc.gblx.net!nntp.gblx.net!nntp.gblx.net!newsfeed.cs.utexas.edu!geraldo.cc.utexas.edu!an02.austin.ibm.com!ausnews.austin.ibm.com!newsfeed.btv.ibm.com!news.btv.ibm.com!kgold Original-Newsgroups: gnu.emacs.help Original-Lines: 34 Original-NNTP-Posting-Host: alpha.watson.ibm.com Original-X-Trace: news.btv.ibm.com 1051561448 14180 9.2.16.245 (28 Apr 2003 20:24:08 GMT) Original-X-Complaints-To: news@btv.ibm.com Original-NNTP-Posting-Date: 28 Apr 2003 20:24:08 GMT X-Newsreader: xrn 9.01 Originator: kgold@watson.ibm.com Original-Xref: shelby.stanford.edu gnu.emacs.help:112472 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:8969 X-Report-Spam: http://spam.gmane.org/gmane.emacs.help:8969 (define-key esc-map "K" 'insert-kgold-header) (defun insert-kgold-header () "Insert header at the current cursor position in the current buffer." (interactive) (insert "Your standard header ..." ) (insert "\n") ) If it's a function header, you then most likely want to have another function which cut and pastes the function name and parameters into your header. Bonus: You can insert a file using: C-x i runs the command insert-file so you don't have to do your "open, copy, switch, paste" anyway. "Michael Solem" writes: > 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. > Thanks. -- -- Ken Goldman kgold@watson.ibm.com 914-784-7646