home *** CD-ROM | disk | FTP | other *** search
/ OS/2 Professional / OS2PRO194.ISO / os2 / prgramer / unix / info / elisp.i10 (.txt) < prev    next >
GNU Info File  |  1993-06-14  |  52KB  |  964 lines

  1. This is Info file elisp, produced by Makeinfo-1.47 from the input file
  2. elisp.texi.
  3.    This file documents GNU Emacs Lisp.
  4.    This is edition 1.03 of the GNU Emacs Lisp Reference Manual, for
  5. Emacs Version 18.
  6.    Published by the Free Software Foundation, 675 Massachusetts Avenue,
  7. Cambridge, MA 02139 USA
  8.    Copyright (C) 1990 Free Software Foundation, Inc.
  9.    Permission is granted to make and distribute verbatim copies of this
  10. manual provided the copyright notice and this permission notice are
  11. preserved on all copies.
  12.    Permission is granted to copy and distribute modified versions of
  13. this manual under the conditions for verbatim copying, provided that
  14. the entire resulting derived work is distributed under the terms of a
  15. permission notice identical to this one.
  16.    Permission is granted to copy and distribute translations of this
  17. manual into another language, under the above conditions for modified
  18. versions, except that this permission notice may be stated in a
  19. translation approved by the Foundation.
  20. File: elisp,  Node: Output Functions,  Prev: Output Streams,  Up: Streams
  21. Output Functions
  22. ----------------
  23.    This section describes the Lisp functions and variables that pertain
  24. to printing.
  25.    Some of the Emacs printing functions add quoting characters to the
  26. output when necessary so that it can be read properly.  The quoting
  27. characters used are `\' and `"'; they are used to distinguish strings
  28. from symbols, and to prevent punctuation characters in strings and
  29. symbols from being taken as delimiters.  *Note Printed
  30. Representation::, for full details.  You specify quoting or no quoting
  31. by the choice of printing function.
  32.    If the text is to be read back into Lisp, then it is best to print
  33. with quoting characters to avoid ambiguity.  Likewise, if the purpose is
  34. to describe a Lisp object clearly for a Lisp programmer.  However, if
  35. the purpose of the output is to look nice for humans, then it is better
  36. to print without quoting.
  37.    In the functions below, STREAM stands for an output stream. (See the
  38. previous section for a description of output streams.)  If STREAM is
  39. `nil' or omitted, it defaults to the value of `standard-output'.
  40.  -- Function: print OBJECT &optional STREAM
  41.      The `print' is a convenient way of printing.  It outputs the
  42.      printed representation of OBJECT to STREAM, printing in addition
  43.      one newline before OBJECT and another after it.  Quoting
  44.      characters are used.  `print' returns OBJECT.  For example:
  45.           (progn (print 'The\ cat\ in)
  46.                  (print "the hat")
  47.                  (print " came back"))
  48.                -|
  49.                -| The\ cat\ in
  50.                -|
  51.                -| "the hat"
  52.                -|
  53.                -| " came back"
  54.                -|
  55.                => " came back"
  56.  -- Function: prin1 OBJECT &optional STREAM
  57.      This function outputs the printed representation of OBJECT to
  58.      STREAM.  It does not print any spaces or newlines to separate
  59.      output as `print' does, but it does use quoting characters just
  60.      like `print'.  It returns OBJECT.
  61.           (progn (prin1 'The\ cat\ in)
  62.                  (prin1 "the hat")
  63.                  (prin1 " came back"))
  64.                -| The\ cat\ in"the hat"" came back"
  65.                => " came back"
  66.  -- Function: prin1-to-string OBJECT
  67.      This function returns a string containing the text that `prin1'
  68.      would have printed for the same argument.
  69.           (prin1-to-string 'foo)
  70.                => "foo"
  71.           (prin1-to-string (mark-marker))
  72.                => "#<marker at 2773 in strings.texi>"
  73.      See `format', in *Note String Conversion::, for other ways to
  74.      obtain the printed representation of a Lisp object as a string.
  75.  -- Function: princ OBJECT &optional STREAM
  76.      This function outputs the printed representation of OBJECT to
  77.      STREAM.  It returns OBJECT.
  78.      This function is intended to produce output that is readable by
  79.      people, not by `read', so quoting characters are not used and
  80.      double-quotes are not printed around the contents of strings.  It
  81.      does not add any spacing between calls.
  82.           (progn
  83.             (princ 'The\ cat)
  84.             (princ " in the \"hat\""))
  85.                -| The cat in the "hat"
  86.                => " in the \"hat\""
  87.  -- Function: terpri &optional STREAM
  88.      This function outputs a newline to STREAM.  The name stands for
  89.      "terminate print".
  90.  -- Variable: standard-output
  91.      The value of this variable is the default output stream, used when
  92.      the STREAM argument is omitted or `nil'.
  93.  -- Variable: print-escape-newlines
  94.      If this variable is non-`nil', then newline characters in strings
  95.      are printed as `\n'.  Normally they are printed as actual newlines.
  96.      This variable affects the print functions `prin1' and `print'; it
  97.      does not affect `princ' in Emacs 18, but this may be changed. Here
  98.      is an example using `prin1':
  99.           (prin1 "a\nb")
  100.                -| "a
  101.                -| b"
  102.                => "a
  103.                => b"
  104.           
  105.           (let ((print-escape-newlines t))
  106.             (prin1 "a\nb"))
  107.                -| "a\nb"
  108.                => "a
  109.                => b"
  110.      In the second expression, the local binding of
  111.      `print-escape-newlines' is in effect during the call to `prin1',
  112.      but not during the printing of the result.
  113.  -- Variable: print-length
  114.      The value of this variable is the maximum number of elements of a
  115.      list that will be printed.  If the list being printed has more
  116.      than this many elements, then it is abbreviated with an ellipsis.
  117.      If the value is `nil' (the default), then there is no limit.
  118.           (setq print-length 2)
  119.                => 2
  120.           (print '(1 2 3 4 5))
  121.                -| (1 2 ...)
  122.                => (1 2 ...)
  123.  -- Function: write-char CHARACTER &optional STREAM
  124.      This function outputs CHARACTER to STREAM.  It returns CHARACTER.
  125. File: elisp,  Node: Minibuffers,  Next: Command Loop,  Prev: Streams,  Up: Top
  126. Minibuffers
  127. ***********
  128.    A "minibuffer" is a special buffer used by Emacs commands to read
  129. arguments more complicated than the single numeric prefix argument.
  130. These arguments include file names, buffer names, and command names (as
  131. in `M-x').  The minibuffer is displayed on the bottom line of the
  132. screen, in the same place as the echo area, but only while it is in use
  133. for reading an argument.
  134. * Menu:
  135. * Intro to Minibuffers::      Basic information about minibuffers.
  136. * Text from Minibuffer::      How to read a straight text string.
  137. * Object from Minibuffer::    How to read a Lisp object or expression.
  138. * Completion::                How to invoke and customize completion.
  139. * Yes-or-No Queries::         Asking a question with a simple answer.
  140. * Minibuffer Misc::           Various customization hooks and variables.
  141. File: elisp,  Node: Intro to Minibuffers,  Next: Text from Minibuffer,  Prev: Minibuffers,  Up: Minibuffers
  142. Introduction to Minibuffers
  143. ===========================
  144.    In most ways, a minibuffer is a normal Emacs buffer.  Most operations
  145. *within* a buffer, such as editing commands, work normally in a
  146. minibuffer.  However, many operations for managing buffers do not apply
  147. to minibuffers.  The name of a minibuffer always has the form
  148. ` *Minibuf-NUMBER', and it cannot be changed.  There is a special
  149. window used only for minibuffers, and minibuffers cannot be displayed in
  150. any other window.  This window is normally the single line at the bottom
  151. of the screen; it can be resized temporarily with the window sizing
  152. commands, but reverts to its normal size when the minibuffer is exited.
  153.    A "recursive minibuffer" may be created when there is an active
  154. minibuffer and a command is invoked that requires input from a
  155. minibuffer.  The first minibuffer is named ` *Minibuf-0*'. Recursive
  156. minibuffers are named by incrementing the number at the end of the
  157. name.  (The names begin with a space so that they won't show up in
  158. normal buffer lists.)  Of several recursive minibuffers, the innermost
  159. (or most recently entered) is the active minibuffer, and is the only one
  160. that is displayed in a window.  We usually call this "the" minibuffer.
  161. Recursive minibuffers may be allowed or disallowed by setting the
  162. variable `enable-recursive-minibuffers'.
  163.    Like other buffers, a minibuffer may use any of several local keymaps
  164. (*note Keymaps::.); these contain various exit commands and in some
  165. cases completion commands.  *Note Completion::.
  166.    * `minibuffer-local-map' is for ordinary input (no completion).
  167.    * `minibuffer-local-ns-map' is similar, except that SPC exits just
  168.      like RET.  This is used mainly for Mocklisp compatibility.
  169.    * `minibuffer-local-completion-map' is for permissive completion.
  170.    * `minibuffer-local-must-match-map' is for strict completion and for
  171.      cautious completion.
  172.    * `repeat-complex-command-map' is for use in `C-x ESC'.
  173. File: elisp,  Node: Text from Minibuffer,  Next: Object from Minibuffer,  Prev: Intro to Minibuffers,  Up: Minibuffers
  174. Reading Text Strings with the Minibuffer
  175. ========================================
  176.    The minibuffer is usually used to read text which is returned as a
  177. string, but can also be used to read a Lisp object in textual form.  The
  178. most basic primitive for minibuffer input is `read-from-minibuffer'.
  179.  -- Function: read-from-minibuffer PROMPT-STRING &optional INITIAL
  180.           KEYMAP READ
  181.      This function is the most general way to get input through the
  182.      minibuffer.  By default, it accepts arbitrary text and returns it
  183.      as a string; however, if READ is non-`nil', then it uses `read' to
  184.      convert the text into a Lisp object (*note Input Functions::.).
  185.      The first thing this function does is to activate a minibuffer and
  186.      display it with  PROMPT-STRING as the prompt.  This value must be a
  187.      string.
  188.      Then, if INITIAL is non-`nil', it must be a string; its contents
  189.      are inserted into the minibuffer as initial contents.  The text
  190.      thus inserted is treated as if the user had inserted it; the user
  191.      can alter it with Emacs editing commands.
  192.      If KEYMAP is non-`nil', that keymap is the local keymap to use
  193.      while reading.  If KEYMAP is omitted or `nil', the value of
  194.      `minibuffer-local-map' is used as the keymap.  Specifying a keymap
  195.      is the most important way to customize minibuffer input for
  196.      various applications including completion.
  197.      When the user types a command to exit the minibuffer, the current
  198.      minibuffer contents are usually made into a string which is the
  199.      value of `read-from-minibuffer'.  However, if READ is non-`nil',
  200.      Emacs converts the result to a Lisp object and
  201.      `read-from-minibuffer' returns that object, unevaluated.
  202.      Suppose, for example, you are writing a search command and want to
  203.      record the last search string and provide it as a default for the
  204.      next search.  Suppose that the previous search string is stored in
  205.      the variable `last-search-string'.  Here is how you can read a
  206.      search string while providing the previous string as initial input
  207.      to be edited:
  208.           (read-from-minibuffer "Find string: " last-search-string)
  209.      Assuming the value of `last-search-string' is `No', and the user
  210.      wants to search for `Nope', the interaction looks like this:
  211.           (setq last-search-string "No")
  212.           
  213.           (read-from-minibuffer "Find string: " last-search-string)
  214.           ---------- Buffer: Minibuffer ----------
  215.           Find string: No-!-
  216.           ---------- Buffer: Minibuffer ----------
  217.           ;; The user now types `pe RET':
  218.                => "Nope"
  219.  -- Function: read-string PROMPT &optional INITIAL
  220.      This function reads a string from the minibuffer and returns it. 
  221.      The arguments PROMPT and INITIAL are used as in
  222.      `read-from-minibuffer'.
  223.      This function is a simplified interface to `read-from-minibuffer':
  224.           (read-string PROMPT INITIAL)
  225.           ==
  226.           (read-from-minibuffer PROMPT INITIAL nil nil)
  227.  -- Variable: minibuffer-local-map
  228.      This is the default local keymap for reading from the minibuffer. 
  229.      It is the keymap used by the minibuffer for local bindings in the
  230.      function `read-string'.  By default, it makes the following
  231.      bindings:
  232.     LFD
  233.           `exit-minibuffer'
  234.     RET
  235.           `exit-minibuffer'
  236.     `C-g'
  237.           `abort-recursive-edit'
  238.  -- Function: read-no-blanks-input PROMPT INITIAL
  239.      This function reads a string from the minibuffer, but does not
  240.      allow whitespace characters as part of the input: instead, those
  241.      characters terminate the input.  The arguments PROMPT and INITIAL
  242.      are used as in `read-from-minibuffer'.
  243.      This function is a simplified interface to `read-from-minibuffer',
  244.      and passes the value of `minibuffer-local-ns-map' as the KEYMAP
  245.      argument for that function.  Since the keymap
  246.      `minibuffer-local-ns-map' does not rebind `C-q', it *is* possible
  247.      to put a space into the string, by quoting it.
  248.           (read-no-blanks-input PROMPT INITIAL)
  249.           ==
  250.           (read-from-minibuffer PROMPT INITIAL minibuffer-local-ns-map)
  251.  -- Variable: minibuffer-local-ns-map
  252.      This built-in variable is the keymap used as the minibuffer local
  253.      keymap in the function `read-no-blanks-input'.  By default, it
  254.      makes the following bindings:
  255.     `LFD'
  256.           `exit-minibuffer'
  257.     `SPC'
  258.           `exit-minibuffer'
  259.     `TAB'
  260.           `exit-minibuffer'
  261.     `RET'
  262.           `exit-minibuffer'
  263.     `C-g'
  264.           `abort-recursive-edit'
  265.     `?'
  266.           `self-insert-and-exit'
  267. File: elisp,  Node: Object from Minibuffer,  Next: Completion,  Prev: Text from Minibuffer,  Up: Minibuffers
  268. Reading Lisp Objects with the Minibuffer
  269. ========================================
  270.    This section describes functions for reading Lisp objects with the
  271. minibuffer.
  272.  -- Function: read-minibuffer PROMPT &optional INITIAL
  273.      This function reads a Lisp object in the minibuffer and returns it,
  274.      unevaluated.  The arguments PROMPT and INITIAL are used as in
  275.      `read-from-minibuffer'; in particular, INITIAL must be a string or
  276.      `nil'.
  277.      This function is a simplified interface to `read-from-minibuffer':
  278.           (read-minibuffer PROMPT INITIAL)
  279.           ==
  280.           (read-from-minibuffer PROMPT INITIAL nil t)
  281.      Here is an example in which we supply the string `"(testing)"' as
  282.      initial input:
  283.           (read-minibuffer "Enter an expression: " (format "%s" '(testing)))
  284.           
  285.           ;;  Here is how the minibuffer is displayed:
  286.           
  287.           ---------- Buffer: Minibuffer ----------
  288.           Enter an expression: (testing)-!-
  289.           ---------- Buffer: Minibuffer ----------
  290.      The user can type RET immediately to use the initial input as a
  291.      default, or can edit the input.
  292.  -- Function: eval-minibuffer PROMPT &optional INITIAL
  293.      This function reads a Lisp expression in the minibuffer, evaluates
  294.      it, then returns the result.  The arguments PROMPT and INITIAL are
  295.      used as in `read-from-minibuffer'.
  296.      This function simply evaluates the result of a call to
  297.      `read-minibuffer':
  298.           (eval-minibuffer PROMPT INITIAL)
  299.           ==
  300.           (eval (read-minibuffer PROMPT INITIAL))
  301.  -- Function: edit-and-eval-command PROMPT FORM
  302.      This function reads a Lisp expression in the minibuffer, and then
  303.      evaluates it.  The difference between this command and
  304.      `eval-minibuffer' is that here the initial FORM is not optional
  305.      and it is treated as a Lisp object to be converted to printed
  306.      representation rather than as a string of text.  It is printed with
  307.      `prin1', so if it is a string, double-quote characters (`"') will
  308.      appear in the initial text.  *Note Output Functions::.
  309.      The first thing `edit-and-eval-command' does is to activate the
  310.      minibuffer with PROMPT as the prompt.  The printed representation
  311.      of FORM is then inserted in the minibuffer, and the user is
  312.      allowed to edit.  When the user exits the minibuffer, the edited
  313.      text is read with `read' and then evaluated.  The resulting value
  314.      becomes the value of `edit-and-eval-command'.
  315.      In the following example, we offer the user an expression with
  316.      initial text which is a valid form already:
  317.           (edit-and-eval-command "Please edit: " '(forward-word 1))
  318.           
  319.           ;; After evaluating the preceding expression,
  320.           ;; the following appears in the minibuffer:
  321.           
  322.           ---------- Buffer: Minibuffer ----------
  323.           Please edit: (forward-word 1)-!-
  324.           ---------- Buffer: Minibuffer ----------
  325.      Typing RET right away would exit the minibuffer and evaluate the
  326.      expression, thus moving point forward one word.
  327.      `edit-and-eval-command' returns `nil' in this example.
  328. File: elisp,  Node: Completion,  Next: Yes-or-No Queries,  Prev: Object from Minibuffer,  Up: Minibuffers
  329. Completion
  330. ==========
  331.    "Completion" is a feature that fills in the rest of a name starting
  332. from an abbreviation for it.  Completion works by comparing the user's
  333. input against a list of valid names and determining how much of the
  334. name is determined uniquely by what the user has typed.
  335.    For example, when you type `C-x b' (`switch-to-buffer') and then
  336. type the first few letters of the name of the buffer to which you wish
  337. to switch, and then type TAB (`minibuffer-complete'), Emacs extends the
  338. name as far as it can.  Standard Emacs commands offer completion for
  339. names of symbols, files, buffers, and processes; with the functions in
  340. this section, you can implement completion for other kinds of names.
  341.    The `try-completion' function is the basic primitive for completion:
  342. it returns the longest determined completion of a given initial string,
  343. with a given set of strings to match against.
  344.    The function `completing-read' provides a higher-level interface for
  345. completion.  A call to `completing-read' specifies how to determine the
  346. list of valid names.  The function then activates the minibuffer with a
  347. local keymap that binds a few keys to commands useful for completion. 
  348. Other functions provide convenient simple interfaces for reading
  349. certain kinds of names with completion.
  350. * Menu:
  351. * Basic Completion::       Low-level functions for completing strings.
  352.                              (These are too low level to use the minibuffer.)
  353. * Programmed Completion::  Finding the completions for a given file name.
  354. * Minibuffer Completion::  Invoking the minibuffer with completion.
  355. * Completion Commands::    Minibuffer commands that do completion.
  356. * High-Level Completion::  Convenient special cases of completion
  357.                              (reading buffer name, file name, etc.)
  358. * Reading File Names::     Using completion to read file names.
  359. * Lisp Symbol Completion:: Completing the name of a symbol.
  360. File: elisp,  Node: Basic Completion,  Next: Programmed Completion,  Prev: Completion,  Up: Completion
  361. Basic Completion Functions
  362. --------------------------
  363.  -- Function: try-completion STRING ALIST-OR-OBARRAY &optional PREDICATE
  364.      This function returns the longest common substring of all possible
  365.      completions of STRING in ALIST-OR-OBARRAY.
  366.      If ALIST-OR-OBARRAY is an association list (*note Association
  367.      Lists::.), the CAR of each cons cell in it is compared against
  368.      STRING; if the beginning of the CAR equals STRING, the cons cell
  369.      matches.  If no cons cells match, `try-completion' returns `nil'. 
  370.      If only one cons cell matches, and the match is exact, then
  371.      `try-completion' returns `t'.  Otherwise, all matching strings are
  372.      compared, and the longest initial sequence common to them is
  373.      returned as a string.
  374.      If ALIST-OR-OBARRAY is an obarray (*note Creating Symbols::.), the
  375.      names of all symbols in the obarray form the space of possible
  376.      names.  They are tested and used just like the CARs of the elements
  377.      of an association list.  (The global variable `obarray' holds an
  378.      obarray containing the names of all interned Lisp symbols.)
  379.      If the argument PREDICATE is non-`nil', then it must be a function
  380.      of one argument.  It is used to test each possible match, and the
  381.      match is accepted only if PREDICATE returns non-`nil'. The
  382.      argument given to PREDICATE is either a cons cell from the alist
  383.      (the CAR of which is a string) or else it is a symbol (*not* a
  384.      symbol name) from the obarray.
  385.      It is also possible to use a function as ALIST-OR-OBARRAY.  Then
  386.      the function is solely responsible for performing completion;
  387.      `try-completion' returns whatever this function returns.  The
  388.      function is called with three arguments: STRING, PREDICATE and
  389.      `nil'.  (The reason for the third argument is so that the same
  390.      function can be used in `all-completions' and do the appropriate
  391.      thing in either case.)  *Note Programmed Completion::.
  392.      In the first of the following examples, the string `foo' is
  393.      matched by three of the alist CARs.  All of the matches begin with
  394.      the characters `fooba', so that is the result.  In the second
  395.      example, there is only one possible match, and it is exact, so the
  396.      value is `t'.
  397.           (try-completion "foo"
  398.                '(("foobar1" 1) ("barfoo" 2) ("foobaz" 3) ("foobar2" 4)))
  399.                => "fooba"
  400.           
  401.           (try-completion "foo" '(("barfoo" 2) ("foo" 3)))
  402.                => t
  403.      In the following example, numerous symbols begin with the
  404.      characters `forw', and all of them begin with the word `forward'. 
  405.      In most of the symbols, this is followed with a `-', but not in
  406.      all, so no more than `forward' can be completed.
  407.           (try-completion "forw" obarray)
  408.                => "forward"
  409.      Finally, in the following example, only two of the three possible
  410.      matches pass the predicate `test' (the string `foobaz' is too
  411.      short).  Both of those begin with the string `foobar'.
  412.           (defun test (s)
  413.             (> (length (car s)) 6))
  414.                => test
  415.           (try-completion "foo"
  416.                '(("foobar1" 1) ("barfoo" 2) ("foobaz" 3) ("foobar2" 4))
  417.                'test)
  418.                => "foobar"
  419.  -- Function: all-completions STRING ALIST-OR-OBARRAY &optional
  420.           PREDICATE
  421.      This function returns a list of all possible completions, instead
  422.      of the longest substring they share.  The parameters to this
  423.      function are the same as to `try-completion'.
  424.      If ALIST-OR-OBARRAY is a function, it is called with three
  425.      arguments: STRING, PREDICATE and `t', and `all-completions'
  426.      returns whatever the function returns. *Note Programmed
  427.      Completion::.
  428.      Here is an example, using the same function `test' used in the
  429.      example for `try-completion':
  430.           (defun test (s)
  431.             (> (length (car s)) 6))
  432.                => test
  433.           
  434.           (all-completions  "foo"
  435.                '(("foobar1" 1) ("barfoo" 2) ("foobaz" 3) ("foobar2" 4))
  436.                (function test))
  437.                => ("foobar1" "foobar2")
  438.  -- Variable: completion-ignore-case
  439.      If the value of this variable is non-`nil', Emacs does not
  440.      consider case significant in completion.
  441.    The two functions `try-completion' and `all-completions' have
  442. nothing in themselves to do with minibuffers.  However, completion is
  443. most often used there, which is why it is described in this chapter.
  444. File: elisp,  Node: Programmed Completion,  Next: Minibuffer Completion,  Prev: Basic Completion,  Up: Completion
  445. Programmed Completion
  446. ---------------------
  447.    Sometimes it is not possible to create an alist or an obarray
  448. containing all the intended possible completions.  In such a case, you
  449. can supply your own function to compute the completion of a given
  450. string. This is called "programmed completion".
  451.    To use this feature, pass the function as the ALIST-OR-OBARRAY
  452. argument to `completing-read'.  This command will arrange to pass the
  453. function along to `try-completion' and `all-completions', which will
  454. then let your function do all the work.
  455.    The completion function should accept three arguments:
  456.    * The string to be completed.
  457.    * The predicate function to filter possible matches, or `nil' if
  458.      none. Your function should call the predicale for each possible
  459.      match and ignore the possible match if the predicate returns `nil'.
  460.    * A flag specifying the type of operation.
  461.    There are three flag values for three operations:
  462.    * `nil' specifies `try-completion'.  The completion function should
  463.      return the completion of the specified string, or `t' if the
  464.      string is an exact match already, or `nil' if the string matches no
  465.      possibility.
  466.    * `t' specifies `all-completions'.  The completion function should
  467.      return a list of all possible completions of the specified string.
  468.    * `lambda' specifies a test for an exact match.  The completion
  469.      function should return `t' if the specified string is an exact
  470.      match for some possibility; `nil' otherwise.
  471.    Emacs uses programmed completion when completing file names. *Note
  472. File Name Completion::.
  473. File: elisp,  Node: Minibuffer Completion,  Next: Completion Commands,  Prev: Programmed Completion,  Up: Completion
  474. Completion and the Minibuffer
  475. -----------------------------
  476.    This section describes the basic interface for reading from the
  477. minibuffer with completion.
  478.  -- Function: completing-read PROMPT ALIST-OR-OBARRAY &optional
  479.           PREDICATE REQUIRE-MATCH INITIAL
  480.      This function reads a string in the minibuffer, assisting the user
  481.      by providing completion.  It activates the minibuffer with prompt
  482.      PROMPT, which must be a string.  If INITIAL is non-`nil',
  483.      `completing-read' inserts it into the minibuffer as part of the
  484.      input.  Then it allows the user to edit the input, providing
  485.      several commands to attempt completion.
  486.      The actual completion is done by passing ALIST-OR-OBARRAY and
  487.      PREDICATE to the function `try-completion'.  This happens in
  488.      certain commands bound in the local keymaps used for completion.
  489.      If REQUIRE-MATCH is `t', the user will not be allowed to exit
  490.      unless the input completes to an element of ALIST-OR-OBARRAY. If
  491.      REQUIRE-MATCH is neither `nil' nor `t', then `completing-read'
  492.      does not exit unless the input typed is itself an element of
  493.      ALIST-OR-OBARRAY.  To accomplish this, `completing-read' calls
  494.      `read-minibuffer' with the keymap
  495.      `minibuffer-local-completion-map' if REQUIRE-MATCH is `nil', or
  496.      else with the keymap `minibuffer-local-must-match-map', if
  497.      REQUIRE-MATCH is non-`nil'.
  498.      Case is ignored when comparing the input against the possible
  499.      matches if the built-in variable `completion-ignore-case' is
  500.      non-`nil'.  *Note Basic Completion::.
  501.      For example:
  502.           (completing-read "Complete a foo: "
  503.                '(("foobar1" 1) ("barfoo" 2) ("foobaz" 3) ("foobar2" 4))
  504.                nil t "fo")
  505.           
  506.           ;; After evaluating the preceding expression,
  507.           ;; the following appears in the minibuffer:
  508.           
  509.           ---------- Buffer: Minibuffer ----------
  510.           Complete a foo: fo-!-
  511.           ---------- Buffer: Minibuffer ----------
  512.      If the user then types `DEL DEL b RET', `completing-read' returns
  513.      `barfoo'.
  514.      The `completing-read' function binds three variables to pass
  515.      information to the commands which actually do completion.  Here
  516.      they are:
  517.     `minibuffer-completion-table'
  518.           This variable is bound to ALIST-OR-OBARRAY argument.  It is
  519.           passed to the `try-completion' function.
  520.     `minibuffer-completion-predicate'
  521.           This variable is bound to the PREDICATE argument.  It is
  522.           passed to the `try-completion' function.
  523.     `minibuffer-completion-confirm'
  524.           This variable is bound to the REQUIRE-MATCH argument.  It is
  525.           used in the `minibuffer-complete-and-exit' function.
  526. File: elisp,  Node: Completion Commands,  Next: High-Level Completion,  Prev: Minibuffer Completion,  Up: Completion
  527. Minibuffer Commands That Do Completion
  528. --------------------------------------
  529.    This section describes the keymaps, commands and user options used in
  530. the minibuffer to do completion.
  531.  -- Variable: minibuffer-local-completion-map
  532.      `completing-read' uses this value as the local keymap when an
  533.      exact match of one of the completions is not required.  By
  534.      default, this keymap makes the following bindings:
  535.     `?'
  536.           `minibuffer-completion-help'
  537.     `SPC'
  538.           `minibuffer-complete-word'
  539.     `TAB'
  540.           `minibuffer-complete'
  541.     `LFD'
  542.           `exit-minibuffer'
  543.     `RET'
  544.           `exit-minibuffer'
  545.     `C-g'
  546.           `abort-recursive-edit'
  547.  -- Variable: minibuffer-local-must-match-map
  548.      `completing-read' uses this value as the local keymap when an
  549.      exact match of one of the completions is required.  Therefore, no
  550.      keys are bound to `exit-minibuffer', the command which exits the
  551.      minibuffer unconditionally.  By default, this keymap makes the
  552.      following bindings:
  553.     `?'
  554.           `minibuffer-completion-help'
  555.     `SPC'
  556.           `minibuffer-complete-word'
  557.     `TAB'
  558.           `minibuffer-complete'
  559.     `LFD'
  560.           `minibuffer-complete-and-exit'
  561.     `RET'
  562.           `minibuffer-complete-and-exit'
  563.     `C-g'
  564.           `abort-recursive-edit'
  565.  -- Variable: minibuffer-completion-table
  566.      The value of this variable is the alist or obarray used for
  567.      completion in the minibuffer.  This is the global variable that
  568.      contains what `completing-read' passes to `try-completion'.  It is
  569.      used by all the minibuffer completion functions, such as
  570.      `minibuffer-complete-word'.
  571.  -- Variable: minibuffer-completion-predicate
  572.      The value of this variable is the predicate that `completing-read'
  573.      passes to `try-completion'.  The variable is also used by the
  574.      other minibuffer completion functions.
  575.  -- Command: minibuffer-complete-word
  576.      This function completes the minibuffer contents by at most a single
  577.      word.  Even if the minibuffer contents has only one completion,
  578.      `minibuffer-complete-word' will not add any characters beyond the
  579.      first character that is not a word constituent.  *Note Syntax
  580.      Tables::.
  581.  -- Command: minibuffer-complete
  582.      This function completes the minibuffer contents as far as possible.
  583.  -- Command: minibuffer-complete-and-exit
  584.      This function completes the minibuffer contents, and exits if
  585.      confirmation is not required, i.e., if
  586.      `minibuffer-completion-confirm' is non-`nil'.  If confirmation
  587.      *is* required, it is given by repeating this command immediately.
  588.  -- Variable: minibuffer-completion-confirm
  589.      When the value of this variable is non-`nil', Emacs asks for
  590.      confirmation of a completion before exiting the minibuffer.  The
  591.      function `minibuffer-complete-and-exit' checks the value of this
  592.      variable before it exits.
  593.  -- Command: minibuffer-completion-help
  594.      This function creates a list of the possible completions of the
  595.      current minibuffer contents.  It works by calling
  596.      `all-completions'; the values of `minibuffer-completion-table' and
  597.      `minibuffer-completion-predicate' are used as arguments.  The list
  598.      of completions is displayed as text in a buffer named
  599.      `*Completions*'.
  600.  -- Function: display-completion-list COMPLETIONS
  601.      This function displays COMPLETIONS to the stream `standard-output'
  602.      (usually a buffer).  (*Note Streams::, for more information about
  603.      streams.)  The argument COMPLETIONS is normally a list of
  604.      completions just returned by `all-completions', but it does not
  605.      have to be.  Each element may be a symbol or a string, either of
  606.      which is simply printed, or a list of two strings, which is printed
  607.      as if the strings were concatenated.
  608.      This function is called by `minibuffer-completion-help'.
  609.  -- User Option: completion-auto-help
  610.      If this variable is non-`nil', the completion commands
  611.      automatically display a list of possible completions whenever
  612.      nothing can be completed because the next character is not
  613.      uniquely determined.
  614. File: elisp,  Node: High-Level Completion,  Next: Reading File Names,  Prev: Completion Commands,  Up: Completion
  615. High-Level Completion  Functions
  616. --------------------------------
  617.    This section describes the higher-level convenient functions for
  618. reading certain sorts of names with completion.
  619.  -- Function: read-buffer PROMPT &optional DEFAULT EXISTING
  620.      This function reads the name of a buffer and returns it as a
  621.      string. The argument DEFAULT is the default name to use, the value
  622.      to return if the user exits with an empty minibuffer.  If
  623.      non-`nil', it should be a string.  It is mentioned in the prompt,
  624.      but is not inserted in the minibuffer as initial input.
  625.      If EXISTING is non-`nil', then the name specified must be that of
  626.      an  existing buffer.  The usual commands to exit the minibuffer
  627.      will not exit if the text is not valid, and RET will do completion
  628.      to attempt to find a valid name.  (However, DEFAULT is not checked
  629.      for this; it is returned, whatever it is, if the user exits with
  630.      the minibuffer empty.)
  631.      In the following example, the user enters `minibuffer.t', and then
  632.      types RET.  The argument EXISTING is `t', and the only buffer name
  633.      starting with the given input is `minibuffer.texi', so that name
  634.      is the value.
  635.           (read-buffer "Buffer name? " "foo" t)
  636.           
  637.           ;; After evaluating the preceding expression,
  638.           ;; the following prompt appears, with an empty minibuffer:
  639.           
  640.           ---------- Buffer: Minibuffer ----------
  641.           Buffer name? (default foo) -!-
  642.           ---------- Buffer: Minibuffer ----------
  643.           
  644.           ;; The user types `minibuffer.t RET'.
  645.           
  646.                => "minibuffer.texi"
  647.  -- Function: read-command PROMPT
  648.      This function reads the name of a command and returns it as a Lisp
  649.      symbol.  The argument PROMPT is used as in `read-from-minibuffer'.
  650.       Recall that a command is anything for which `commandp' returns
  651.      `t', and a command name is a symbol for which `commandp' returns
  652.      `t'.  *Note Interactive Call::.
  653.           (read-command "Command name? ")
  654.           
  655.           ;; After evaluating the preceding expression,
  656.           ;; the following appears in the minibuffer:
  657.           
  658.           ---------- Buffer: Minibuffer ----------
  659.           Command name?
  660.           ---------- Buffer: Minibuffer ----------
  661.      If the user types `forward-c RET', then this function returns
  662.      `forward-char'.
  663.      The `read-command' function is a simplified interface to
  664.      `completing-read'.  It uses the `commandp' predicate to allow only
  665.      commands to be entered, and it uses the variable `obarray' so as
  666.      to be able to complete all extant Lisp symbols:
  667.           (read-command PROMPT)
  668.           ==
  669.           (intern (completing-read PROMPT obarray 'commandp t nil))
  670.  -- Function: read-variable PROMPT
  671.      This function reads the name of a user variable and returns it as a
  672.      symbol.
  673.           (read-variable "Variable name? ")
  674.           
  675.           ;; After evaluating the preceding expression,
  676.           ;; the following prompt appears with an empty minibuffer:
  677.           
  678.           ---------- Buffer: Minibuffer ----------
  679.           Variable name? -!-
  680.           ---------- Buffer: Minibuffer ----------
  681.      If the user then types `fill-p RET', `read-variable' will return
  682.      `fill-prefix'.
  683.      This function is similar to `read-command', but uses the predicate
  684.      `user-variable-p' instead of `commandp':
  685.           (read-variable PROMPT)
  686.           ==
  687.           (intern (completing-read PROMPT obarray 'user-variable-p t nil))
  688. File: elisp,  Node: Reading File Names,  Next: Lisp Symbol Completion,  Prev: High-Level Completion,  Up: Completion
  689. Reading File Names
  690. ------------------
  691.    Here is another high-level completion function, designed for reading
  692. a file name.  It provides special features including automatic insertion
  693. of the default directory.
  694.  -- Function: read-file-name PROMPT &optional DIRECTORY DEFAULT EXISTING
  695.      This function reads a file name in the minibuffer, prompting with
  696.      PROMPT and providing completion.  If DEFAULT is non-`nil', then
  697.      the value of DEFAULT will be returned by the function if the user
  698.      just types RET.
  699.      If EXISTING is non-`nil', then the name must refer to an existing
  700.      file; then RET performs completion to make the name valid if
  701.      possible, and then refuses to exit if it is not valid.  If the
  702.      value of EXISTING is neither `nil' nor `t', then RET also requires
  703.      confirmation after completion.
  704.      The argument DIRECTORY specifies the directory to use for
  705.      completion of relative file names.  Usually it is inserted in the
  706.      minibuffer as initial input as well.  It defaults to the current
  707.      buffer's default directory.
  708.      Here is an example:
  709.           (read-file-name "The file is ")
  710.           
  711.           ;; After evaluating the preceding expression,
  712.           ;; the following appears in the minibuffer:
  713.           
  714.           ---------- Buffer: Minibuffer ----------
  715.           The file is /gp/gnu/elisp/-!-
  716.           ---------- Buffer: Minibuffer ----------
  717.      Typing `manual TAB' results in the following:
  718.           ---------- Buffer: Minibuffer ----------
  719.           The file is /gp/gnu/elisp/manual.texi-!-
  720.           ---------- Buffer: Minibuffer ----------
  721.      If the user types RET, `read-file-name' returns
  722.      `"/gp/gnu/elisp/manual.texi"'.
  723.  -- User Option: insert-default-directory
  724.      This variable is used by `read-file-name'.  The value of this
  725.      variable controls whether `read-file-name' starts by placing the
  726.      name of the default directory in the minibuffer.  If the value of
  727.      this variable is `nil', then `read-file-name' does not place any
  728.      initial input in the minibuffer.  In that case, the default
  729.      directory is still used for completion of relative file names, but
  730.      is not displayed.
  731.      For example:
  732.           ;; Here the minibuffer starts out containing the default directory.
  733.           
  734.           (let ((insert-default-directory t))
  735.             (read-file-name "The file is "))
  736.           
  737.           ---------- Buffer: Minibuffer ----------
  738.           The file is ~lewis/manual/-!-
  739.           ---------- Buffer: Minibuffer ----------
  740.           
  741.           ;; Here the minibuffer is empty and only the prompt appears on its line.
  742.           
  743.           (let ((insert-default-directory nil))
  744.             (read-file-name "The file is "))
  745.           
  746.           ---------- Buffer: Minibuffer ----------
  747.           The file is -!-
  748.           ---------- Buffer: Minibuffer ----------
  749. File: elisp,  Node: Lisp Symbol Completion,  Prev: Reading File Names,  Up: Completion
  750. Lisp Symbol Completion
  751. ----------------------
  752.    If you type a part of a symbol, and then type `M-TAB'
  753. (`lisp-complete-symbol'), it will attempt to fill in as much more of
  754. the symbol name as it can.  Not only does this save typing, but it can
  755. help you with the name of a symbol that you have partially forgotten.
  756.  -- Command: lisp-complete-symbol
  757.      This function performs completion on the symbol name preceding
  758.      point. The name is completed against the symbols in the global
  759.      variable `obarray', and characters from the completion are
  760.      inserted into the buffer, making the name longer.  If there is
  761.      more than one completion, a list of all possible completions is
  762.      placed in the `*Help*' buffer. The bell rings if there is no
  763.      possible completion in `obarray'.
  764.      If an open parenthesis immediately precedes the name, only symbols
  765.      with function definitions are considered.  (By reducing the number
  766.      of alternatives, this may succeed in completing more characters.)
  767.      Otherwise, symbols with either a function definition, a value, or
  768.      at least one property are considered.
  769.      `lisp-complete-symbol' returns `t' if the symbol had an exact, and
  770.      unique, match; otherwise, it returns `nil'.
  771.      In the following example, the user has already inserted `(forwa'
  772.      into the buffer `foo.el'.  The command `lisp-complete-symbol' then
  773.      completes the name to `(forward-'.
  774.           ---------- Buffer: foo.el ----------
  775.           (forwa-!-
  776.           ---------- Buffer: foo.el ----------
  777.           
  778.           (lisp-complete-symbol)
  779.                => nil
  780.           
  781.           ---------- Buffer: foo.el ----------
  782.           (forward--!-
  783.           ---------- Buffer: foo.el ----------
  784. File: elisp,  Node: Yes-or-No Queries,  Next: Minibuffer Misc,  Prev: Completion,  Up: Minibuffers
  785. Yes-or-No Queries
  786. =================
  787.    This section describes functions used to ask the user a yes-or-no
  788. question.  The function `y-or-n-p' can be answered with a single
  789. character; it is useful for questions where an inadvertent wrong answer
  790. will not have serious consequences.  `yes-or-no-p' is suitable for more
  791. momentous questions, since it requires three or four characters to
  792. answer.
  793.    Strictly speaking, `yes-or-no-p' uses the minibuffer and `y-or-n-p'
  794. does not; but it seems best to describe them together.
  795.  -- Function: y-or-n-p PROMPT
  796.      This function asks the user a question, expecting input in the echo
  797.      area.  It returns `t' if the user types `y', `nil' if the user
  798.      types `n'.  This function also accepts SPC to mean yes and DEL to
  799.      mean no.  The answer is a single character, with no RET needed to
  800.      terminate it.  Upper and lower case are equivalent.
  801.      "Asking the question" means printing PROMPT in the echo area,
  802.      followed by the string `(y or n) '.  If the input is not one of the
  803.      expected answers (`y', `n', `SPC', or `DEL'), the function
  804.      responds `Please answer y or n.', and repeats the request.
  805.      This function does not actually use the minibuffer, since it does
  806.      not allow editing of the answer.  It actually uses the echo area
  807.      (*note The Echo Area::.), which uses the same screen space as the
  808.      minibuffer.  The cursor moves to the echo area while the question
  809.      is being asked.
  810.      In the following example, the user first types `q', which is
  811.      invalid.  At the next prompt the user types `n'.
  812.           (y-or-n-p "Do you need a lift? ")
  813.           
  814.           ;; After evaluating the preceding expression,
  815.           ;; the following prompt appears in the echo area:
  816.           
  817.           ---------- Echo area ----------
  818.           Do you need a lift? (y or n)
  819.           ---------- Echo area ----------
  820.           
  821.           ;; If the user then types `q', the following appears:
  822.           
  823.           ---------- Echo area ----------
  824.           Please answer y or n.  Do you need a lift? (y or n)
  825.           ---------- Echo area ----------
  826.           
  827.           ;; When the user types a valid answer, it is displayed after the question:
  828.           
  829.           ---------- Echo area ----------
  830.           Do you need a lift? (y or n) y
  831.           ---------- Echo area ----------
  832.      Note that we show successive lines of echo area messages here. 
  833.      Only one will appear on the screen at a time.
  834.  -- Function: yes-or-no-p PROMPT
  835.      This function asks the user a question, expecting input in
  836.      minibuffer. It returns `t' if the user enters `yes', `nil' if the
  837.      user types `no'.  The user must type RET to finalize the response.
  838.       Upper and lower case are equivalent.
  839.      `yes-or-no-p' starts by displaying PROMPT in the echo area,
  840.      followed by `(yes or no) '.  The user must type one of the
  841.      expected responses; otherwise, the function responds `Please answer
  842.      yes or no.', waits about two seconds and repeats the request.
  843.      `yes-or-no-p' requires more work from the user than `y-or-n-p' and
  844.      is appropriate for more crucial decisions.
  845.      Here is an example:
  846.           (yes-or-no-p "Do you really want to remove your entire directory? ")
  847.           
  848.           ;; After evaluating the preceding expression,
  849.           ;; the following prompt appears with an empty minibuffer:
  850.           
  851.           ---------- Buffer: minibuffer ----------
  852.           Do you really want to remove your entire directory? (yes or no)
  853.           ---------- Buffer: minibuffer ----------
  854.      If the user first types `y RET', which is invalid because this
  855.      function demands the entire word `yes', it responds by displaying
  856.      these prompts, with a brief pause between them:
  857.           ---------- Buffer: minibuffer ----------
  858.           Please answer yes or no.
  859.           Do you really want to remove your entire directory? (yes or no)
  860.           ---------- Buffer: minibuffer ----------
  861. File: elisp,  Node: Minibuffer Misc,  Prev: Yes-or-No Queries,  Up: Minibuffers
  862. Minibuffer Miscellany
  863. =====================
  864.    Some basic minibuffer functions and variables are described in this
  865. section.
  866.  -- Command: exit-minibuffer
  867.      This function exits the active minibuffer.  It is normally bound to
  868.      keys in minibuffer local keymaps.
  869.  -- Command: self-insert-and-exit
  870.      This function exits the active minibuffer after inserting the last
  871.      character typed on the keyboard (found in `last-command-char';
  872.      *note Command Loop Info::.).
  873.  -- Variable: minibuffer-help-form
  874.      The current value of this variable is used to rebind `help-form'
  875.      locally inside the minibuffer (*note Help Functions::.).
  876.  -- Function: minibuffer-window
  877.      This function returns the window that is used for the minibuffer.
  878.      There is one and only one minibuffer window in Emacs 18; this
  879.      window always exists and cannot be deleted.
  880.  -- Variable: minibuffer-scroll-window
  881.      If the value of this variable is non-`nil', it should be a window
  882.      object.  When the function `scroll-other-window' is called in the
  883.      minibuffer, it will scroll the `minibuffer-scroll-window' window.
  884.    Finally, some functions and variables deal with recursive minibuffers
  885. (*note Recursive Editing::.):
  886.  -- Function: minibuffer-depth
  887.      This function returns the current depth of activations of the
  888.      minibuffer, a nonnegative integer.  If no minibuffers are active,
  889.      it returns zero.
  890.  -- User Option: enable-recursive-minibuffers
  891.      If this variable is non-`nil', you can invoke commands (such as
  892.      `find-file') which use minibuffers even while in the minibuffer
  893.      window.  Such invocation produces a recursive editing level for a
  894.      new minibuffer.  The outer-level minibuffer is invisible while you
  895.      are editing the inner one.
  896.      This variable only affects invoking the minibuffer while the
  897.      minibuffer window is selected.   If you switch windows while in the
  898.      minibuffer, you can always invoke minibuffer commands while some
  899.      other window is selected.
  900. File: elisp,  Node: Command Loop,  Next: Keymaps,  Prev: Minibuffers,  Up: Top
  901. Command Loop
  902. ************
  903.    When you run Emacs, it enters the "editor command loop" almost
  904. immediately.  This loop reads key sequences, executes their definitions,
  905. and displays the results.  In this chapter, we describe how these things
  906. are done, and the subroutines that allow Lisp programs to do them.
  907. * Menu:
  908. * Command Overview::    How the command loop reads commands.
  909. * Defining Commands::   Specifying how a function should read arguments.
  910. * Interactive Call::    Calling a command, so that it will read arguments.
  911. * Command Loop Info::   Variables set by the command loop for you to examine.
  912. * Keyboard Input::      How your program can read characters from the keyboard.
  913. * Quitting::            How `C-g' works.  How to catch or defer quitting.
  914. * Prefix Command Arguments::    How the commands to set prefix args work.
  915. * Recursive Editing::   Entering a recursive edit,
  916.                           and why you usually shouldn't.
  917. * Disabling Commands::  How the command loop handles disabled commands.
  918. * Command History::     How the command history is set up, and how accessed.
  919. * Keyboard Macros::     How keyboard macros are implemented.
  920. File: elisp,  Node: Command Overview,  Next: Defining Commands,  Prev: Command Loop,  Up: Command Loop
  921. Command Loop Overview
  922. =====================
  923.    The first thing the command loop must do is read a key sequence,
  924. which is a sequence of characters that translates into a command.  It
  925. does this by calling the function `read-key-sequence'.  Your Lisp code
  926. can also call this function (*note Keyboard Input::.).  Lisp programs
  927. can also do input at a lower level with `read-char' or discard pending
  928. input with `discard-input'.
  929.    The key sequence is translated into a command through the keymaps of
  930. the current buffer.  *Note Keymaps::, for information on how this is
  931. done.  The result should be a keyboard macro or an interactively
  932. callable function.  If the key is `M-x', then it reads the name of
  933. another command, which is used instead.  This is done by the command
  934. `execute-extended-command' (*note Interactive Call::.).
  935.    Once the command is read, it must be executed, which includes reading
  936. arguments to be given to it.  This is done by calling `command-execute'
  937. (*note Interactive Call::.).  For commands written in Lisp, the
  938. `interactive' specification says how to read the arguments.  This may
  939. use the prefix argument (*note Prefix Command Arguments::.) or may read
  940. with prompting in the minibuffer (*note Minibuffers::.).  For example,
  941. the command `find-file' has an `interactive' specification which says
  942. to read a file name using the minibuffer.  The command's function body
  943. does not use the minibuffer; if you call this command from Lisp code as
  944. a function, you must supply the file name string as an ordinary Lisp
  945. function argument.
  946.    If the command is a string (i.e., a keyboard macro) then the function
  947. `execute-kbd-macro' is used to execute it.  You can call this function
  948. yourself (*note Keyboard Macros::.).
  949.    If a command runs away, typing `C-g' will terminate its execution
  950. immediately.  This is called "quitting" (*note Quitting::.).
  951. File: elisp,  Node: Defining Commands,  Next: Interactive Call,  Prev: Command Overview,  Up: Command Loop
  952. Defining Commands
  953. =================
  954.    A Lisp function becomes a command when its body contains, at top
  955. level, a form which calls the special form `interactive'.  This form
  956. does nothing when actually executed, but its presence serves as a flag
  957. to indicate that interactive calling is permitted.  Its argument
  958. controls the reading of arguments for an interactive call.
  959. * Menu:
  960. * Using Interactive::     General rules for `interactive'.
  961. * Interactive Codes::     The standard letter-codes for reading arguments
  962.                              in various ways.
  963. * Interactive Examples::  Examples of how to read interactive arguments.
  964.