From mboxrd@z Thu Jan 1 00:00:00 1970 Path: main.gmane.org!not-for-mail From: drmemory@starband.net (DrMemory) Newsgroups: gmane.emacs.help Subject: Re: auto-insert-alist Date: Wed, 14 Jul 2004 19:36:27 GMT Sender: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Message-ID: <%WfJc.12$VQ1.7@fe25.usenetserver.com> References: <40F573E4.4020400@yahoo.com> NNTP-Posting-Host: deer.gmane.org X-Trace: sea.gmane.org 1089833892 8013 80.91.224.253 (14 Jul 2004 19:38:12 GMT) X-Complaints-To: usenet@sea.gmane.org NNTP-Posting-Date: Wed, 14 Jul 2004 19:38:12 +0000 (UTC) Original-X-From: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Wed Jul 14 21: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 1BkpZY-00024u-00 for ; Wed, 14 Jul 2004 21:37:44 +0200 Original-Received: from localhost ([127.0.0.1] helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.33) id 1Bkpby-0003Ii-Nc for geh-help-gnu-emacs@m.gmane.org; Wed, 14 Jul 2004 15:40:14 -0400 Original-Path: shelby.stanford.edu!newsfeed.stanford.edu!newsfeed.news.ucla.edu!canoe.uoregon.edu!arclight.uoregon.edu!wn12feed!worldnet.att.net!63.223.4.70!c01.usenetserver.com!news.usenetserver.com!fe25.usenetserver.com.POSTED!53ab2750!not-for-mail Original-Newsgroups: gnu.emacs.help User-Agent: slrn/0.9.5.7 (UNIX) Original-Lines: 38 Original-X-Complaints-To: abuse@usenetserver.com X-Abuse-Info: Please be sure to forward a copy of ALL headers X-Abuse-Info: Otherwise we will be unable to process your complaint properly. Original-NNTP-Posting-Date: Wed, 14 Jul 2004 15:36:27 EDT Original-Xref: shelby.stanford.edu gnu.emacs.help:124301 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:19636 X-Report-Spam: http://spam.gmane.org/gmane.emacs.help:19636 On Wed, 14 Jul 2004 11:56:52 -0600, Kevin Rodgers wrote: >DrMemory wrote: > > 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... > >Maybe the ~ needs to be explicitly expanded; does this work: > >(setq auto-insert-alist > (cons `((".*ltr.*\\.tex$" . "Letter") . ,(expand-file-name > "~/leg/ltr.tex")) > auto-insert-alist)) > Using expand-file-name does result in being prompted for auto-insertion; however, what gets inserted is again the file-name instead of the contents, just as happened when I tried insert-file-contents! Sigh. I guess I'll have to go back and re-learn how to write a template. This must be an error in the documentation or else I'm just not reading it correctly?