aboutsummaryrefslogtreecommitdiffstats
path: root/doc/misc
diff options
context:
space:
mode:
authorLars Ingebrigtsen2019-10-09 20:07:56 +0200
committerLars Ingebrigtsen2019-10-09 20:07:56 +0200
commitb16f19626c468647de570e43c9b18db5bd5e7638 (patch)
tree13b49fc11c5bfa9d9385352f17a8ec473d22bcde /doc/misc
parent50886f0992cf824f87a501cc8d8d8f62e7d2762a (diff)
downloademacs-b16f19626c468647de570e43c9b18db5bd5e7638.tar.gz
emacs-b16f19626c468647de570e43c9b18db5bd5e7638.zip
Move the "Skeleton Language" node to later in the manual
* doc/misc/autotype.texi (Skeleton Language): Move this low-level node to after the more user-facing nodes (bug#20780).
Diffstat (limited to 'doc/misc')
-rw-r--r--doc/misc/autotype.texi199
1 files changed, 99 insertions, 100 deletions
diff --git a/doc/misc/autotype.texi b/doc/misc/autotype.texi
index a354383cc9f..89cba183a25 100644
--- a/doc/misc/autotype.texi
+++ b/doc/misc/autotype.texi
@@ -86,7 +86,6 @@ completions and expansions of text at point.
86* Using Skeletons:: How to insert a skeleton into your text. 86* Using Skeletons:: How to insert a skeleton into your text.
87* Wrapping Skeletons:: Putting existing text within a skeleton. 87* Wrapping Skeletons:: Putting existing text within a skeleton.
88* Skeletons as Abbrevs:: An alternative for issuing skeleton commands. 88* Skeletons as Abbrevs:: An alternative for issuing skeleton commands.
89* Skeleton Language:: Making skeleton commands insert what you want.
90* Inserting Pairs:: Typing one character and getting another 89* Inserting Pairs:: Typing one character and getting another
91 after point. 90 after point.
92* Autoinserting:: Filling up empty files as soon as you visit them. 91* Autoinserting:: Filling up empty files as soon as you visit them.
@@ -96,6 +95,7 @@ completions and expansions of text at point.
96* QuickURL:: Inserting URLs based on text at point. 95* QuickURL:: Inserting URLs based on text at point.
97* Tempo:: Flexible template insertion. 96* Tempo:: Flexible template insertion.
98* Hippie Expand:: Expansion of text trying various methods. 97* Hippie Expand:: Expansion of text trying various methods.
98* Skeleton Language:: Making skeleton commands insert what you want.
99 99
100* GNU Free Documentation License:: The license for this documentation. 100* GNU Free Documentation License:: The license for this documentation.
101* Concept Index:: 101* Concept Index::
@@ -209,105 +209,6 @@ have been omitted.)
209 209
210 210
211 211
212@node Skeleton Language
213@chapter Skeleton Language
214@cindex skeleton language
215
216@findex skeleton-insert
217 Skeletons are a shorthand extension to the Lisp language, where various
218atoms directly perform either actions on the current buffer or rudimentary
219flow control mechanisms. Skeletons are interpreted by the function
220@code{skeleton-insert}.
221
222 A skeleton is a list starting with an interactor, which is usually a
223prompt-string, or @code{nil} when not needed, but can also be a Lisp
224expression for complex read functions or for returning some calculated value.
225The rest of the list are any number of elements as described in the following
226table:
227
228@table @asis
229@item @code{"@var{string}"}, @code{?@var{c}}, @code{?\@var{c}}
230@vindex skeleton-transformation
231Insert string or character. Literal strings and characters are passed through
232@code{skeleton-transformation} when that is non-@code{nil}.
233@item @code{?\n}
234@c ??? something seems very wrong here.
235Insert a newline and align under current line, but not if this is the
236last element of a skeleton and the newline would be inserted at end of
237line, or this is the first element and the newline would be inserted
238at beginning of line. Use newline character @code{?\n} to prevent
239alignment. Use @code{"\n"} as the first or last string element of a
240skeleton to insert a newline unconditionally.
241@item @code{_}
242Interesting point. When wrapping skeletons around successive regions, they are
243put at these places. Point is left at first @code{_} where nothing is
244wrapped.
245@item @code{-}
246Interesting point with no inter-region interaction; overrides
247interesting point set by @code{_}.
248@item @code{>}
249Indent line according to major mode. When following element is @code{_}, and
250there is an interregion that will be wrapped here, indent that interregion.
251@item @code{&}
252Logical and. If preceding element moved point, i.e., usually inserted
253something, do following element.
254@item @code{|}
255Logical xor. If preceding element didn't move point, i.e., usually inserted
256nothing, do following element.
257@item @code{@@}
258Add position to @code{skeleton-positions}.
259@item @code{-@var{number}}
260Delete preceding number characters. Depends on value of
261@code{skeleton-untabify}.
262@item @code{()} or @code{nil}
263Ignored.
264@item @var{lisp-expression}
265Evaluated, and the return value is again interpreted as a skeleton element.
266@item @code{str}
267A special variable that, when evaluated the first time, usually prompts
268for input according to the skeleton's interactor. It is then set to the
269return value resulting from the interactor. Each subskeleton has its local
270copy of this variable.
271@item @code{v1}, @code{v2}
272Skeleton-local user variables.
273@item @code{'@var{expression}}
274Evaluate following Lisp expression for its side-effect, but prevent it from
275being interpreted as a skeleton element.
276@item @var{skeleton}
277Subskeletons are inserted recursively, not once, but as often as the user
278enters something at the subskeletons interactor. Thus there must be a
279@code{str} in the subskeleton. They can also be used non-interactively, when
280prompt is a lisp-expression that returns successive list-elements.
281@item @code{resume:}
282Ignored. Execution resumes here if the user quits during skeleton
283interpretation.
284@item @code{help}
285Help form during interaction with the user or @code{nil}.
286@item @code{input}
287Initial input (a string or a cons with index) while reading the input.
288@item @code{quit}
289A constant which is non-@code{nil} when the @code{resume:} section was entered
290because the user quit.
291@end table
292
293@findex skeleton-further-elements
294 Some modes also use other skeleton elements they themselves defined. For
295example in shell script mode's skeletons you will find @code{<} which does a
296rigid indentation backwards, or in CC mode's skeletons you find the
297self-inserting elements @code{@{} and @code{@}}. These are defined by the
298buffer-local variable @code{skeleton-further-elements} which is a list of
299variables bound while interpreting a skeleton.
300
301@findex define-skeleton
302 The macro @code{define-skeleton} defines a command for interpreting a
303skeleton. The first argument is the command name, the second is a
304documentation string, and the rest is an interactor and any number of skeleton
305elements together forming a skeleton. This skeleton is assigned to a variable
306of the same name as the command and can thus be overridden from your
307@file{~/.emacs} file (@pxref{Init File,,, emacs, The GNU Emacs Manual}).
308
309
310
311@node Inserting Pairs 212@node Inserting Pairs
312@chapter Inserting Matching Pairs of Characters 213@chapter Inserting Matching Pairs of Characters
313@cindex inserting pairs 214@cindex inserting pairs
@@ -656,6 +557,104 @@ Typically you would bind @code{hippie-expand} to @kbd{M-/} with
656@code{dabbrev-expand}, the standard binding of @kbd{M-/}, providing one 557@code{dabbrev-expand}, the standard binding of @kbd{M-/}, providing one
657of the expansion possibilities. 558of the expansion possibilities.
658 559
560@node Skeleton Language
561@chapter Skeleton Language
562@cindex skeleton language
563
564@findex skeleton-insert
565 Skeletons are a shorthand extension to the Lisp language, where various
566atoms directly perform either actions on the current buffer or rudimentary
567flow control mechanisms. Skeletons are interpreted by the function
568@code{skeleton-insert}.
569
570 A skeleton is a list starting with an interactor, which is usually a
571prompt-string, or @code{nil} when not needed, but can also be a Lisp
572expression for complex read functions or for returning some calculated value.
573The rest of the list are any number of elements as described in the following
574table:
575
576@table @asis
577@item @code{"@var{string}"}, @code{?@var{c}}, @code{?\@var{c}}
578@vindex skeleton-transformation
579Insert string or character. Literal strings and characters are passed through
580@code{skeleton-transformation} when that is non-@code{nil}.
581@item @code{?\n}
582@c ??? something seems very wrong here.
583Insert a newline and align under current line, but not if this is the
584last element of a skeleton and the newline would be inserted at end of
585line, or this is the first element and the newline would be inserted
586at beginning of line. Use newline character @code{?\n} to prevent
587alignment. Use @code{"\n"} as the first or last string element of a
588skeleton to insert a newline unconditionally.
589@item @code{_}
590Interesting point. When wrapping skeletons around successive regions, they are
591put at these places. Point is left at first @code{_} where nothing is
592wrapped.
593@item @code{-}
594Interesting point with no inter-region interaction; overrides
595interesting point set by @code{_}.
596@item @code{>}
597Indent line according to major mode. When following element is @code{_}, and
598there is an interregion that will be wrapped here, indent that interregion.
599@item @code{&}
600Logical and. If preceding element moved point, i.e., usually inserted
601something, do following element.
602@item @code{|}
603Logical xor. If preceding element didn't move point, i.e., usually inserted
604nothing, do following element.
605@item @code{@@}
606Add position to @code{skeleton-positions}.
607@item @code{-@var{number}}
608Delete preceding number characters. Depends on value of
609@code{skeleton-untabify}.
610@item @code{()} or @code{nil}
611Ignored.
612@item @var{lisp-expression}
613Evaluated, and the return value is again interpreted as a skeleton element.
614@item @code{str}
615A special variable that, when evaluated the first time, usually prompts
616for input according to the skeleton's interactor. It is then set to the
617return value resulting from the interactor. Each subskeleton has its local
618copy of this variable.
619@item @code{v1}, @code{v2}
620Skeleton-local user variables.
621@item @code{'@var{expression}}
622Evaluate following Lisp expression for its side-effect, but prevent it from
623being interpreted as a skeleton element.
624@item @var{skeleton}
625Subskeletons are inserted recursively, not once, but as often as the user
626enters something at the subskeletons interactor. Thus there must be a
627@code{str} in the subskeleton. They can also be used non-interactively, when
628prompt is a lisp-expression that returns successive list-elements.
629@item @code{resume:}
630Ignored. Execution resumes here if the user quits during skeleton
631interpretation.
632@item @code{help}
633Help form during interaction with the user or @code{nil}.
634@item @code{input}
635Initial input (a string or a cons with index) while reading the input.
636@item @code{quit}
637A constant which is non-@code{nil} when the @code{resume:} section was entered
638because the user quit.
639@end table
640
641@findex skeleton-further-elements
642 Some modes also use other skeleton elements they themselves defined. For
643example in shell script mode's skeletons you will find @code{<} which does a
644rigid indentation backwards, or in CC mode's skeletons you find the
645self-inserting elements @code{@{} and @code{@}}. These are defined by the
646buffer-local variable @code{skeleton-further-elements} which is a list of
647variables bound while interpreting a skeleton.
648
649@findex define-skeleton
650 The macro @code{define-skeleton} defines a command for interpreting a
651skeleton. The first argument is the command name, the second is a
652documentation string, and the rest is an interactor and any number of skeleton
653elements together forming a skeleton. This skeleton is assigned to a variable
654of the same name as the command and can thus be overridden from your
655@file{~/.emacs} file (@pxref{Init File,,, emacs, The GNU Emacs Manual}).
656
657
659@node GNU Free Documentation License 658@node GNU Free Documentation License
660@appendix GNU Free Documentation License 659@appendix GNU Free Documentation License
661@include doclicense.texi 660@include doclicense.texi