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: auto-insert-alist Date: 14 Jul 2004 17:41:09 GMT Organization: IBM T.J. Watson Research Center Sender: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Message-ID: <40f57035_4@news1.prserv.net> References: NNTP-Posting-Host: deer.gmane.org X-Trace: sea.gmane.org 1089826680 20377 80.91.224.253 (14 Jul 2004 17:38:00 GMT) X-Complaints-To: usenet@sea.gmane.org NNTP-Posting-Date: Wed, 14 Jul 2004 17:38:00 +0000 (UTC) Original-X-From: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Wed Jul 14 19:37:44 2004 Return-path: Original-Received: from lists.gnu.org ([199.232.76.165]) by deer.gmane.org with esmtp (Exim 3.35 #1 (Debian)) id 1BknhP-0007Rs-00 for ; Wed, 14 Jul 2004 19:37:43 +0200 Original-Received: from localhost ([127.0.0.1] helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.33) id 1Bknjp-0004Ff-Uy for geh-help-gnu-emacs@m.gmane.org; Wed, 14 Jul 2004 13:40:13 -0400 X-Newsreader: xrn 9.02 Original-Newsgroups: gnu.emacs.help Original-NNTP-Posting-Host: yktgi01e0-s5.watson.ibm.com Original-X-Trace: 14 Jul 2004 17:41:09 GMT, yktgi01e0-s5.watson.ibm.com Original-Lines: 32 Original-X-Complaints-To: abuse@prserv.net Original-Path: shelby.stanford.edu!newsfeed.stanford.edu!news.isc.org!sjc1.usenetserver.com!news.usenetserver.com!border1.nntp.sjc.giganews.com!border2.nntp.sjc.giganews.com!nntp.giganews.com!cyclone-sf.pbi.net!151.164.30.34!cyclone.swbell.net!newsfeed.us.prserv.net!prserv.net!news1.prserv.net!alpha.watson.ibm.com!kgold Original-Xref: shelby.stanford.edu gnu.emacs.help:124298 Original-To: help-gnu-emacs@gnu.org 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: , Errors-To: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Xref: main.gmane.org gmane.emacs.help:19633 X-Report-Spam: http://spam.gmane.org/gmane.emacs.help:19633 drmemory@starband.net (DrMemory) writes: > I am having some trouble with auto-insertion. > > According to the documentation, the "Action" can be a filename, in > which case its contents are to be inserted. However, when I try this, > I get no auto-insertion when I visit a new file: > > (setq auto-insert-alist > (append '(((".*ltr.*\\.tex$" . "Letter") . "~/leg/ltr.tex")) > auto-insert-alist)) > > I changed it to: > > (setq auto-insert-alist > (append '(((".*ltr.*\\.tex$" . "Letter") . > (insert-file-contents "~/leg/ltr.tex"))) > auto-insert-alist)) > > And now I am prompted for autoinsertion, but the result is just to > have the string "~/leg/ltr.tex" inserted in the new file. > > I hope someone can tell me what I am doing wrong... You can try this until you get a real fix: (add-hook 'find-file-hooks 'auto-insert) (setq auto-insert-directory (expand-file-name "~/.autoinsert/")) (setq auto-insert-query nil) (define-auto-insert "\\.c\\'" "autoinsert.c") (define-auto-insert "\\.cpp\\'" "autoinsert.c") (define-auto-insert "\\.java\\'" "autoinsert.java") (define-auto-insert "\\.txt\\'" "autoinsert.txt")