Function: define-skeleton
define-skeleton is an autoloaded macro defined in skeleton.el.gz.
Signature
(define-skeleton COMMAND DOCUMENTATION &rest SKELETON)
Documentation
Define a user-configurable COMMAND that enters a statement skeleton.
DOCUMENTATION is that of the command.
SKELETON is as defined under skeleton-insert.
Source Code
;; Defined in /usr/src/emacs/lisp/skeleton.el.gz
;;;###autoload
(defmacro define-skeleton (command documentation &rest skeleton)
"Define a user-configurable COMMAND that enters a statement skeleton.
DOCUMENTATION is that of the command.
SKELETON is as defined under `skeleton-insert'."
(declare (doc-string 2) (debug (&define name stringp skeleton-edebug-spec))
(indent defun))
(if skeleton-debug
(set command skeleton))
`(progn
;; Tell self-insert-command that this function, if called by an
;; abbrev, should cause the self-insert to be skipped.
(put ',command 'no-self-insert t)
(defun ,command (&optional str arg)
,(concat documentation
(if (string-match "\n\\'" documentation)
"" "\n")
"\n"
"This is a skeleton command (see `skeleton-insert').
Normally the skeleton text is inserted at point, with nothing \"inside\".
If there is a highlighted region, the skeleton text is wrapped
around the region text.
A prefix argument ARG says to wrap the skeleton around the next ARG words.
A prefix argument of -1 says to wrap around region, even if not highlighted.
A prefix argument of zero says to wrap around zero words---that is, nothing.
This is a way of overriding the use of a highlighted region.")
(interactive "*P\nP")
(atomic-change-group
(skeleton-proxy-new ',skeleton str arg)))))