From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: james Newsgroups: gmane.emacs.help Subject: Re: Inserting standard text Date: 26 Apr 2007 12:28:36 -0700 Organization: http://groups.google.com Message-ID: <1177615716.041743.18660@r30g2000prh.googlegroups.com> References: <1177579177.662475.118650@n15g2000prd.googlegroups.com> NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1" X-Trace: sea.gmane.org 1177616079 9562 80.91.229.12 (26 Apr 2007 19:34:39 GMT) X-Complaints-To: usenet@sea.gmane.org NNTP-Posting-Date: Thu, 26 Apr 2007 19:34:39 +0000 (UTC) To: help-gnu-emacs@gnu.org Original-X-From: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Thu Apr 26 21:34:37 2007 Return-path: Envelope-to: geh-help-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([199.232.76.165]) by lo.gmane.org with esmtp (Exim 4.50) id 1Hh9jh-00031V-1T for geh-help-gnu-emacs@m.gmane.org; Thu, 26 Apr 2007 21:34:37 +0200 Original-Received: from localhost ([127.0.0.1] helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1Hh9pS-0006lL-8M for geh-help-gnu-emacs@m.gmane.org; Thu, 26 Apr 2007 15:40:34 -0400 Original-Path: shelby.stanford.edu!newshub.stanford.edu!postnews.google.com!r30g2000prh.googlegroups.com!not-for-mail Original-Newsgroups: gnu.emacs.help Original-Lines: 22 Original-NNTP-Posting-Host: 205.175.225.24 Original-X-Trace: posting.google.com 1177615734 19704 127.0.0.1 (26 Apr 2007 19:28:54 GMT) Original-X-Complaints-To: groups-abuse@google.com Original-NNTP-Posting-Date: Thu, 26 Apr 2007 19:28:54 +0000 (UTC) In-Reply-To: <1177579177.662475.118650@n15g2000prd.googlegroups.com> User-Agent: G2/1.0 X-HTTP-UserAgent: Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.8.1.2) Gecko/20070219 Firefox/2.0.0.2,gzip(gfe),gzip(gfe) Complaints-To: groups-abuse@google.com Injection-Info: r30g2000prh.googlegroups.com; posting-host=205.175.225.24; posting-account=QasW5A0AAAAxx4roVdpL6V55nt6Y9qFG Original-Xref: shelby.stanford.edu gnu.emacs.help:147630 X-BeenThere: help-gnu-emacs@gnu.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Users list for the GNU Emacs text editor List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Original-Sender: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Errors-To: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.help:43233 Archived-At: Google Groups has been brutally slow to update, so this may have been answered already by people with real usenet providers. If your needs are as simple as you imply, you could do something like: (add-hook 'c-mode-common-hook '(lambda () (local-set-key (kbd "") '(lambda () (interactive) (insert "#ifdef DEBUG\nprintf(\"TRACE:%s:%d\\n\",__FILE__,__LINE__); \n#endif\n"))))) But for keyboard lightning I prefer msf-abbrev.el, which takes emacs' built in support for abbrevs, and adds tabbing between fields, choice lists, and executing elisp. To do something like the above, you could set it up so that if you type "dx" then a space, it would expand in place to the three lines in the insert statement above. Check out the demo: http://www.bloomington.in.us/~brutt/msf-abbrev.html jk