=================
A "mapping function" applies a given function to each element of a
-list or other collection. XEmacs Lisp has three such functions;
-`mapcar' and `mapconcat', which scan a list, are described here. For
-the third mapping function, `mapatoms', see *Note Creating Symbols::.
+list or other collection. XEmacs Lisp has several such functions;
+`mapcar' and `mapconcat', which scan a list, are described here.
+*Note Creating Symbols::, for the function `mapatoms' which maps over
+the symbols in an obarray.
+
+ Mapping functions should never modify the sequence being mapped over.
+The results are unpredictable.
- Function: mapcar function sequence
`mapcar' applies FUNCTION to each element of SEQUENCE in turn, and
returns a list of the results.
- The argument SEQUENCE may be a list, a vector, or a string. The
- result is always a list. The length of the result is the same as
- the length of SEQUENCE.
+ The argument SEQUENCE can be any kind of sequence; that is, a
+ list, a vector, a bit vector, or a string. The result is always a
+ list. The length of the result is the same as the length of
+ SEQUENCE.
For example:
punctuation.
The argument FUNCTION must be a function that can take one
- argument and return a string.
+ argument and return a string. The argument SEQUENCE can be any
+ kind of sequence; that is, a list, a vector, a bit vector, or a
+ string.
(mapconcat 'symbol-name
'(The cat in the hat)
* Completion:: How to invoke and customize completion.
* Yes-or-No Queries:: Asking a question with a simple answer.
* Multiple Queries:: Asking a series of similar questions.
+* Reading a Password:: Reading a password from the terminal.
* Minibuffer Misc:: Various customization hooks and variables.
\1f
apply to minibuffers. The name of a minibuffer always has the form
` *Minibuf-NUMBER', and it cannot be changed. Minibuffers are
displayed only in special windows used only for minibuffers; these
-windows always appear at the bottom of a frame. (Sometime frames have
+windows always appear at the bottom of a frame. (Sometimes frames have
no minibuffer window, and sometimes a special kind of frame contains
nothing but a minibuffer window; see *Note Minibuffers and Frames::.)
* `minibuffer-local-map' is for ordinary input (no completion).
- * `minibuffer-local-ns-map' is similar, except that <SPC> exits just
- like <RET>. This is used mainly for Mocklisp compatibility.
-
* `minibuffer-local-completion-map' is for permissive completion.
* `minibuffer-local-must-match-map' is for strict completion and for
Defining Commands::.
- Function: read-from-minibuffer prompt-string &optional
- initial-contents keymap read hist
+ initial-contents keymap read hist abbrev-table default
This function is the most general way to get input through the
minibuffer. By default, it accepts arbitrary text and returns it
as a string; however, if READ is non-`nil', then it uses `read' to
minibuffer but put point POSITION characters from the beginning,
rather than at the end.
+ When the user types a command to exit the minibuffer,
+ `read-from-minibuffer' constructs the return value from the text in
+ the minibuffer. Normally it returns a string containing that text.
+ However, if READ is non-`nil', `read-from-minibuffer' reads the
+ text and returns the resulting Lisp object, unevaluated. (*Note
+ Input Functions::, for information about reading.)
+
+ The argument DEFAULT specifies a default value to make available
+ through the history commands. It should be a string, or `nil'.
+
If KEYMAP is non-`nil', that keymap is the local keymap to use in
the minibuffer. If KEYMAP is omitted or `nil', the value of
`minibuffer-local-map' is used as the keymap. Specifying a keymap
is the most important way to customize the minibuffer for various
applications such as completion.
+ The argument ABBREV-TABLE specifies `local-abbrev-table' in the
+ minibuffer (*note Standard Abbrev Tables::).
+
The argument HIST specifies which history list variable to use for
saving the input and for history commands used in the minibuffer.
It defaults to `minibuffer-history'. *Note Minibuffer History::.
reads the text and returns the resulting Lisp object, unevaluated.
(*Note Input Functions::, for information about reading.)
- - Function: read-string prompt &optional initial
+ *Usage note:* The INITIAL-CONTENTS argument and the DEFAULT
+ argument are two alternative features for more or less the same
+ job. It does not make sense to use both features in a single call
+ to `read-from-minibuffer'. In general, we recommend using
+ DEFAULT, since this permits the user to insert the default value
+ when it is wanted, but does not burden the user with deleting it
+ from the minibuffer on other occasions. However, if user is
+ supposed to edit default value, INITIAL-CONTENTS may be preferred.
+
+ - Function: read-string prompt &optional initial history
This function reads a string from the minibuffer and returns it.
The arguments PROMPT and INITIAL are used as in
`read-from-minibuffer'. The keymap used is `minibuffer-local-map'.
- This is a simplified interface to the `read-from-minibuffer'
- function:
+ The optional argument HISTORY, if non-nil, specifies a history
+ list and optionally the initial position in the list.
+
+ This function is a simplified interface to the
+ `read-from-minibuffer' function:
(read-string PROMPT INITIAL)
==
This is the default local keymap for reading from the minibuffer.
By default, it makes the following bindings:
- <LFD>
+ `C-j'
`exit-minibuffer'
<RET>
`M-s'
`previous-matching-history-element'
- - Function: read-no-blanks-input prompt &optional initial
- This function reads a string from the minibuffer, but does not
- allow whitespace characters as part of the input: instead, those
- characters terminate the input. The arguments PROMPT and INITIAL
- are used as in `read-from-minibuffer'.
-
- This is a simplified interface to the `read-from-minibuffer'
- function, and passes the value of the `minibuffer-local-ns-map'
- keymap as the KEYMAP argument for that function. Since the keymap
- `minibuffer-local-ns-map' does not rebind `C-q', it _is_ possible
- to put a space into the string, by quoting it.
-
- (read-no-blanks-input PROMPT INITIAL)
- ==
- (read-from-minibuffer PROMPT INITIAL minibuffer-local-ns-map)
-
- - Variable: minibuffer-local-ns-map
- This built-in variable is the keymap used as the minibuffer local
- keymap in the function `read-no-blanks-input'. By default, it
- makes the following bindings, in addition to those of
- `minibuffer-local-map':
-
- <SPC>
- `exit-minibuffer'
-
- <TAB>
- `exit-minibuffer'
-
- `?'
- `self-insert-and-exit'
-
\1f
File: lispref.info, Node: Object from Minibuffer, Next: Minibuffer History, Prev: Text from Minibuffer, Up: Minibuffers
minibuffer.
- Function: read-minibuffer prompt &optional initial
- This function reads a Lisp object in the minibuffer and returns it,
- without evaluating it. The arguments PROMPT and INITIAL are used
- as in `read-from-minibuffer'.
+ This function reads a Lisp object using the minibuffer, and
+ returns it without evaluating it. The arguments PROMPT and
+ INITIAL are used as in `read-from-minibuffer'.
This is a simplified interface to the `read-from-minibuffer'
function:
default, or can edit the input.
- Function: eval-minibuffer prompt &optional initial
- This function reads a Lisp expression in the minibuffer, evaluates
- it, then returns the result. The arguments PROMPT and INITIAL are
- used as in `read-from-minibuffer'.
+ This function reads a Lisp expression using the minibuffer,
+ evaluates it, then returns the result. The arguments PROMPT and
+ INITIAL are used as in `read-from-minibuffer'.
This function simply evaluates the result of a call to
`read-minibuffer':
The first thing `edit-and-eval-command' does is to activate the
minibuffer with PROMPT as the prompt. Then it inserts the printed
- representation of FORM in the minibuffer, and lets the user edit.
- When the user exits the minibuffer, the edited text is read with
- `read' and then evaluated. The resulting value becomes the value
- of `edit-and-eval-command'.
+ representation of FORM in the minibuffer, and lets the user edit
+ it. When the user exits the minibuffer, the edited text is read
+ with `read' and then evaluated. The resulting value becomes the
+ value of `edit-and-eval-command'.
In the following example, we offer the user an expression with
initial text which is a valid form already:
the input functions when you wish. But it is safe to modify the list
by hand when the minibuffer input functions are not using it.
+ Here are some of the standard minibuffer history list variables:
+
- Variable: minibuffer-history
The default history list for minibuffer history input.
- Function: all-completions string collection &optional predicate
nospace
This function returns a list of all possible completions of
- STRING. The parameters to this function are the same as to
+ STRING. The arguments to this function are the same as those of
`try-completion'.
If COLLECTION is a function, it is called with three arguments:
minibuffer with completion.
- Function: completing-read prompt collection &optional predicate
- require-match initial hist
+ require-match initial hist default
This function reads a string in the minibuffer, assisting the user
by providing completion. It activates the minibuffer with prompt
PROMPT, which must be a string. If INITIAL is non-`nil',
COLLECTION. If REQUIRE-MATCH is `nil', the exit commands work
regardless of the input in the minibuffer.
+ However, empty input is always permitted, regardless of the value
+ of REQUIRE-MATCH; in that case, `completing-read' returns DEFAULT.
+ The value of DEFAULT (if non-`nil') is also available to the user
+ through the history commands.
+
The user can exit with null input by typing <RET> with an empty
- minibuffer. Then `completing-read' returns `nil'. This is how
- the user requests whatever default the command uses for the value
- being read. The user can return using <RET> in this way regardless
- of the value of REQUIRE-MATCH.
+ minibuffer. Then `completing-read' returns `""'. This is how the
+ user requests whatever default the command uses for the value being
+ read. The user can return using <RET> in this way regardless of
+ the value of REQUIRE-MATCH, and regardless of whether the empty
+ string is included in COLLECTION.
The function `completing-read' works by calling `read-minibuffer'.
It uses `minibuffer-local-completion-map' as the keymap if
<TAB>
`minibuffer-complete'
- <LFD>
+ `C-j'
`minibuffer-complete-and-exit'
<RET>
- Command: minibuffer-complete-and-exit
This function completes the minibuffer contents, and exits if
confirmation is not required, i.e., if
- `minibuffer-completion-confirm' is non-`nil'. If confirmation
- _is_ required, it is given by repeating this command
- immediately--the command is programmed to work without confirmation
- when run twice in succession.
+ `minibuffer-completion-confirm' is `nil'. If confirmation _is_
+ required, it is given by repeating this command immediately--the
+ command is programmed to work without confirmation when run twice
+ in succession.
- Variable: minibuffer-completion-confirm
When the value of this variable is non-`nil', XEmacs asks for
`default-directory'.
If you specify INITIAL, that is an initial file name to insert in
- the buffer (after with DIRECTORY, if that is inserted). In this
- case, point goes at the beginning of INITIAL. The default for
- INITIAL is `nil'--don't insert any file name. To see what INITIAL
- does, try the command `C-x C-v'.
+ the buffer (after DIRECTORY, if that is inserted). In this case,
+ point goes at the beginning of INITIAL. The default for INITIAL
+ is `nil'--don't insert any file name. To see what INITIAL does,
+ try the command `C-x C-v'.
Here is an example:
* `nil' specifies `try-completion'. The completion function should
return the completion of the specified string, or `t' if the
- string is an exact match already, or `nil' if the string matches no
- possibility.
+ string is a unique and exact match already, or `nil' if the string
+ matches no possibility.
+
+ If the string is an exact match for one possibility, but also
+ matches other longer possibilities, the function should return the
+ string, not `t'.
* `t' specifies `all-completions'. The completion function should
return a list of all possible completions of the specified string.
dialog box or the minibuffer, as appropriate.
\1f
-File: lispref.info, Node: Multiple Queries, Next: Minibuffer Misc, Prev: Yes-or-No Queries, Up: Minibuffers
+File: lispref.info, Node: Multiple Queries, Next: Reading a Password, Prev: Yes-or-No Queries, Up: Minibuffers
Asking Multiple Y-or-N Questions
================================
on.
\1f
-File: lispref.info, Node: Minibuffer Misc, Prev: Multiple Queries, Up: Minibuffers
+File: lispref.info, Node: Reading a Password, Next: Minibuffer Misc, Prev: Multiple Queries, Up: Minibuffers
+
+Reading a Password
+==================
+
+ To read a password to pass to another program, you can use the
+function `read-passwd'.
+
+ - Function: read-passwd prompt &optional confirm default
+ This function reads a password, prompting with PROMPT. It does
+ not echo the password as the user types it; instead, it echoes `.'
+ for each character in the password.
+
+ The optional argument CONFIRM, if non-`nil', says to read the
+ password twice and insist it must be the same both times. If it
+ isn't the same, the user has to type it over and over until the
+ last two times match.
+
+ The optional argument DEFAULT specifies the default password to
+ return if the user enters empty input. It is translated to `.'
+ and inserted in the minibuffer. If DEFAULT is `nil', then
+ `read-passwd' returns the null string in that case.
+
+ - User Option: passwd-invert-frame-when-keyboard-grabbed
+ If non-nil swap the foreground and background colors of all faces
+ while reading a password. Default values is `t' unless feature
+ `infodock' is provided.
+
+ - User Option: passwd-echo
+ This specifies the character echoed when typing a password. When
+ nil, nothing is echoed.
+
+\1f
+File: lispref.info, Node: Minibuffer Misc, Prev: Reading a Password, Up: Minibuffers
Minibuffer Miscellany
=====================
- User Option: enable-recursive-minibuffers
If this variable is non-`nil', you can invoke commands (such as
- `find-file') that use minibuffers even while in the minibuffer
- window. Such invocation produces a recursive editing level for a
- new minibuffer. The outer-level minibuffer is invisible while you
- are editing the inner one.
+ `find-file') that use minibuffers even while the minibuffer window
+ is active. Such invocation produces a recursive editing level for
+ a new minibuffer. The outer-level minibuffer is invisible while
+ you are editing the inner one.
This variable only affects invoking the minibuffer while the
minibuffer window is selected. If you switch windows while in the
want to explicitly set the value of `enable-recursive-minibuffers' in
this fashion, just use an evaluated interactive spec and bind
`enable-recursive-minibuffers' while reading from the minibuffer. See
-the definition of `next-matching-history-element' in
-`lisp/prim/minibuf.el'.
+the definition of `next-matching-history-element' in `lisp/minibuf.el'.
\1f
File: lispref.info, Node: Command Loop, Next: Keymaps, Prev: Minibuffers, Up: Top
usually did not have these optional BUFFER arguments and always
operated on the current buffer.)
- - Function: char-after position &optional buffer
+ - Function: char-after &optional position buffer
This function returns the character in the buffer at (i.e.,
immediately after) position POSITION. If POSITION is out of range
for this purpose, either before the beginning of the buffer, or at
- or beyond the end, then the value is `nil'. If optional argument
- BUFFER is `nil', the current buffer is assumed.
+ or beyond the end, then the value is `nil'. The default for
+ POSITION is point. If optional argument BUFFER is `nil', the
+ current buffer is assumed.
In the following example, assume that the first character in the
buffer is `@':
(char-to-string (char-after 1))
=> "@"
+ - Function: char-before &optional position buffer
+ This function returns the character in the current buffer
+ immediately before position POSITION. If POSITION is out of range
+ for this purpose, either at or before the beginning of the buffer,
+ or beyond the end, then the value is `nil'. The default for
+ POSITION is point. If optional argument BUFFER is `nil', the
+ current buffer is assumed.
+
- Function: following-char &optional buffer
This function returns the character following point in the buffer.
This is similar to `(char-after (point))'. However, if point is at
* <: Comparison of Numbers.
* <=: Comparison of Numbers.
* <ESC>: Functions for Key Lookup.
-* <SPC> in minibuffer: Text from Minibuffer.
-* <TAB> in minibuffer: Text from Minibuffer.
* =: Comparison of Numbers.
* >: Comparison of Numbers.
* >=: Comparison of Numbers.
* ? in character constant: Character Type.
-* ? in minibuffer: Text from Minibuffer.
* ? in regexp: Syntax of Regexps.
* @ in interactive: Using Interactive.
* [ in regexp: Syntax of Regexps.
* changing window size: Resizing Windows.
* char table type: Char Table Type.
* char-after: Near Point.
+* char-before: Near Point.
* char-charset: MULE Characters.
* char-equal: Text Comparison.
* char-int: Character Codes.
* minibuffer-local-map: Text from Minibuffer.
* minibuffer-local-must-match-map <1>: Standard Keymaps.
* minibuffer-local-must-match-map: Completion Commands.
-* minibuffer-local-ns-map: Text from Minibuffer.
* minibuffer-prompt: Minibuffer Misc.
* minibuffer-prompt-width: Minibuffer Misc.
* minibuffer-scroll-window: Minibuffer Misc.
* parse-sexp-ignore-comments: Parsing Expressions.
* parsing: Syntax Tables.
* partial files: Partial Files.
+* passwd-echo: Reading a Password.
+* passwd-invert-frame-when-keyboard-grabbed: Reading a Password.
+* passwords, reading: Reading a Password.
* PATH environment variable: Subprocess Creation.
* path-separator: System Environment.
* pausing: Waiting.
* read-from-string: Input Functions.
* read-key-sequence: Key Sequence Input.
* read-minibuffer: Object from Minibuffer.
-* read-no-blanks-input: Text from Minibuffer.
* read-only buffer: Read Only Buffers.
* read-only buffers in interactive: Using Interactive.
+* read-passwd: Reading a Password.
* read-quoted-char: Quoted Character Input.
* read-quoted-char quitting: Quitting.
* read-shell-command-map: Standard Keymaps.
Q4.7.5: Is there a MatLab mode?
-------------------------------
- Is there any way I can get syntax highlighting for MatLab .m files?
-Can I "teach" emacs what words are MatLab commands, comments, etc. ?
-
- Ulrich Elsner <elsner@mathematik.tu-chemnitz.de> writes:
- One way to do this (and much more) is by using the matlab mode.
- (If someone knows where this can be found, please contact the
- XEmacs FAQ maintainer <faq@xemacs.org>.
-
- Instructions on how to install this mode are included in this file.
+ Yes, a matlab mode and other items are available at the MathWorks'
+emacs_add_ons ftp directory
+(ftp://ftp.mathworks.com/pub/contrib/emacs_add_ons).
\1f
File: xemacs-faq.info, Node: Miscellaneous, Next: MS Windows, Prev: Subsystems, Up: Top