help-gnu-emacs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Inserting standard blocks of text.


From: kgold
Subject: Re: Inserting standard blocks of text.
Date: 28 Apr 2003 20:24:08 GMT

(define-key esc-map "K" 'insert-kgold-header)

(defun insert-kgold-header ()
  "Insert header at the current cursor position in the current buffer."
  (interactive)
  (insert 
   "Your standard header ..."
   )
  (insert "\n")
  )

If it's a function header, you then most likely want to have
another function which cut and pastes the function name and parameters into
your header.

Bonus: You can insert a file using:

        C-x i runs the command insert-file

so you don't have to do your "open, copy, switch, paste" anyway.

"Michael Solem" <msolem@linuxmail.org> writes:
> 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.
> Thanks.

-- 
-- 
Ken Goldman   kgold@watson.ibm.com   914-784-7646


reply via email to

[Prev in Thread] Current Thread [Next in Thread]