unofficial mirror of help-gnu-emacs@gnu.org
 help / color / mirror / Atom feed
From: Oliver Lohmann <nagash2270@yahoo.de>
Subject: Re: Inserting standard blocks of text.
Date: Sun, 27 Apr 2003 11:35:09 +0200	[thread overview]
Message-ID: <8545400692.20030427113509@yahoo.de> (raw)
In-Reply-To: <20030426154937.27823.qmail@linuxmail.org>

Hello Mike,

Saturday, April 26, 2003, 5:49:37 PM, you wrote:

> Is there a way to have a block of text that can be pasted in a
> file at any time (something that will not be overwritten when
> you do a Ctrl-k etc...).  I would like to put a standard header in fron
> of all my functions when I'm programming.  It will always be the same.
> It would be nice to not have to open a file, copy the header,
> switch back to the file I'm working on, and then paste it in. 

What's about writing a skeleton combined with an abbrev?
Kind of this (c-style):

(define-skeleton my-comment
  "insert-skeleton for comments"
  >"/*****************************************************" \n
  >"* "(skeleton-read "function title: ") \n
  >"* " \n
  >"* " _ \n
  >"* " \n
  >"* " \n
  >"*****************************************************/"  \n)

  (define-abbrev c-mode-abbrev-table "cmnt" "" 'my-comment)


just put it in your .emacs file and switch to c-mode type
'cmnt' an it will expand. you could also define a keyboard
shortcut for your purpose. feel free to define it for other
abbrev-tables (m-x list-abbrevs).

i think this solution is more comfortable and flexible as the
insert-file.


-- 
Best regards,
 Oliver Lohmann
____________   ______
\   \~~~\   \  \    /   Fachhochschule Wedel
 \   \   \   \  \  /   Feldstrasse 143
  \   \== \   \==\/   D-22880 Wedel
   \   \   \   \     Fachbereich
    \  /    \  /    Medieninformatik
     \/      \/    http://www.fh-wedel.de/

  parent reply	other threads:[~2003-04-27  9:35 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2003-04-26 15:49 Inserting standard blocks of text Michael Solem
2003-04-26 22:49 ` Leandro Guimarães Faria Corsetti Dutra
2003-04-27  9:35 ` Oliver Lohmann [this message]
     [not found] <mailman.5231.1051372238.21513.help-gnu-emacs@gnu.org>
2003-04-28 14:47 ` jason haslup
2003-04-28 20:24 ` kgold

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=8545400692.20030427113509@yahoo.de \
    --to=nagash2270@yahoo.de \
    /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).