unofficial mirror of help-gnu-emacs@gnu.org
 help / color / mirror / Atom feed
From: kgold@watson.ibm.com (kgold)
Subject: Re: auto-insert-alist
Date: 14 Jul 2004 17:41:09 GMT	[thread overview]
Message-ID: <40f57035_4@news1.prserv.net> (raw)
In-Reply-To: FidJc.4$VQ1.2@fe25.usenetserver.com

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")

  reply	other threads:[~2004-07-14 17:41 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2004-07-14 16:36 auto-insert-alist DrMemory
2004-07-14 17:41 ` kgold [this message]
2004-07-14 17:56 ` auto-insert-alist Kevin Rodgers
2004-07-14 19:36   ` auto-insert-alist DrMemory
2004-07-15 15:54     ` auto-insert-alist Kevin Rodgers
2004-07-15 21:39       ` auto-insert-alist DrMemory
2004-07-15 23:38         ` auto-insert-alist Kevin Rodgers
2004-07-16 21:01           ` auto-insert-alist DrMemory
2004-07-16 21:55             ` auto-insert-alist Kevin Rodgers

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://www.gnu.org/software/emacs/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=40f57035_4@news1.prserv.net \
    --to=kgold@watson.ibm.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).