all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: Gordon Beaton <n.o.t@for.email>
To: help-gnu-emacs@gnu.org
Subject: Re: a function to enter string
Date: 20 Feb 2007 08:30:19 GMT	[thread overview]
Message-ID: <45dab19b$0$24616$8404b019@news.wineasy.se> (raw)
In-Reply-To: m38xetriyf.fsf@localhost.localdomain

On 20 Feb 2007 07:27:52 +1100, Gary Wessle wrote:
> I have this key macro in my emacs which puts "#include <string>" in
> the first blank line in the buffer, also another key macro which
> puts the string "std::string" at the point.

Not really what you're asking, but I use the autoinsert package for
things like that. Just create a template and it will be loaded
whenever you create new files of the given type.

  (require 'autoinsert)
  (add-hook 'find-file-hooks 'auto-insert)
  (setq auto-insert-directory "~/.emacs.d/insert/")
  (define-auto-insert "\\.sh\\'"  "sh-insert.sh")
  (define-auto-insert "\\.tex\\'"  "tex-insert.tex")
  (define-auto-insert "\\.el\\'"  "el-insert.el")
  (define-auto-insert "\\.c\\'"  "c-insert.c") ;;

With autoinsert you can insert dynamic content as well, for example
when you create a Java file it can insert a correctly named class
declaration based on the filename, and then leave the cursor where you
want to start typing.

/gordon

-- 
[ don't email me support questions or followups ]
g o r d o n  +  n e w s  @  b a l d e r 1 3 . s e

      parent reply	other threads:[~2007-02-20  8:30 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2007-02-19 20:27 a function to enter string Gary Wessle
2007-02-19 23:28 ` Pascal Bourguignon
2007-02-20 16:06   ` Mathias Dahl
2007-02-21 19:12   ` Gary Wessle
2007-02-20  8:30 ` Gordon Beaton [this message]

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

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

  git send-email \
    --in-reply-to='45dab19b$0$24616$8404b019@news.wineasy.se' \
    --to=n.o.t@for.email \
    --cc=help-gnu-emacs@gnu.org \
    /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.
Code repositories for project(s) associated with this external index

	https://git.savannah.gnu.org/cgit/emacs.git
	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.