1% Copyright 2005-2017 Cisco Systems, Inc.
2%
3% Licensed under the Apache License, Version 2.0 (the "License");
4% you may not use this file except in compliance with the License.
5% You may obtain a copy of the License at
6%
7% http://www.apache.org/licenses/LICENSE-2.0
8%
9% Unless required by applicable law or agreed to in writing, software
10% distributed under the License is distributed on an "AS IS" BASIS,
11% WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12% See the License for the specific language governing permissions and
13% limitations under the License.
14\chapter{Expression Editor\label{CHPTEXPEDITOR}}
15
16When the expression editor (expeditor) is enabled as described in
17Section~\ref{SECTUSEEXPEDITOR}, it allows the user to edit expressions
18entered into the system and move backwards and forwards through
19a history of entered expressions.
20This chapter describes a set of parameters that may be used to
21control various aspects of the expression editor's behavior
22(Section~\ref{SECTEXPEDITORPARAMS}),
23a procedure for binding key sequences to editing commands
24(Section~\ref{SECTEXPEDITORKEYBINDING}),
25the built-in editing commands
26(Section~\ref{SECTEXPEDITOREDITCMDS}), and mechanisms for creating new
27editing commands (Section~\ref{SECTEXPEDITORNEWCMDS}).
28
29These mechanisms are available through the \scheme{expression-editor} module.
30
31%----------------------------------------------------------------------------
32\entryheader
33\formdef{expression-editor}{\categorymodule}{expression-editor}
34\listlibraries
35\endentryheader
36
37The \scheme{expression-editor} module exports a set of bindings for
38parameters and other procedures that can be used to modify how the
39expression editor interacts with the user, including the particular keys
40used to invoke the various editing commands.
41
42\medskip
43Basic use of the expression editor is described in Section~\ref{SECTUSEEXPEDITOR}.
44
45\xdef\cntl#1{\scheme{^#1}}
46
47\section{Expression Editor Parameters\label{SECTEXPEDITORPARAMS}}
48
49%----------------------------------------------------------------------------
50\noskipentryheader
51\formdef{ee-auto-indent}{\categoryglobalparameter}{ee-auto-indent}
52\nolistlibraries
53\endnoskipentryheader
54
55The value of \scheme{ee-auto-indent} is a boolean value that determines
56whether the expression editor indents expressions as they are entered.
57Its default value is \scheme{#t}.
58
59
60%----------------------------------------------------------------------------
61\entryheader
62\formdef{ee-standard-indent}{\categoryglobalparameter}{ee-standard-indent}
63\nolistlibraries
64\endentryheader
65
66The value of \scheme{ee-standard-indent} is a nonnegative fixnum
67value that determines the amount (in single spaces) by which each
68expression is indented relative to the enclosing expression, if
69not aligned otherwise by one of the indenter's other heuristics,
70when \scheme{ee-auto-indent} is true or when one of the indentation
71commands is invoked explicitly.
72It's default value is \scheme{2}.
73
74
75%----------------------------------------------------------------------------
76\entryheader
77\formdef{ee-auto-paren-balance}{\categoryglobalparameter}{ee-auto-paren-balance}
78\nolistlibraries
79\endentryheader
80
81The value of \scheme{ee-auto-paren-balance} is a boolean value that determines
82whether the expression editor automatically corrects a close
83parenthesis or bracket, when typed, to match the corresponding open
84parenthesis or bracket, if any.
85Its default value is \scheme{#t}.
86
87
88%----------------------------------------------------------------------------
89\entryheader
90\formdef{ee-flash-parens}{\categoryglobalparameter}{ee-flash-parens}
91\nolistlibraries
92\endentryheader
93
94The value of \scheme{ee-flash-parens} is a boolean value that determines
95whether the expression editor briefly moves the cursor when an open
96or close parenthesis or bracket is typed to the
97matching close or open parenthesis or bracket (if any).
98Its default value is \scheme{#t}.
99
100
101%----------------------------------------------------------------------------
102\entryheader
103\formdef{ee-paren-flash-delay}{\categoryglobalparameter}{ee-paren-flash-delay}
104\nolistlibraries
105\endentryheader
106
107The value of \scheme{ee-paren-flash-delay} is a nonnegative fixnum
108value that determines the amount of time (in milliseconds) that the
109expression editor pauses when the cursor is moved to the matching
110parenthesis or bracket, if any, when a parenthesis or bracket is
111entered.
112The value is ignored if the \scheme{ee-flash-parens} is false.
113Its default value is \scheme{100}.
114
115
116%----------------------------------------------------------------------------
117\entryheader
118\formdef{ee-default-repeat}{\categoryglobalparameter}{ee-default-repeat}
119\nolistlibraries
120\endentryheader
121
122The value of \scheme{ee-default-repeat} is a nonnegative fixnum
123value that determines the number of times the next command is
124repeated after the \scheme{ee-command-repeat} editing command
125(bound to \scheme{Esc-^U} by default) is used and \emph{not}
126followed by a sequence of digits.
127It's default value is \scheme{4}.
128
129
130%----------------------------------------------------------------------------
131\entryheader
132\formdef{ee-noisy}{\categoryglobalparameter}{ee-noisy}
133\nolistlibraries
134\endentryheader
135
136The value of \scheme{ee-noisy} is a boolean value that determines
137whether the expression editor emits a beep (bell) when an error
138occurs, such as an attempt to find the matching delimiter for a
139non-delimiter character.
140Its default value is \scheme{#f}.
141
142
143%----------------------------------------------------------------------------
144\entryheader
145\formdef{ee-history-limit}{\categoryglobalparameter}{ee-history-limit}
146\nolistlibraries
147\endentryheader
148
149The value of \scheme{ee-history-limit} is a nonnegative fixnum value
150that determines the number of history entries retained by the
151expression editor during and across sessions.
152Only the last \scheme{(ee-history-limit)} entries are retained.
153% Its default value is \scheme{100}.
154
155
156%----------------------------------------------------------------------------
157\entryheader
158\formdef{ee-common-identifiers}{\categoryglobalparameter}{ee-common-identifiers}
159\nolistlibraries
160\endentryheader
161
162The value of \scheme{ee-common-identifiers} is list of symbols that
163are considered common enough that they should appear early when
164one of the incremental identifier-completion editing commands is
165invoked.
166Its default value contains a few dozen entries.
167They are all more than a few characters long (under the theory that
168users will most likely type short ones out fully) and all would
169appear later than they likely should when incremental
170identifier-completion is used.
171
172
173\section{Key Binding\label{SECTEXPEDITORKEYBINDING}}
174
175Key bindings are established via \scheme{ee-bind-key}.
176The default key bindings are described in Section~\ref{SECTEXPEDITOREDITCMDS}.
177
178%----------------------------------------------------------------------------
179\entryheader
180\formdef{ee-bind-key}{\categoryprocedure}{(ee-bind-key \var{key} \var{procedure})}
181\nolistlibraries
182\returns unspecified
183\endentryheader
184
185The \scheme{ee-bind-key} procedure is used to add to or change the
186set of key bindings recognized by the expression editor.
187
188The \var{key} must be a character or string; if it is a string, it
189must have the following form.
190
191\begin{grammar}
192\ang{key-string}\longis \scheme{"}\ang{key-char}\kplus\scheme{"}
193\end{grammar}
194
195where
196
197\begin{grammar}
198\ang{key-char}\longis \scheme{\\e} (specifying an escape character)\\
199  \orbar \scheme{^\var{x}} (specifying control-\var{x})\\
200  \orbar \scheme{\\^} (specifying caret)\\
201  \orbar \scheme{\\\\} (specifying back slash)\\
202  \orbar \scheme{plain char} (any character other than \scheme{\} or \scheme{^})
203\end{grammar}
204
205Note that each double-backslash in the syntax actually denotes just
206one backslash in the string.
207
208For example, the \var{key} \scheme{"\\eX"} represents the two-character
209sequence Escape-x, i.e., the ``escape'' key followed by the (capital)
210``X'' key.
211Similarly, they \var{key} \scheme{"\\e^X"} represents the two-character
212sequence Escape-Control-x, i.e., the ``escape'' key followed by
213Control-X.
214
215Character keys and string keys consisting of a single plain character
216always represent a single keystroke.
217
218The \var{procedure} argument should normally be one of the built-in editing
219commands described below.
220It is also possible to define new editing commands with
221\index{\scheme{ee-string-macro}}\scheme{ee-string-macro}
222and \index{\scheme{ee-compose}}\scheme{ee-compose}.
223
224
225\section{Editing Commands\label{SECTEXPEDITOREDITCMDS}}
226
227\xdef\editproc#1#2{\medskip {\bf command:} \index{\scheme{#1}}\scheme{#1}\\
228                            {\bf key(s):} #2\par{}}
229\xdef\endeditproc{\par{}}
230
231\def\ECgroup#1 {\medskip\noindent{\bf #1}\par}
232
233The editing commands are grouped into sections according to usage.
234Each is listed along with the default character sequence or sequences by
235which it may be invoked.
236
237\ECgroup{Insertion commands}
238
239\editproc{ee-insert-self}{most printing characters}
240Inserts the entered character into the entry.
241\endeditproc
242
243\editproc{ee-insert-paren}{\scheme{(}, \scheme{)}, \scheme{[}, \scheme{]}}
244Inserts the entered parenthesis or bracket into the entry.
245
246If the parameter
247\index{\scheme{ee-auto-paren-balance}}\scheme{ee-auto-paren-balance} is
248true, the editor corrects close delimiters if necessary to balance
249existing open delimiters, when a matching open delimiter can be found.
250
251If the parameter \index{\scheme{ee-flash-parens}}\scheme{ee-flash-parens}
252is true, the editor briefly moves the cursor to the matching delimiter, if
253one can be found, pausing for an amount of time controlled by the
254parameter \index{\scheme{ee-paren-flash-delay}}\scheme{ee-paren-flash-delay}.
255If the matching delimiter is not presently displayed, the cursor is flashed
256to the upper-left or lower-left corner of the displayed portion of the
257entry, as appropriate.
258
259The behavior of this command is undefined if used for something other
260than a parenthesis or bracket.
261parentheses and brackets.
262\endeditproc
263
264\editproc{ee-newline}{none}
265Inserts a newline at the cursor position, moves to the next line, and
266indents that line if the parameter
267\index{\scheme{ee-auto-indent}}\scheme{ee-auto-indent} is true.
268Does nothing if the entry is empty.
269See also \scheme{ee-newline/accept}.
270\endeditproc
271
272\editproc{ee-open-line}{\cntl{O}}
273Inserts a newline at the cursor position and indents the next line,
274but does not move to the next line.
275\endeditproc
276
277\editproc{ee-yank-kill-buffer}{\cntl{Y}}
278Inserts the contents of the kill buffer, which is set by the deletion
279commands described below.
280\endeditproc
281
282\editproc{ee-yank-selection}{\cntl{V}}
283Inserts the contents of the window system's current selection or paste
284buffer.
285When running in a shell window under X Windows, this command requires that
286the DISPLAY environment variable be set to the appropriate display.
287\endeditproc
288
289% The following is no longer true, since auto-indent is disabled when
290% the characters are coming fast enough that they are likely happening
291% as the result of a paste operation.
292%
293% While it may be possible to insert the contents of the current selection
294% or paste buffer via some other means, e.g., via the mouse or some
295% OS-specific key combination, this command is preferable whenever the
296% parameter \index{\scheme{ee-auto-indent}}\scheme{ee-auto-indent} is true
297% for multi-line input that is already indented.
298
299\ECgroup{Cursor movement commands}
300
301\editproc{ee-backward-char}{leftarrow, \cntl{B}}
302Moves the cursor left one character.
303\endeditproc
304
305\editproc{ee-forward-char}{rightarrow, \cntl{F}}
306Moves the cursor right one character.
307\endeditproc
308
309\editproc{ee-next-line}{downarrow, \cntl{N}}
310Moves the cursor down one line (and to the left if necessary so that
311the cursor does not sit beyond the last possible position).
312If the cursor is at the end of the current entry, and the current
313entry has not been modified, this command behaves like
314\index{\scheme{ee-history-fwd}}\scheme{ee-history-fwd}.
315\endeditproc
316
317\editproc{ee-previous-line}{uparrow, \cntl{P}}
318Moves the cursor up one line (and to the left if necessary so that
319the cursor does not sit beyond the last possible position).
320If the cursor is at the top of the current entry, and the current
321entry has not been modified, this command behaves like
322\index{\scheme{ee-history-bwd}}\scheme{ee-history-bwd}.
323\endeditproc
324
325\editproc{ee-beginning-of-line}{home, \cntl{A}}
326Moves the cursor to the first character of the current line.
327\endeditproc
328
329\editproc{ee-end-of-line}{end, \cntl{E}}
330Moves the cursor to the right of the last character of the current line.
331\endeditproc
332
333\editproc{ee-beginning-of-entry}{escape-\scheme{<}}
334Moves the cursor to the first character of the entry.
335\endeditproc
336
337\editproc{ee-end-of-entry}{escape-\scheme{>}}
338Moves the cursor to the right of the last character of the entry.
339\endeditproc
340
341\editproc{ee-goto-matching-delimiter}{escape-\scheme{]}}
342Moves the cursor to the matching delimiter.
343Has no effect if the character under the cursor is not a parenthesis
344or bracket or if no matching delimiter can be found.
345\endeditproc
346
347\editproc{ee-flash-matching-delimiter}{\cntl{]}}
348Moves the cursor briefly to the matching delimiter, if
349one can be found, pausing for an amount of time controlled by the
350parameter \index{\scheme{ee-paren-flash-delay}}\scheme{ee-paren-flash-delay}.
351If the matching delimiter is not presently displayed, the cursor is flashed
352to the upper-left or lower-left corner of the displayed portion of the
353entry, as appropriate.
354\endeditproc
355
356\editproc{ee-exchange-point-and-mark}{\cntl{X}-\cntl{X}}
357Moves the cursor to the mark and leaves the mark at the old cursor
358position.
359(The mark can be set with \scheme{ee-set-mark}.)
360\endeditproc
361
362\editproc{ee-forward-sexp}{escape-\cntl{F}}
363Moves the cursor to the start of the next expression.
364\endeditproc
365
366\editproc{ee-backward-sexp}{escape-\cntl{B}}
367Moves the cursor to the start of the preceding expression.
368\endeditproc
369
370\editproc{ee-forward-word}{escape-f, escape-\scheme{F}}
371Moves the cursor to the end of the next word.
372\endeditproc
373
374\editproc{ee-backward-word}{escape-b, escape-\scheme{B}}
375Moves the cursor to the start of the preceding word.
376\endeditproc
377
378\editproc{ee-forward-page}{pagedown, \cntl{X}-\scheme{]}}
379Moves the cursor down one screen page.
380\endeditproc
381
382\editproc{ee-backward-page}{pageup, \cntl{X}-\scheme{[}}
383Moves the cursor up one screen page.
384\endeditproc
385
386
387\ECgroup{Deletion commands}
388
389\editproc{ee-delete-char}{delete}
390Deletes the character under the cursor.
391
392See also \scheme{ee-eof/delete-char}.
393\endeditproc
394
395\editproc{ee-backward-delete-char}{backspace (rubout), \cntl{H}}
396Deletes the character to the left of the cursor.
397\endeditproc
398
399\editproc{ee-delete-line}{\cntl{U}}
400Deletes the contents of the current line, leaving behind an empty line.
401When used on the first line of a multiline entry of which only the first line
402is displayed, i.e., immediately after history movement, \scheme{ee-delete-line}
403deletes the contents of the entire entry, like \scheme{ee-delete-entry}
404(described below).
405\endeditproc
406
407\editproc{ee-delete-to-eol}{\cntl{K}, escape-\scheme{K}}
408If the cursor is at the end of a line, joins the line with the next
409line, otherwise deletes from the cursor position to the end of the line.
410\endeditproc
411
412\editproc{ee-delete-between-point-and-mark}{\cntl{W}}
413Deletes text between the current cursor position and the mark.
414(The mark can be set with \scheme{ee-set-mark}.)
415\endeditproc
416
417\editproc{ee-delete-entry}{\cntl{G}}
418Deletes the contents of the current entry.
419\endeditproc
420
421\editproc{ee-reset-entry}{\cntl{C}}
422Deletes the contents of the current entry and moves to the end of the
423history.
424\endeditproc
425
426\editproc{ee-delete-sexp}{escape-\cntl{K}, escape-delete}
427Deletes the expression that starts under the cursor, or if
428no expression starts under the cursor, deletes up to the next
429expression.
430\endeditproc
431
432\editproc{ee-backward-delete-sexp}{escape-backspace (escape-rubout), escape-\cntl{H}}
433Deletes the expression to the left of the cursor.
434\endeditproc
435
436\ECgroup{Identifier/filename completion commands}
437
438These commands perform either identifier or filename completion.
439Identifier completion is performed outside of a string constant, and filename
440completion is performed within a string constant.
441(In determining whether the cursor is within a string constant, the
442expression editor looks only at the current line and so can be fooled
443by string constants that span multiple lines.)
444
445\editproc{ee-id-completion}{none}
446Inserts the common prefix of possible completions of the identifier or
447filename immediately to the left of the cursor.
448Identifier completion is based on the identifiers
449defined in the interaction environment.
450When there is exactly one possible completion, the common prefix is the
451completion.
452This command has no effect if no filename or identifier prefix is
453immediately the left of the cursor or if the possible completions have
454no common prefix.
455If run twice in succession, a list of possible completions is displayed.
456
457See also
458\index{\scheme{ee-id-completion/indent}}\scheme{ee-id-completion/indent}.
459\endeditproc
460
461\editproc{ee-next-id-completion}{\cntl{R}}
462Inserts one of the possible completions of the identifier or filename
463immediately to the left of the cursor.
464Identifier completion is based on the identifiers
465defined in the interaction environment.
466If run twice or more in succession, this command cycles through all of
467the possible completions.
468The order is determined by the following heuristics: appearing first
469are identifiers whose names appear in the list value of the parameter
470\index{\scheme{ee-common-identifiers}}\scheme{ee-common-identifiers};
471appearing second are identifiers bound in the interaction environment
472but not bound in the scheme-environment (i.e., identifiers defined by
473the user), and appearing last are those in the scheme environment.
474Within the set of matches appearing in the \scheme{ee-common-identifiers}
475list, those listed earliest are shown first; the order is alphabetical
476within the other two sets.
477
478See also
479\index{\scheme{ee-next-id-completion/indent}}\scheme{ee-next-id-completion/indent}.
480\endeditproc
481
482\ECgroup{History movement commands}
483
484\index{\scheme{--eehistory} command-line-option}%
485The expression editor maintains a history of entries during each session.
486It also saves the history across sessions unless this behavior is
487disabled via the command-line argument ``\scheme{--eehistory off}.''
488
489When moving from one history entry to another, only the first line of each
490multi-line entry is displayed.
491The redisplay command (which \cntl{L} is bound to by default) can be used
492to display the entire entry.
493It is also possible to move down one line at a time to expose just part of
494the rest of the entry.
495
496\editproc{ee-history-bwd}{escape-uparrow, escape-\cntl{P}}
497Moves to the preceding history entry
498if the current entry is empty or has not been modified;
499otherwise, has no effect.
500
501See also \scheme{ee-previous-line}.
502\endeditproc
503
504\editproc{ee-history-fwd}{escape-downarrow, escape-\cntl{N}}
505Moves to the next history entry
506if the current entry is empty or has not been modified;
507otherwise, has no effect.
508
509See also \scheme{ee-next-line}.
510\endeditproc
511
512\editproc{ee-history-bwd-prefix}{escape-\scheme{p}}
513Moves to the closest previous history entry, if any, that starts with
514the sequence of characters that makes up the current entry.
515May be used multiple times to search for same prefix.
516\endeditproc
517
518\editproc{ee-history-fwd-prefix}{escape-\scheme{n}}
519Moves to the closest following history entry, if any, that starts with
520the sequence of characters that makes up the current entry.
521May be used multiple times to search for same prefix.
522\endeditproc
523
524\editproc{ee-history-bwd-contains}{escape-\scheme{P}}
525Moves to the closest previous history entry, if any, that contains within
526it the sequence of characters that makes up the current entry.
527May be used multiple times to search for same content.
528\endeditproc
529
530\editproc{ee-history-fwd-contains}{escape-\scheme{N}}
531Moves to the closest following history entry, if any, that contains within
532it the sequence of characters that makes up the current entry.
533May be used multiple times to search for same content.
534\endeditproc
535
536
537\ECgroup{Indentation commands}
538
539\editproc{ee-indent}{escape-tab}
540Re-indents the current line.
541
542See also \scheme{ee-next-id-completion/indent}.
543\endeditproc
544
545\editproc{ee-indent-all}{escape-\scheme{q}, escape-\scheme{Q}, escape-\cntl{Q}}
546Re-indents each line of the entire entry.
547\endeditproc
548
549
550\ECgroup{Miscellaneous commands}
551
552\editproc{ee-accept}{\cntl{J}}
553Causes the expression editor to invoke the Scheme reader on the contents
554of the entry.
555If the read is successful, the expression is returned to the waiter;
556otherwise, an error message is printed, the entry redisplayed, and the
557cursor left (if possible) at the start of the invalid subform.
558
559See also \scheme{ee-newline/accept}.
560\endeditproc
561
562\editproc{ee-eof}{none}
563Causes end-of-file to be returned from the expression editor,
564which in turn causes the waiter to exit.
565Ignored unless entry is empty.
566
567See also \scheme{ee-eof/delete-char}.
568\endeditproc
569
570\editproc{ee-redisplay}{\cntl{L}}
571Redisplays the current expression.
572If run twice in succession, clears the screen and redisplays the
573expression at the top of the screen.
574\endeditproc
575
576\editproc{ee-suspend-process}{\cntl{Z}}
577Suspends the current process in shells that support job control.
578\endeditproc
579
580\editproc{ee-set-mark}{\cntl{@}, \cntl{}space}
581Sets the mark to the current cursor position.
582\endeditproc
583
584\editproc{ee-command-repeat}{escape-\cntl{U}}
585Repeats the next command $n$ times.
586If the next character typed is a digit, $n$ is determined by reading
587up the sequence of the digits typed and treating it as a decimal
588number.
589Otherwise, $n$ is the value of the parameter
590\index{\scheme{ee-default-repeat}}\scheme{ee-default-repeat}.
591\endeditproc
592
593
594\ECgroup{Combination commands}
595
596\editproc{ee-newline/accept}{enter, \cntl{M}}
597Behaves like \scheme{ee-accept} if run at the end (not including
598whitespace) of an entry that starts with a balanced expression;
599otherwise, behaves like \scheme{ee-newline}.
600\endeditproc
601
602\editproc{ee-id-completion/indent}{tab}
603Behaves like \scheme{ee-id-completion} if an identifier (outside
604a string constant) or filename (within a string constant) appears
605just to the left of the cursor and the last character of that
606identifier or filename was just entered;
607otherwise, behaves like \scheme{ee-indent}.
608
609If an existing identifier or filename, i.e., not one just typed, appears to the left
610of the cursor, the first use of this command behaves like
611\scheme{ee-newline}, the second consecutive use behaves like
612\scheme{ee-id-completion}, and the third behaves like a second consecutive
613use of \scheme{ee-id-completion}.
614\endeditproc
615
616\editproc{ee-next-id-completion/indent}{none}
617Behaves like \scheme{ee-next-id-completion} if an identifier (outside
618a string constant) or filename (within a string constant)
619appears just to the left of the cursor and the last character of that
620identifier or identifier was just entered;
621otherwise, behaves like \scheme{ee-indent}.
622\endeditproc
623
624\editproc{ee-eof/delete-char}{\cntl{D}}
625Behaves like \scheme{ee-delete-char} if the entry is nonempty;
626otherwise, behaves like \scheme{ee-eof}.
627If the entry is nonempty and this command is run twice or more in
628succession, it does nothing once the entry becomes empty.
629This is to prevent accidental exit from the waiter in cases where
630the command is run repeatedly (perhaps with the help of a keyboard's
631auto-repeat feature) to delete all of the characters in an entry.
632\endeditproc
633
634\section{Creating New Editing Commands\label{SECTEXPEDITORNEWCMDS}}
635
636%----------------------------------------------------------------------------
637\noskipentryheader
638\formdef{ee-string-macro}{\categoryprocedure}{(ee-string-macro \var{string})}
639\nolistlibraries
640\returns a new editing command
641\endnoskipentryheader
642
643The new editing command produced inserts \var{string} before the current
644cursor position.
645
646Two string macros are predefined:
647
648\begin{tabular}{ll}
649\scheme{(ee-string-macro "(define ")} & ~~escape-d\\
650\scheme{(ee-string-macro "(lambda ")} & ~~escape-l
651\end{tabular}
652
653%----------------------------------------------------------------------------
654\entryheader
655\formdef{ee-compose}{\categoryprocedure}{(ee-compose \var{ecmd} \dots)}
656\nolistlibraries
657\returns a new editing command
658\endentryheader
659
660Each \var{ecmd} must be an editing command.
661
662The new editing command runs each of the editing commands
663\scheme{\var{ecmd} \dots} in sequence.
664
665% this is of limited utility until we provide some
666% inspection procedures, like point-pos and end-of-line?
667
668For example, the following expression binds \cntl{X}-p to an editing
669command that behaves like \scheme{ee-history-bwd-prefix} but leaves the
670cursor at the end of the expression rather than at the end of the first
671line, causing the entire entry to be displayed.
672
673\schemedisplay
674(let ()
675  (import expression-editor)
676  (ee-bind-key "^Xp"
677    (ee-compose ee-history-bwd ee-end-of-entry)))
678\endschemedisplay
679
680A command such as \scheme{ee-id-completion} that performs a different
681action when run twice in succession will not recognize that it has been
682run twice in succession if run as part of a composite command.
683
684
685