diff options
| author | Chong Yidong | 2012-04-20 16:48:50 +0800 |
|---|---|---|
| committer | Chong Yidong | 2012-04-20 16:48:50 +0800 |
| commit | c07a4c0b599e0debfb10acdf02ac6559b998a88a (patch) | |
| tree | f87bca47c21f04b43cca2347a21ed89c57b67958 /doc | |
| parent | 6cf2a23e297b8a57a70c2a1dab5aa28b73461b0b (diff) | |
| parent | 50e5ebca7edcf5299b89ff74499991de01e22046 (diff) | |
| download | emacs-c07a4c0b599e0debfb10acdf02ac6559b998a88a.tar.gz emacs-c07a4c0b599e0debfb10acdf02ac6559b998a88a.zip | |
Merge from emacs-24 branch
Diffstat (limited to 'doc')
| -rw-r--r-- | doc/lispref/ChangeLog | 72 | ||||
| -rw-r--r-- | doc/lispref/elisp.texi | 4 | ||||
| -rw-r--r-- | doc/lispref/files.texi | 12 | ||||
| -rw-r--r-- | doc/lispref/help.texi | 15 | ||||
| -rw-r--r-- | doc/lispref/keymaps.texi | 13 | ||||
| -rw-r--r-- | doc/lispref/minibuf.texi | 378 | ||||
| -rw-r--r-- | doc/lispref/processes.texi | 496 | ||||
| -rw-r--r-- | doc/lispref/vol1.texi | 4 | ||||
| -rw-r--r-- | doc/lispref/vol2.texi | 4 | ||||
| -rw-r--r-- | doc/misc/ChangeLog | 20 | ||||
| -rw-r--r-- | doc/misc/faq.texi | 88 |
11 files changed, 658 insertions, 448 deletions
diff --git a/doc/lispref/ChangeLog b/doc/lispref/ChangeLog index b5a25cb1c51..284a1230a83 100644 --- a/doc/lispref/ChangeLog +++ b/doc/lispref/ChangeLog | |||
| @@ -1,3 +1,75 @@ | |||
| 1 | 2012-04-20 Chong Yidong <cyd@gnu.org> | ||
| 2 | |||
| 3 | * processes.texi (Asynchronous Processes): Mention nil argument to | ||
| 4 | start-process. | ||
| 5 | |||
| 6 | 2012-04-20 Glenn Morris <rgm@gnu.org> | ||
| 7 | |||
| 8 | * minibuf.texi (Basic Completion): No need to describe obarrays here. | ||
| 9 | Don't mention obsolete `nospace' argument of all-completions. | ||
| 10 | (Minibuffer Completion, Completion Commands, Reading File Names) | ||
| 11 | (Completion Variables): Copyedits. | ||
| 12 | (Completion Commands): Mention parent keymaps. | ||
| 13 | Remove obsolete minibuffer-local-filename-must-match-map. | ||
| 14 | (High-Level Completion): Remove read-variable's almost | ||
| 15 | word-for-word duplication of read-command. | ||
| 16 | * elisp.texi, vol1.texi, vol2.texi, minibuf.texi (Completion): | ||
| 17 | Update "High-Level Completion" description. | ||
| 18 | |||
| 19 | 2012-04-19 Glenn Morris <rgm@gnu.org> | ||
| 20 | |||
| 21 | * minibuf.texi (Minibuffers): | ||
| 22 | * elisp.texi, vol1.texi, vol2.texi: Fix minibuffer subsection order. | ||
| 23 | |||
| 24 | * minibuf.texi: Standardize metasyntactic variables ("history", etc). | ||
| 25 | Use Texinfo-recommended form of quote+punctuation. | ||
| 26 | (Intro to Minibuffers): First minibuffer is #1, not #0. | ||
| 27 | Mention minibuffer-inactive-mode. | ||
| 28 | (Text from Minibuffer): Copyedits. | ||
| 29 | (Minibuffer History, Programmed Completion): Fix @var usage. | ||
| 30 | (Object from Minibuffer): Remove overly pedantic para. | ||
| 31 | (Minibuffer History): Copyedits. Add face-name-history. | ||
| 32 | (Initial Input, Yes-or-No Queries, Multiple Queries) | ||
| 33 | (Minibuffer Windows, Minibuffer Misc): Copyedits. | ||
| 34 | (Yes-or-No Queries): Tweak example. | ||
| 35 | (Minibuffer Commands): Add next-complete-history-element. | ||
| 36 | (Minibuffer Misc): Mention minibuffer-message-timeout, and | ||
| 37 | minibuffer-inactive-mode. | ||
| 38 | |||
| 39 | 2012-04-18 Glenn Morris <rgm@gnu.org> | ||
| 40 | |||
| 41 | * processes.texi (Serial Ports, Byte Packing, Bindat Spec) | ||
| 42 | (Bindat Functions): Copyedits. | ||
| 43 | |||
| 44 | 2012-04-18 Christopher Schmidt <christopher@ch.ristopher.com> | ||
| 45 | |||
| 46 | * files.texi (Saving Buffers): Document `visit and `visit-save' | ||
| 47 | values of require-final-newline. | ||
| 48 | |||
| 49 | 2012-04-18 Glenn Morris <rgm@gnu.org> | ||
| 50 | |||
| 51 | * processes.texi (Output from Processes, Filter Functions): | ||
| 52 | Mention waiting-for-user-input-p. | ||
| 53 | (Sentinels, Query Before Exit, System Processes, Transaction Queues): | ||
| 54 | (Network Servers, Datagrams, Network Processes, Network Options) | ||
| 55 | (Network Feature Testing, Serial Ports): Copyedits. | ||
| 56 | (Network): Add encrypted network overview paragraph. | ||
| 57 | Cross-reference the Emacs-GnuTLS manual. Use @acronym. | ||
| 58 | |||
| 59 | 2012-04-17 Chong Yidong <cyd@gnu.org> | ||
| 60 | |||
| 61 | * help.texi (Keys in Documentation): Mention :advertised-binding. | ||
| 62 | |||
| 63 | * keymaps.texi (Menu Bar): Move most of the :advertised-binding | ||
| 64 | description to help.texi. | ||
| 65 | |||
| 66 | 2012-04-16 Glenn Morris <rgm@gnu.org> | ||
| 67 | |||
| 68 | * processes.texi (Process Information, Input to Processes) | ||
| 69 | (Signals to Processes, Output from Processes, Process Buffers) | ||
| 70 | (Filter Functions, Decoding Output): Copyedits. | ||
| 71 | (Accepting Output): Discourage use of `millisec' argument. | ||
| 72 | |||
| 1 | 2012-04-15 Glenn Morris <rgm@gnu.org> | 73 | 2012-04-15 Glenn Morris <rgm@gnu.org> |
| 2 | 74 | ||
| 3 | * processes.texi (Processes, Subprocess Creation, Shell Arguments): | 75 | * processes.texi (Processes, Subprocess Creation, Shell Arguments): |
diff --git a/doc/lispref/elisp.texi b/doc/lispref/elisp.texi index 76397556b01..4319d5eddda 100644 --- a/doc/lispref/elisp.texi +++ b/doc/lispref/elisp.texi | |||
| @@ -637,8 +637,8 @@ Minibuffers | |||
| 637 | * Multiple Queries:: Asking a series of similar questions. | 637 | * Multiple Queries:: Asking a series of similar questions. |
| 638 | * Reading a Password:: Reading a password from the terminal. | 638 | * Reading a Password:: Reading a password from the terminal. |
| 639 | * Minibuffer Commands:: Commands used as key bindings in minibuffers. | 639 | * Minibuffer Commands:: Commands used as key bindings in minibuffers. |
| 640 | * Minibuffer Contents:: How such commands access the minibuffer text. | ||
| 641 | * Minibuffer Windows:: Operating on the special minibuffer windows. | 640 | * Minibuffer Windows:: Operating on the special minibuffer windows. |
| 641 | * Minibuffer Contents:: How such commands access the minibuffer text. | ||
| 642 | * Recursive Mini:: Whether recursive entry to minibuffer is allowed. | 642 | * Recursive Mini:: Whether recursive entry to minibuffer is allowed. |
| 643 | * Minibuffer Misc:: Various customization hooks and variables. | 643 | * Minibuffer Misc:: Various customization hooks and variables. |
| 644 | 644 | ||
| @@ -648,7 +648,7 @@ Completion | |||
| 648 | * Minibuffer Completion:: Invoking the minibuffer with completion. | 648 | * Minibuffer Completion:: Invoking the minibuffer with completion. |
| 649 | * Completion Commands:: Minibuffer commands that do completion. | 649 | * Completion Commands:: Minibuffer commands that do completion. |
| 650 | * High-Level Completion:: Convenient special cases of completion | 650 | * High-Level Completion:: Convenient special cases of completion |
| 651 | (reading buffer name, file name, etc.). | 651 | (reading buffer names, variable names, etc.). |
| 652 | * Reading File Names:: Using completion to read file names and | 652 | * Reading File Names:: Using completion to read file names and |
| 653 | shell commands. | 653 | shell commands. |
| 654 | * Completion Variables:: Variables controlling completion behavior. | 654 | * Completion Variables:: Variables controlling completion behavior. |
diff --git a/doc/lispref/files.texi b/doc/lispref/files.texi index ca4504ca967..3597d9f80c4 100644 --- a/doc/lispref/files.texi +++ b/doc/lispref/files.texi | |||
| @@ -489,11 +489,13 @@ in particular buffers. | |||
| 489 | @defopt require-final-newline | 489 | @defopt require-final-newline |
| 490 | This variable determines whether files may be written out that do | 490 | This variable determines whether files may be written out that do |
| 491 | @emph{not} end with a newline. If the value of the variable is | 491 | @emph{not} end with a newline. If the value of the variable is |
| 492 | @code{t}, then @code{save-buffer} silently adds a newline at the end of | 492 | @code{t}, then @code{save-buffer} silently adds a newline at the end |
| 493 | the file whenever the buffer being saved does not already end in one. | 493 | of the buffer whenever it does not already end in one. If the value |
| 494 | If the value of the variable is non-@code{nil}, but not @code{t}, then | 494 | is @code{visit}, Emacs adds a missing newline just after it visits the |
| 495 | @code{save-buffer} asks the user whether to add a newline each time the | 495 | file. If the value is @code{visit-save}, Emacs adds a missing newline |
| 496 | case arises. | 496 | both on visiting and on saving. For any other non-@code{nil} value, |
| 497 | @code{save-buffer} asks the user whether to add a newline each time | ||
| 498 | the case arises. | ||
| 497 | 499 | ||
| 498 | If the value of the variable is @code{nil}, then @code{save-buffer} | 500 | If the value of the variable is @code{nil}, then @code{save-buffer} |
| 499 | doesn't add newlines at all. @code{nil} is the default value, but a few | 501 | doesn't add newlines at all. @code{nil} is the default value, but a few |
diff --git a/doc/lispref/help.texi b/doc/lispref/help.texi index 769b4292d30..5dfb2b05ff8 100644 --- a/doc/lispref/help.texi +++ b/doc/lispref/help.texi | |||
| @@ -347,6 +347,21 @@ This function scans @var{string} for the above special sequences and | |||
| 347 | replaces them by what they stand for, returning the result as a string. | 347 | replaces them by what they stand for, returning the result as a string. |
| 348 | This permits display of documentation that refers accurately to the | 348 | This permits display of documentation that refers accurately to the |
| 349 | user's own customized key bindings. | 349 | user's own customized key bindings. |
| 350 | |||
| 351 | @cindex advertised binding | ||
| 352 | If a command has multiple bindings, this function normally uses the | ||
| 353 | first one it finds. You can specify one particular key binding by | ||
| 354 | assigning an @code{:advertised-binding} symbol property to the | ||
| 355 | command, like this: | ||
| 356 | |||
| 357 | @smallexample | ||
| 358 | (put 'undo :advertised-binding [?\C-/]) | ||
| 359 | @end smallexample | ||
| 360 | |||
| 361 | @noindent | ||
| 362 | The @code{:advertised-binding} property also affects the binding shown | ||
| 363 | in menu items (@pxref{Menu Bar}). The property is ignored if it | ||
| 364 | specifies a key binding that the command does not actually have. | ||
| 350 | @end defun | 365 | @end defun |
| 351 | 366 | ||
| 352 | Here are examples of the special sequences: | 367 | Here are examples of the special sequences: |
diff --git a/doc/lispref/keymaps.texi b/doc/lispref/keymaps.texi index f8befb8fd90..b12752fdeea 100644 --- a/doc/lispref/keymaps.texi +++ b/doc/lispref/keymaps.texi | |||
| @@ -2548,17 +2548,8 @@ the same command (if such a key binding exists). This serves as a | |||
| 2548 | convenient hint for users who do not know the key binding. If a | 2548 | convenient hint for users who do not know the key binding. If a |
| 2549 | command has multiple bindings, Emacs normally displays the first one | 2549 | command has multiple bindings, Emacs normally displays the first one |
| 2550 | it finds. You can specify one particular key binding by assigning an | 2550 | it finds. You can specify one particular key binding by assigning an |
| 2551 | @code{:advertised-binding} symbol property to the command. For | 2551 | @code{:advertised-binding} symbol property to the command. @xref{Keys |
| 2552 | instance, the following tells Emacs to show @kbd{C-/} for the | 2552 | in Documentation}. |
| 2553 | @code{undo} menu item: | ||
| 2554 | |||
| 2555 | @smallexample | ||
| 2556 | (put 'undo :advertised-binding [?\C-/]) | ||
| 2557 | @end smallexample | ||
| 2558 | |||
| 2559 | @noindent | ||
| 2560 | If the @code{:advertised-binding} property specifies a key binding | ||
| 2561 | that the command does not actually have, it is ignored. | ||
| 2562 | 2553 | ||
| 2563 | @node Tool Bar | 2554 | @node Tool Bar |
| 2564 | @subsection Tool bars | 2555 | @subsection Tool bars |
diff --git a/doc/lispref/minibuf.texi b/doc/lispref/minibuf.texi index 1be21f5d974..c840eb6ded0 100644 --- a/doc/lispref/minibuf.texi +++ b/doc/lispref/minibuf.texi | |||
| @@ -29,8 +29,8 @@ argument. | |||
| 29 | * Multiple Queries:: Asking a series of similar questions. | 29 | * Multiple Queries:: Asking a series of similar questions. |
| 30 | * Reading a Password:: Reading a password from the terminal. | 30 | * Reading a Password:: Reading a password from the terminal. |
| 31 | * Minibuffer Commands:: Commands used as key bindings in minibuffers. | 31 | * Minibuffer Commands:: Commands used as key bindings in minibuffers. |
| 32 | * Minibuffer Contents:: How such commands access the minibuffer text. | ||
| 33 | * Minibuffer Windows:: Operating on the special minibuffer windows. | 32 | * Minibuffer Windows:: Operating on the special minibuffer windows. |
| 33 | * Minibuffer Contents:: How such commands access the minibuffer text. | ||
| 34 | * Recursive Mini:: Whether recursive entry to minibuffer is allowed. | 34 | * Recursive Mini:: Whether recursive entry to minibuffer is allowed. |
| 35 | * Minibuffer Misc:: Various customization hooks and variables. | 35 | * Minibuffer Misc:: Various customization hooks and variables. |
| 36 | @end menu | 36 | @end menu |
| @@ -59,8 +59,10 @@ boundary between the prompt and the actual text. | |||
| 59 | 59 | ||
| 60 | The minibuffer's window is normally a single line; it grows | 60 | The minibuffer's window is normally a single line; it grows |
| 61 | automatically if the contents require more space. You can explicitly | 61 | automatically if the contents require more space. You can explicitly |
| 62 | @c FIXME? Works in 23.4, not 24.0.95. (Bug#11276) | ||
| 62 | resize it temporarily with the window sizing commands; it reverts to | 63 | resize it temporarily with the window sizing commands; it reverts to |
| 63 | its normal size when the minibuffer is exited. You can resize it | 64 | its normal size when the minibuffer is exited. You can resize it |
| 65 | @c FIXME? Doesn't work in any version of Emacs? | ||
| 64 | permanently by using the window sizing commands in the frame's other | 66 | permanently by using the window sizing commands in the frame's other |
| 65 | window, when the minibuffer is not active. If the frame contains just | 67 | window, when the minibuffer is not active. If the frame contains just |
| 66 | a minibuffer, you can change the minibuffer's size by changing the | 68 | a minibuffer, you can change the minibuffer's size by changing the |
| @@ -72,9 +74,9 @@ of variables such as @code{this-command} and @code{last-command} | |||
| 72 | code that uses the minibuffer, if you do not want that to change them. | 74 | code that uses the minibuffer, if you do not want that to change them. |
| 73 | 75 | ||
| 74 | Under some circumstances, a command can use a minibuffer even if | 76 | Under some circumstances, a command can use a minibuffer even if |
| 75 | there is an active minibuffer; such minibuffers are called a | 77 | there is an active minibuffer; such a minibuffer is called a |
| 76 | @dfn{recursive minibuffer}. The first minibuffer is named | 78 | @dfn{recursive minibuffer}. The first minibuffer is named |
| 77 | @w{@samp{ *Minibuf-0*}}. Recursive minibuffers are named by | 79 | @w{@samp{ *Minibuf-1*}}. Recursive minibuffers are named by |
| 78 | incrementing the number at the end of the name. (The names begin with | 80 | incrementing the number at the end of the name. (The names begin with |
| 79 | a space so that they won't show up in normal buffer lists.) Of | 81 | a space so that they won't show up in normal buffer lists.) Of |
| 80 | several recursive minibuffers, the innermost (or most recently | 82 | several recursive minibuffers, the innermost (or most recently |
| @@ -90,6 +92,12 @@ to be done. @xref{Text from Minibuffer}, for the non-completion | |||
| 90 | minibuffer local maps. @xref{Completion Commands}, for the minibuffer | 92 | minibuffer local maps. @xref{Completion Commands}, for the minibuffer |
| 91 | local maps for completion. | 93 | local maps for completion. |
| 92 | 94 | ||
| 95 | @cindex inactive minibuffer | ||
| 96 | When a minibuffer is inactive, its major mode is | ||
| 97 | @code{minibuffer-inactive-mode}, with keymap | ||
| 98 | @code{minibuffer-inactive-mode-map}. This is only really useful if | ||
| 99 | the minibuffer is in a separate frame. @xref{Minibuffers and Frames}. | ||
| 100 | |||
| 93 | When Emacs is running in batch mode, any request to read from the | 101 | When Emacs is running in batch mode, any request to read from the |
| 94 | minibuffer actually reads a line from the standard input descriptor that | 102 | minibuffer actually reads a line from the standard input descriptor that |
| 95 | was supplied when Emacs was started. | 103 | was supplied when Emacs was started. |
| @@ -110,7 +118,7 @@ middle of a Lisp function. Instead, do all minibuffer input as part of | |||
| 110 | reading the arguments for a command, in the @code{interactive} | 118 | reading the arguments for a command, in the @code{interactive} |
| 111 | specification. @xref{Defining Commands}. | 119 | specification. @xref{Defining Commands}. |
| 112 | 120 | ||
| 113 | @defun read-from-minibuffer prompt-string &optional initial-contents keymap read hist default inherit-input-method | 121 | @defun read-from-minibuffer prompt &optional initial keymap read history default inherit-input-method |
| 114 | This function is the most general way to get input from the | 122 | This function is the most general way to get input from the |
| 115 | minibuffer. By default, it accepts arbitrary text and returns it as a | 123 | minibuffer. By default, it accepts arbitrary text and returns it as a |
| 116 | string; however, if @var{read} is non-@code{nil}, then it uses | 124 | string; however, if @var{read} is non-@code{nil}, then it uses |
| @@ -118,8 +126,8 @@ string; however, if @var{read} is non-@code{nil}, then it uses | |||
| 118 | Functions}). | 126 | Functions}). |
| 119 | 127 | ||
| 120 | The first thing this function does is to activate a minibuffer and | 128 | The first thing this function does is to activate a minibuffer and |
| 121 | display it with @var{prompt-string} as the prompt. This value must be a | 129 | display it with @var{prompt} (which must be a string) as the |
| 122 | string. Then the user can edit text in the minibuffer. | 130 | prompt. Then the user can edit text in the minibuffer. |
| 123 | 131 | ||
| 124 | When the user types a command to exit the minibuffer, | 132 | When the user types a command to exit the minibuffer, |
| 125 | @code{read-from-minibuffer} constructs the return value from the text in | 133 | @code{read-from-minibuffer} constructs the return value from the text in |
| @@ -131,7 +139,7 @@ reads the text and returns the resulting Lisp object, unevaluated. | |||
| 131 | The argument @var{default} specifies default values to make available | 139 | The argument @var{default} specifies default values to make available |
| 132 | through the history commands. It should be a string, a list of | 140 | through the history commands. It should be a string, a list of |
| 133 | strings, or @code{nil}. The string or strings become the minibuffer's | 141 | strings, or @code{nil}. The string or strings become the minibuffer's |
| 134 | ``future history,'' available to the user with @kbd{M-n}. | 142 | ``future history'', available to the user with @kbd{M-n}. |
| 135 | 143 | ||
| 136 | If @var{read} is non-@code{nil}, then @var{default} is also used | 144 | If @var{read} is non-@code{nil}, then @var{default} is also used |
| 137 | as the input to @code{read}, if the user enters empty input. | 145 | as the input to @code{read}, if the user enters empty input. |
| @@ -148,12 +156,13 @@ value of @code{minibuffer-local-map} is used as the keymap. Specifying | |||
| 148 | a keymap is the most important way to customize the minibuffer for | 156 | a keymap is the most important way to customize the minibuffer for |
| 149 | various applications such as completion. | 157 | various applications such as completion. |
| 150 | 158 | ||
| 151 | The argument @var{hist} specifies which history list variable to use | 159 | The argument @var{history} specifies a history list variable to use |
| 152 | for saving the input and for history commands used in the minibuffer. | 160 | for saving the input and for history commands used in the minibuffer. |
| 153 | It defaults to @code{minibuffer-history}. @xref{Minibuffer History}. | 161 | It defaults to @code{minibuffer-history}. You can optionally specify |
| 162 | a starting position in the history list as well. @xref{Minibuffer History}. | ||
| 154 | 163 | ||
| 155 | If the variable @code{minibuffer-allow-text-properties} is | 164 | If the variable @code{minibuffer-allow-text-properties} is |
| 156 | non-@code{nil}, then the string which is returned includes whatever text | 165 | non-@code{nil}, then the string that is returned includes whatever text |
| 157 | properties were present in the minibuffer. Otherwise all the text | 166 | properties were present in the minibuffer. Otherwise all the text |
| 158 | properties are stripped when the value is returned. | 167 | properties are stripped when the value is returned. |
| 159 | 168 | ||
| @@ -163,9 +172,9 @@ the setting of @code{enable-multibyte-characters} (@pxref{Text | |||
| 163 | Representations}) from whichever buffer was current before entering the | 172 | Representations}) from whichever buffer was current before entering the |
| 164 | minibuffer. | 173 | minibuffer. |
| 165 | 174 | ||
| 166 | Use of @var{initial-contents} is mostly deprecated; we recommend using | 175 | Use of @var{initial} is mostly deprecated; we recommend using |
| 167 | a non-@code{nil} value only in conjunction with specifying a cons cell | 176 | a non-@code{nil} value only in conjunction with specifying a cons cell |
| 168 | for @var{hist}. @xref{Initial Input}. | 177 | for @var{history}. @xref{Initial Input}. |
| 169 | @end defun | 178 | @end defun |
| 170 | 179 | ||
| 171 | @defun read-string prompt &optional initial history default inherit-input-method | 180 | @defun read-string prompt &optional initial history default inherit-input-method |
| @@ -178,11 +187,11 @@ The optional argument @var{default} is used as in | |||
| 178 | @code{read-from-minibuffer}, except that, if non-@code{nil}, it also | 187 | @code{read-from-minibuffer}, except that, if non-@code{nil}, it also |
| 179 | specifies a default value to return if the user enters null input. As | 188 | specifies a default value to return if the user enters null input. As |
| 180 | in @code{read-from-minibuffer} it should be a string, a list of | 189 | in @code{read-from-minibuffer} it should be a string, a list of |
| 181 | strings, or @code{nil} which is equivalent to an empty string. When | 190 | strings, or @code{nil}, which is equivalent to an empty string. When |
| 182 | @var{default} is a string, that string is the default value. When it | 191 | @var{default} is a string, that string is the default value. When it |
| 183 | is a list of strings, the first string is the default value. (All | 192 | is a list of strings, the first string is the default value. (All |
| 184 | these strings are available to the user in the ``future minibuffer | 193 | these strings are available to the user in the ``future minibuffer |
| 185 | history.'') | 194 | history''.) |
| 186 | 195 | ||
| 187 | This function works by calling the | 196 | This function works by calling the |
| 188 | @code{read-from-minibuffer} function: | 197 | @code{read-from-minibuffer} function: |
| @@ -201,16 +210,16 @@ This function works by calling the | |||
| 201 | @end smallexample | 210 | @end smallexample |
| 202 | @end defun | 211 | @end defun |
| 203 | 212 | ||
| 204 | @defun read-regexp prompt &optional default-value | 213 | @defun read-regexp prompt &optional default |
| 205 | This function reads a regular expression as a string from the | 214 | This function reads a regular expression as a string from the |
| 206 | minibuffer and returns it. The argument @var{prompt} is used as in | 215 | minibuffer and returns it. The argument @var{prompt} is used as in |
| 207 | @code{read-from-minibuffer}. The keymap used is | 216 | @code{read-from-minibuffer}. The keymap used is |
| 208 | @code{minibuffer-local-map}, and @code{regexp-history} is used as the | 217 | @code{minibuffer-local-map}, and @code{regexp-history} is used as the |
| 209 | history list (@pxref{Minibuffer History, regexp-history}). | 218 | history list (@pxref{Minibuffer History, regexp-history}). |
| 210 | 219 | ||
| 211 | The optional argument @var{default-value} specifies a default value to | 220 | The optional argument @var{default} specifies a default value to |
| 212 | return if the user enters null input; it should be a string, or | 221 | return if the user enters null input; it should be a string, or |
| 213 | @code{nil} which is equivalent to an empty string. | 222 | @code{nil}, which is equivalent to an empty string. |
| 214 | 223 | ||
| 215 | In addition, @code{read-regexp} collects a few useful candidates for | 224 | In addition, @code{read-regexp} collects a few useful candidates for |
| 216 | input and passes them to @code{read-from-minibuffer}, to make them | 225 | input and passes them to @code{read-from-minibuffer}, to make them |
| @@ -234,9 +243,9 @@ function, after computing the list of defaults as described above. | |||
| 234 | @end defun | 243 | @end defun |
| 235 | 244 | ||
| 236 | @defvar minibuffer-allow-text-properties | 245 | @defvar minibuffer-allow-text-properties |
| 237 | If this variable is @code{nil}, then @code{read-from-minibuffer} strips | 246 | If this variable is @code{nil}, then @code{read-from-minibuffer} |
| 238 | all text properties from the minibuffer input before returning it. | 247 | and @code{read-string} strip all text properties from the minibuffer |
| 239 | This variable also affects @code{read-string}. However, | 248 | input before returning it. However, |
| 240 | @code{read-no-blanks-input} (see below), as well as | 249 | @code{read-no-blanks-input} (see below), as well as |
| 241 | @code{read-minibuffer} and related functions (@pxref{Object from | 250 | @code{read-minibuffer} and related functions (@pxref{Object from |
| 242 | Minibuffer,, Reading Lisp Objects With the Minibuffer}), and all | 251 | Minibuffer,, Reading Lisp Objects With the Minibuffer}), and all |
| @@ -274,6 +283,12 @@ default, it makes the following bindings: | |||
| 274 | 283 | ||
| 275 | @item @kbd{M-r} | 284 | @item @kbd{M-r} |
| 276 | @code{previous-matching-history-element} | 285 | @code{previous-matching-history-element} |
| 286 | |||
| 287 | @ignore | ||
| 288 | @c Does not seem worth/appropriate mentioning. | ||
| 289 | @item @kbd{C-@key{TAB}} | ||
| 290 | @code{file-cache-minibuffer-complete} | ||
| 291 | @end ignore | ||
| 277 | @end table | 292 | @end table |
| 278 | @end defvar | 293 | @end defvar |
| 279 | 294 | ||
| @@ -304,6 +319,8 @@ This function discards text properties, regardless of the value of | |||
| 304 | @end smallexample | 319 | @end smallexample |
| 305 | @end defun | 320 | @end defun |
| 306 | 321 | ||
| 322 | @c Slightly unfortunate name, suggesting it might be related to the | ||
| 323 | @c Nextstep port... | ||
| 307 | @defvar minibuffer-local-ns-map | 324 | @defvar minibuffer-local-ns-map |
| 308 | This built-in variable is the keymap used as the minibuffer local keymap | 325 | This built-in variable is the keymap used as the minibuffer local keymap |
| 309 | in the function @code{read-no-blanks-input}. By default, it makes the | 326 | in the function @code{read-no-blanks-input}. By default, it makes the |
| @@ -388,23 +405,16 @@ This function simply evaluates the result of a call to | |||
| 388 | @end defun | 405 | @end defun |
| 389 | 406 | ||
| 390 | @defun edit-and-eval-command prompt form | 407 | @defun edit-and-eval-command prompt form |
| 391 | This function reads a Lisp expression in the minibuffer, and then | 408 | This function reads a Lisp expression in the minibuffer, evaluates it, |
| 392 | evaluates it. The difference between this command and | 409 | then returns the result. The difference between this command and |
| 393 | @code{eval-minibuffer} is that here the initial @var{form} is not | 410 | @code{eval-minibuffer} is that here the initial @var{form} is not |
| 394 | optional and it is treated as a Lisp object to be converted to printed | 411 | optional and it is treated as a Lisp object to be converted to printed |
| 395 | representation rather than as a string of text. It is printed with | 412 | representation rather than as a string of text. It is printed with |
| 396 | @code{prin1}, so if it is a string, double-quote characters (@samp{"}) | 413 | @code{prin1}, so if it is a string, double-quote characters (@samp{"}) |
| 397 | appear in the initial text. @xref{Output Functions}. | 414 | appear in the initial text. @xref{Output Functions}. |
| 398 | 415 | ||
| 399 | The first thing @code{edit-and-eval-command} does is to activate the | ||
| 400 | minibuffer with @var{prompt} as the prompt. Then it inserts the printed | ||
| 401 | representation of @var{form} in the minibuffer, and lets the user edit it. | ||
| 402 | When the user exits the minibuffer, the edited text is read with | ||
| 403 | @code{read} and then evaluated. The resulting value becomes the value | ||
| 404 | of @code{edit-and-eval-command}. | ||
| 405 | |||
| 406 | In the following example, we offer the user an expression with initial | 416 | In the following example, we offer the user an expression with initial |
| 407 | text which is a valid form already: | 417 | text that is already a valid form: |
| 408 | 418 | ||
| 409 | @smallexample | 419 | @smallexample |
| 410 | @group | 420 | @group |
| @@ -424,7 +434,6 @@ Please edit: (forward-word 1)@point{} | |||
| 424 | @noindent | 434 | @noindent |
| 425 | Typing @key{RET} right away would exit the minibuffer and evaluate the | 435 | Typing @key{RET} right away would exit the minibuffer and evaluate the |
| 426 | expression, thus moving point forward one word. | 436 | expression, thus moving point forward one word. |
| 427 | @code{edit-and-eval-command} returns @code{nil} in this example. | ||
| 428 | @end defun | 437 | @end defun |
| 429 | 438 | ||
| 430 | @node Minibuffer History | 439 | @node Minibuffer History |
| @@ -440,7 +449,7 @@ is a list of strings (previous inputs), most recent first. | |||
| 440 | kinds of inputs. It's the Lisp programmer's job to specify the right | 449 | kinds of inputs. It's the Lisp programmer's job to specify the right |
| 441 | history list for each use of the minibuffer. | 450 | history list for each use of the minibuffer. |
| 442 | 451 | ||
| 443 | You specify a minibuffer history list with the optional @var{hist} | 452 | You specify a minibuffer history list with the optional @var{history} |
| 444 | argument to @code{read-from-minibuffer} or @code{completing-read}. | 453 | argument to @code{read-from-minibuffer} or @code{completing-read}. |
| 445 | Here are the possible values for it: | 454 | Here are the possible values for it: |
| 446 | 455 | ||
| @@ -456,7 +465,7 @@ Specifying 0 for @var{startpos} is equivalent to just specifying the | |||
| 456 | symbol @var{variable}. @code{previous-history-element} will display | 465 | symbol @var{variable}. @code{previous-history-element} will display |
| 457 | the most recent element of the history list in the minibuffer. If you | 466 | the most recent element of the history list in the minibuffer. If you |
| 458 | specify a positive @var{startpos}, the minibuffer history functions | 467 | specify a positive @var{startpos}, the minibuffer history functions |
| 459 | behave as if @code{(elt @var{variable} (1- @var{STARTPOS}))} were the | 468 | behave as if @code{(elt @var{variable} (1- @var{startpos}))} were the |
| 460 | history element currently shown in the minibuffer. | 469 | history element currently shown in the minibuffer. |
| 461 | 470 | ||
| 462 | For consistency, you should also specify that element of the history | 471 | For consistency, you should also specify that element of the history |
| @@ -464,7 +473,7 @@ as the initial minibuffer contents, using the @var{initial} argument | |||
| 464 | to the minibuffer input function (@pxref{Initial Input}). | 473 | to the minibuffer input function (@pxref{Initial Input}). |
| 465 | @end table | 474 | @end table |
| 466 | 475 | ||
| 467 | If you don't specify @var{hist}, then the default history list | 476 | If you don't specify @var{history}, then the default history list |
| 468 | @code{minibuffer-history} is used. For other standard history lists, | 477 | @code{minibuffer-history} is used. For other standard history lists, |
| 469 | see below. You can also create your own history list variable; just | 478 | see below. You can also create your own history list variable; just |
| 470 | initialize it to @code{nil} before the first use. | 479 | initialize it to @code{nil} before the first use. |
| @@ -503,15 +512,15 @@ If the value of this variable is @code{nil}, standard functions that | |||
| 503 | read from the minibuffer don't add new elements to the history list. | 512 | read from the minibuffer don't add new elements to the history list. |
| 504 | This lets Lisp programs explicitly manage input history by using | 513 | This lets Lisp programs explicitly manage input history by using |
| 505 | @code{add-to-history}. By default, @code{history-add-new-input} is | 514 | @code{add-to-history}. By default, @code{history-add-new-input} is |
| 506 | set to a non-@code{nil} value. | 515 | non-@code{nil}. |
| 507 | @end defvar | 516 | @end defvar |
| 508 | 517 | ||
| 509 | @defopt history-length | 518 | @defopt history-length |
| 510 | The value of this variable specifies the maximum length for all | 519 | The value of this variable specifies the maximum length for all |
| 511 | history lists that don't specify their own maximum lengths. If the | 520 | history lists that don't specify their own maximum lengths. If the |
| 512 | value is @code{t}, that means there is no maximum (don't delete old | 521 | value is @code{t}, that means there is no maximum (don't delete old |
| 513 | elements). The value of @code{history-length} property of the history | 522 | elements). If a history list variable's symbol has a non-@code{nil} |
| 514 | list variable's symbol, if set, overrides this variable for that | 523 | @code{history-length} property, it overrides this variable for that |
| 515 | particular history list. | 524 | particular history list. |
| 516 | @end defopt | 525 | @end defopt |
| 517 | 526 | ||
| @@ -555,11 +564,19 @@ A history list for arguments that are shell commands. | |||
| 555 | A history list for arguments that are Lisp expressions to evaluate. | 564 | A history list for arguments that are Lisp expressions to evaluate. |
| 556 | @end defvar | 565 | @end defvar |
| 557 | 566 | ||
| 567 | @defvar face-name-history | ||
| 568 | A history list for arguments that are faces. | ||
| 569 | @end defvar | ||
| 570 | |||
| 571 | @c Less common: coding-system-history, input-method-history, | ||
| 572 | @c command-history, grep-history, grep-find-history, | ||
| 573 | @c read-envvar-name-history, setenv-history, yes-or-no-p-history. | ||
| 574 | |||
| 558 | @node Initial Input | 575 | @node Initial Input |
| 559 | @section Initial Input | 576 | @section Initial Input |
| 560 | 577 | ||
| 561 | Several of the functions for minibuffer input have an argument called | 578 | Several of the functions for minibuffer input have an argument called |
| 562 | @var{initial} or @var{initial-contents}. This is a mostly-deprecated | 579 | @var{initial}. This is a mostly-deprecated |
| 563 | feature for specifying that the minibuffer should start out with | 580 | feature for specifying that the minibuffer should start out with |
| 564 | certain text, instead of empty as usual. | 581 | certain text, instead of empty as usual. |
| 565 | 582 | ||
| @@ -576,7 +593,7 @@ to offer useful default inputs to the user. | |||
| 576 | 593 | ||
| 577 | There is just one situation where you should specify a string for an | 594 | There is just one situation where you should specify a string for an |
| 578 | @var{initial} argument. This is when you specify a cons cell for the | 595 | @var{initial} argument. This is when you specify a cons cell for the |
| 579 | @var{hist} or @var{history} argument. @xref{Minibuffer History}. | 596 | @var{history} argument. @xref{Minibuffer History}. |
| 580 | 597 | ||
| 581 | @var{initial} can also be a cons cell of the form @code{(@var{string} | 598 | @var{initial} can also be a cons cell of the form @code{(@var{string} |
| 582 | . @var{position})}. This means to insert @var{string} in the | 599 | . @var{position})}. This means to insert @var{string} in the |
| @@ -588,11 +605,10 @@ inconsistently in different functions. In @code{completing-read}, | |||
| 588 | of 0 means the beginning of the string, 1 means after the first | 605 | of 0 means the beginning of the string, 1 means after the first |
| 589 | character, etc. In @code{read-minibuffer}, and the other | 606 | character, etc. In @code{read-minibuffer}, and the other |
| 590 | non-completion minibuffer input functions that support this argument, | 607 | non-completion minibuffer input functions that support this argument, |
| 591 | 1 means the beginning of the string 2 means after the first character, | 608 | 1 means the beginning of the string, 2 means after the first character, |
| 592 | etc. | 609 | etc. |
| 593 | 610 | ||
| 594 | Use of a cons cell as the value for @var{initial} arguments is | 611 | Use of a cons cell as the value for @var{initial} arguments is deprecated. |
| 595 | deprecated in user code. | ||
| 596 | 612 | ||
| 597 | @node Completion | 613 | @node Completion |
| 598 | @section Completion | 614 | @section Completion |
| @@ -603,6 +619,7 @@ starting from an abbreviation for it. Completion works by comparing the | |||
| 603 | user's input against a list of valid names and determining how much of | 619 | user's input against a list of valid names and determining how much of |
| 604 | the name is determined uniquely by what the user has typed. For | 620 | the name is determined uniquely by what the user has typed. For |
| 605 | example, when you type @kbd{C-x b} (@code{switch-to-buffer}) and then | 621 | example, when you type @kbd{C-x b} (@code{switch-to-buffer}) and then |
| 622 | @c "This is the sort of English up with which I will not put." | ||
| 606 | type the first few letters of the name of the buffer to which you wish | 623 | type the first few letters of the name of the buffer to which you wish |
| 607 | to switch, and then type @key{TAB} (@code{minibuffer-complete}), Emacs | 624 | to switch, and then type @key{TAB} (@code{minibuffer-complete}), Emacs |
| 608 | extends the name as far as it can. | 625 | extends the name as far as it can. |
| @@ -627,7 +644,7 @@ for reading certain kinds of names with completion. | |||
| 627 | * Minibuffer Completion:: Invoking the minibuffer with completion. | 644 | * Minibuffer Completion:: Invoking the minibuffer with completion. |
| 628 | * Completion Commands:: Minibuffer commands that do completion. | 645 | * Completion Commands:: Minibuffer commands that do completion. |
| 629 | * High-Level Completion:: Convenient special cases of completion | 646 | * High-Level Completion:: Convenient special cases of completion |
| 630 | (reading buffer name, file name, etc.). | 647 | (reading buffer names, variable names, etc.). |
| 631 | * Reading File Names:: Using completion to read file names and | 648 | * Reading File Names:: Using completion to read file names and |
| 632 | shell commands. | 649 | shell commands. |
| 633 | * Completion Variables:: Variables controlling completion behavior. | 650 | * Completion Variables:: Variables controlling completion behavior. |
| @@ -662,20 +679,14 @@ If @var{collection} is an alist (@pxref{Association Lists}), the | |||
| 662 | permissible completions are the elements of the alist that are either | 679 | permissible completions are the elements of the alist that are either |
| 663 | strings, or conses whose @sc{car} is a string or symbol. | 680 | strings, or conses whose @sc{car} is a string or symbol. |
| 664 | Symbols are converted to strings using @code{symbol-name}. Other | 681 | Symbols are converted to strings using @code{symbol-name}. Other |
| 665 | elements of the alist are ignored. (Remember that in Emacs Lisp, the | 682 | elements of the alist are ignored. (Remember that in Emacs Lisp, the |
| 666 | elements of alists do not @emph{have} to be conses.) In particular, a | 683 | elements of alists do not @emph{have} to be conses.) In particular, a |
| 667 | list of strings is allowed, even though we usually do not | 684 | list of strings is allowed, even though we usually do not |
| 668 | think of such lists as alists. | 685 | think of such lists as alists. |
| 669 | 686 | ||
| 670 | @cindex obarray in completion | 687 | @cindex obarray in completion |
| 671 | If @var{collection} is an obarray (@pxref{Creating Symbols}), the names | 688 | If @var{collection} is an obarray (@pxref{Creating Symbols}), the names |
| 672 | of all symbols in the obarray form the set of permissible completions. The | 689 | of all symbols in the obarray form the set of permissible completions. |
| 673 | global variable @code{obarray} holds an obarray containing the names of | ||
| 674 | all interned Lisp symbols. | ||
| 675 | |||
| 676 | Note that the only valid way to make a new obarray is to create it | ||
| 677 | empty and then add symbols to it one by one using @code{intern}. | ||
| 678 | Also, you cannot intern a given symbol in more than one obarray. | ||
| 679 | 690 | ||
| 680 | If @var{collection} is a hash table, then the keys that are strings | 691 | If @var{collection} is a hash table, then the keys that are strings |
| 681 | are the possible completions. Other keys are ignored. | 692 | are the possible completions. Other keys are ignored. |
| @@ -756,16 +767,20 @@ too short). Both of those begin with the string @samp{foobar}. | |||
| 756 | @end smallexample | 767 | @end smallexample |
| 757 | @end defun | 768 | @end defun |
| 758 | 769 | ||
| 759 | @defun all-completions string collection &optional predicate nospace | 770 | @c Removed obsolete argument nospace. |
| 771 | @defun all-completions string collection &optional predicate | ||
| 760 | This function returns a list of all possible completions of | 772 | This function returns a list of all possible completions of |
| 761 | @var{string}. The arguments to this function (aside from | 773 | @var{string}. The arguments to this function |
| 762 | @var{nospace}) are the same as those of @code{try-completion}. Also, | 774 | @c (aside from @var{nospace}) |
| 763 | this function uses @code{completion-regexp-list} in the same way that | 775 | are the same as those of @code{try-completion}, and it |
| 776 | uses @code{completion-regexp-list} in the same way that | ||
| 764 | @code{try-completion} does. | 777 | @code{try-completion} does. |
| 765 | 778 | ||
| 779 | @ignore | ||
| 766 | The optional argument @var{nospace} is obsolete. If it is | 780 | The optional argument @var{nospace} is obsolete. If it is |
| 767 | non-@code{nil}, completions that start with a space are ignored unless | 781 | non-@code{nil}, completions that start with a space are ignored unless |
| 768 | @var{string} starts with a space. | 782 | @var{string} starts with a space. |
| 783 | @end ignore | ||
| 769 | 784 | ||
| 770 | If @var{collection} is a function, it is called with three arguments: | 785 | If @var{collection} is a function, it is called with three arguments: |
| 771 | @var{string}, @var{predicate} and @code{t}; then @code{all-completions} | 786 | @var{string}, @var{predicate} and @code{t}; then @code{all-completions} |
| @@ -835,7 +850,7 @@ pertains to the area after @code{"/usr/"} and before @code{"/doc"}. | |||
| 835 | @end defun | 850 | @end defun |
| 836 | 851 | ||
| 837 | If you store a completion alist in a variable, you should mark the | 852 | If you store a completion alist in a variable, you should mark the |
| 838 | variable as ``risky'' with a non-@code{nil} | 853 | variable as ``risky'' by giving it a non-@code{nil} |
| 839 | @code{risky-local-variable} property. @xref{File Local Variables}. | 854 | @code{risky-local-variable} property. @xref{File Local Variables}. |
| 840 | 855 | ||
| 841 | @defvar completion-ignore-case | 856 | @defvar completion-ignore-case |
| @@ -864,7 +879,7 @@ proper value is done the first time you do completion using @var{var}. | |||
| 864 | It is done by calling @var{fun} with no arguments. The | 879 | It is done by calling @var{fun} with no arguments. The |
| 865 | value @var{fun} returns becomes the permanent value of @var{var}. | 880 | value @var{fun} returns becomes the permanent value of @var{var}. |
| 866 | 881 | ||
| 867 | Here is a usage example: | 882 | Here is an example: |
| 868 | 883 | ||
| 869 | @smallexample | 884 | @smallexample |
| 870 | (defvar foo (lazy-completion-table foo make-my-alist)) | 885 | (defvar foo (lazy-completion-table foo make-my-alist)) |
| @@ -879,7 +894,7 @@ Here is a usage example: | |||
| 879 | This section describes the basic interface for reading from the | 894 | This section describes the basic interface for reading from the |
| 880 | minibuffer with completion. | 895 | minibuffer with completion. |
| 881 | 896 | ||
| 882 | @defun completing-read prompt collection &optional predicate require-match initial hist default inherit-input-method | 897 | @defun completing-read prompt collection &optional predicate require-match initial history default inherit-input-method |
| 883 | This function reads a string in the minibuffer, assisting the user by | 898 | This function reads a string in the minibuffer, assisting the user by |
| 884 | providing completion. It activates the minibuffer with prompt | 899 | providing completion. It activates the minibuffer with prompt |
| 885 | @var{prompt}, which must be a string. | 900 | @var{prompt}, which must be a string. |
| @@ -934,13 +949,13 @@ The function @code{completing-read} uses | |||
| 934 | @code{minibuffer-local-must-match-map} if @var{require-match} is | 949 | @code{minibuffer-local-must-match-map} if @var{require-match} is |
| 935 | non-@code{nil}. @xref{Completion Commands}. | 950 | non-@code{nil}. @xref{Completion Commands}. |
| 936 | 951 | ||
| 937 | The argument @var{hist} specifies which history list variable to use for | 952 | The argument @var{history} specifies which history list variable to use for |
| 938 | saving the input and for minibuffer history commands. It defaults to | 953 | saving the input and for minibuffer history commands. It defaults to |
| 939 | @code{minibuffer-history}. @xref{Minibuffer History}. | 954 | @code{minibuffer-history}. @xref{Minibuffer History}. |
| 940 | 955 | ||
| 941 | The argument @var{initial} is mostly deprecated; we recommend using a | 956 | The argument @var{initial} is mostly deprecated; we recommend using a |
| 942 | non-@code{nil} value only in conjunction with specifying a cons cell | 957 | non-@code{nil} value only in conjunction with specifying a cons cell |
| 943 | for @var{hist}. @xref{Initial Input}. For default input, use | 958 | for @var{history}. @xref{Initial Input}. For default input, use |
| 944 | @var{default} instead. | 959 | @var{default} instead. |
| 945 | 960 | ||
| 946 | If the argument @var{inherit-input-method} is non-@code{nil}, then the | 961 | If the argument @var{inherit-input-method} is non-@code{nil}, then the |
| @@ -949,7 +964,7 @@ Methods}) and the setting of @code{enable-multibyte-characters} | |||
| 949 | (@pxref{Text Representations}) from whichever buffer was current before | 964 | (@pxref{Text Representations}) from whichever buffer was current before |
| 950 | entering the minibuffer. | 965 | entering the minibuffer. |
| 951 | 966 | ||
| 952 | If the built-in variable @code{completion-ignore-case} is | 967 | If the variable @code{completion-ignore-case} is |
| 953 | non-@code{nil}, completion ignores case when comparing the input | 968 | non-@code{nil}, completion ignores case when comparing the input |
| 954 | against the possible matches. @xref{Basic Completion}. In this mode | 969 | against the possible matches. @xref{Basic Completion}. In this mode |
| 955 | of operation, @var{predicate} must also ignore case, or you will get | 970 | of operation, @var{predicate} must also ignore case, or you will get |
| @@ -1082,8 +1097,8 @@ uses this to highlight text in the completion list for better visual | |||
| 1082 | feedback. This is not needed in the minibuffer; for minibuffer | 1097 | feedback. This is not needed in the minibuffer; for minibuffer |
| 1083 | completion, you can pass @code{nil}. | 1098 | completion, you can pass @code{nil}. |
| 1084 | 1099 | ||
| 1085 | This function is called by @code{minibuffer-completion-help}. The | 1100 | This function is called by @code{minibuffer-completion-help}. A |
| 1086 | most common way to use it is together with | 1101 | common way to use it is together with |
| 1087 | @code{with-output-to-temp-buffer}, like this: | 1102 | @code{with-output-to-temp-buffer}, like this: |
| 1088 | 1103 | ||
| 1089 | @example | 1104 | @example |
| @@ -1117,7 +1132,7 @@ keymap makes the following bindings: | |||
| 1117 | @end table | 1132 | @end table |
| 1118 | 1133 | ||
| 1119 | @noindent | 1134 | @noindent |
| 1120 | with other characters bound as in @code{minibuffer-local-map} | 1135 | and uses @code{minibuffer-local-map} as its parent keymap |
| 1121 | (@pxref{Definition of minibuffer-local-map}). | 1136 | (@pxref{Definition of minibuffer-local-map}). |
| 1122 | @end defvar | 1137 | @end defvar |
| 1123 | 1138 | ||
| @@ -1129,15 +1144,6 @@ minibuffer unconditionally. By default, this keymap makes the following | |||
| 1129 | bindings: | 1144 | bindings: |
| 1130 | 1145 | ||
| 1131 | @table @asis | 1146 | @table @asis |
| 1132 | @item @kbd{?} | ||
| 1133 | @code{minibuffer-completion-help} | ||
| 1134 | |||
| 1135 | @item @key{SPC} | ||
| 1136 | @code{minibuffer-complete-word} | ||
| 1137 | |||
| 1138 | @item @key{TAB} | ||
| 1139 | @code{minibuffer-complete} | ||
| 1140 | |||
| 1141 | @item @kbd{C-j} | 1147 | @item @kbd{C-j} |
| 1142 | @code{minibuffer-complete-and-exit} | 1148 | @code{minibuffer-complete-and-exit} |
| 1143 | 1149 | ||
| @@ -1146,25 +1152,21 @@ bindings: | |||
| 1146 | @end table | 1152 | @end table |
| 1147 | 1153 | ||
| 1148 | @noindent | 1154 | @noindent |
| 1149 | with other characters bound as in @code{minibuffer-local-map}. | 1155 | and uses @code{minibuffer-local-completion-map} as its parent keymap. |
| 1150 | @end defvar | 1156 | @end defvar |
| 1151 | 1157 | ||
| 1152 | @defvar minibuffer-local-filename-completion-map | 1158 | @defvar minibuffer-local-filename-completion-map |
| 1153 | This is like @code{minibuffer-local-completion-map} | 1159 | This is a sparse keymap that simply unbinds @key{SPC}; because |
| 1154 | except that it does not bind @key{SPC}. This keymap is used by the | 1160 | filenames can contain spaces. The function @code{read-file-name} |
| 1155 | function @code{read-file-name}. | 1161 | combines this keymap with either @code{minibuffer-local-completion-map} |
| 1162 | or @code{minibuffer-local-must-match-map}. | ||
| 1156 | @end defvar | 1163 | @end defvar |
| 1157 | 1164 | ||
| 1158 | @defvar minibuffer-local-filename-must-match-map | ||
| 1159 | This is like @code{minibuffer-local-must-match-map} | ||
| 1160 | except that it does not bind @key{SPC}. This keymap is used by the | ||
| 1161 | function @code{read-file-name}. | ||
| 1162 | @end defvar | ||
| 1163 | 1165 | ||
| 1164 | @node High-Level Completion | 1166 | @node High-Level Completion |
| 1165 | @subsection High-Level Completion Functions | 1167 | @subsection High-Level Completion Functions |
| 1166 | 1168 | ||
| 1167 | This section describes the higher-level convenient functions for | 1169 | This section describes the higher-level convenience functions for |
| 1168 | reading certain sorts of names with completion. | 1170 | reading certain sorts of names with completion. |
| 1169 | 1171 | ||
| 1170 | In most cases, you should not call these functions in the middle of a | 1172 | In most cases, you should not call these functions in the middle of a |
| @@ -1238,7 +1240,7 @@ for which @code{commandp} returns @code{t}. @xref{Interactive Call}. | |||
| 1238 | The argument @var{default} specifies what to return if the user enters | 1240 | The argument @var{default} specifies what to return if the user enters |
| 1239 | null input. It can be a symbol, a string or a list of strings. If it | 1241 | null input. It can be a symbol, a string or a list of strings. If it |
| 1240 | is a string, @code{read-command} interns it before returning it. | 1242 | is a string, @code{read-command} interns it before returning it. |
| 1241 | If it is a list, @code{read-command} returns the first element of this list. | 1243 | If it is a list, @code{read-command} interns the first element of this list. |
| 1242 | If @var{default} is @code{nil}, that means no default has been | 1244 | If @var{default} is @code{nil}, that means no default has been |
| 1243 | specified; then if the user enters null input, the return value is | 1245 | specified; then if the user enters null input, the return value is |
| 1244 | @code{(intern "")}, that is, a symbol whose name is an empty string. | 1246 | @code{(intern "")}, that is, a symbol whose name is an empty string. |
| @@ -1280,51 +1282,11 @@ complete in the set of extant Lisp symbols, and it uses the | |||
| 1280 | 1282 | ||
| 1281 | @defun read-variable prompt &optional default | 1283 | @defun read-variable prompt &optional default |
| 1282 | @anchor{Definition of read-variable} | 1284 | @anchor{Definition of read-variable} |
| 1283 | This function reads the name of a user variable and returns it as a | 1285 | This function reads the name of a customizable variable and returns it |
| 1284 | symbol. | 1286 | as a symbol. Its arguments have the same form as those of |
| 1285 | 1287 | @code{read-command}. It behaves just like @code{read-command}, except | |
| 1286 | The argument @var{default} specifies the default value to return if | 1288 | that it uses the predicate @code{custom-variable-p} instead of |
| 1287 | the user enters null input. It can be a symbol, a string, or a list | 1289 | @code{commandp}. |
| 1288 | of strings. If it is a string, @code{read-variable} interns it to | ||
| 1289 | make the default value. If it is a list, @code{read-variable} interns | ||
| 1290 | the first element. If @var{default} is @code{nil}, that means no | ||
| 1291 | default has been specified; then if the user enters null input, the | ||
| 1292 | return value is @code{(intern "")}. | ||
| 1293 | |||
| 1294 | @example | ||
| 1295 | @group | ||
| 1296 | (read-variable "Variable name? ") | ||
| 1297 | |||
| 1298 | ;; @r{After evaluation of the preceding expression,} | ||
| 1299 | ;; @r{the following prompt appears,} | ||
| 1300 | ;; @r{with an empty minibuffer:} | ||
| 1301 | @end group | ||
| 1302 | |||
| 1303 | @group | ||
| 1304 | ---------- Buffer: Minibuffer ---------- | ||
| 1305 | Variable name? @point{} | ||
| 1306 | ---------- Buffer: Minibuffer ---------- | ||
| 1307 | @end group | ||
| 1308 | @end example | ||
| 1309 | |||
| 1310 | @noindent | ||
| 1311 | If the user then types @kbd{fill-p @key{RET}}, @code{read-variable} | ||
| 1312 | returns @code{fill-prefix}. | ||
| 1313 | |||
| 1314 | In general, @code{read-variable} is similar to @code{read-command}, | ||
| 1315 | but uses the predicate @code{custom-variable-p} instead of | ||
| 1316 | @code{commandp}: | ||
| 1317 | |||
| 1318 | @cindex @code{custom-variable-p} example | ||
| 1319 | @example | ||
| 1320 | @group | ||
| 1321 | (read-variable @var{prompt}) | ||
| 1322 | @equiv{} | ||
| 1323 | (intern | ||
| 1324 | (completing-read @var{prompt} obarray | ||
| 1325 | 'custom-variable-p t nil)) | ||
| 1326 | @end group | ||
| 1327 | @end example | ||
| 1328 | @end defun | 1290 | @end defun |
| 1329 | 1291 | ||
| 1330 | @deffn Command read-color &optional prompt convert allow-empty display | 1292 | @deffn Command read-color &optional prompt convert allow-empty display |
| @@ -1342,7 +1304,7 @@ minibuffer. However, when called interactively or if the optional | |||
| 1342 | argument @var{convert} is non-@code{nil}, it converts any input color | 1304 | argument @var{convert} is non-@code{nil}, it converts any input color |
| 1343 | name into the corresponding RGB value string and instead returns that. | 1305 | name into the corresponding RGB value string and instead returns that. |
| 1344 | This function requires a valid color specification to be input. | 1306 | This function requires a valid color specification to be input. |
| 1345 | Empty color names are allowed when @code{allow-empty} is | 1307 | Empty color names are allowed when @var{allow-empty} is |
| 1346 | non-@code{nil} and the user enters null input. | 1308 | non-@code{nil} and the user enters null input. |
| 1347 | 1309 | ||
| 1348 | Interactively, or when @var{display} is non-@code{nil}, the return | 1310 | Interactively, or when @var{display} is non-@code{nil}, the return |
| @@ -1360,7 +1322,7 @@ and @code{read-input-method-name}, in @ref{Input Methods}. | |||
| 1360 | 1322 | ||
| 1361 | The high-level completion functions @code{read-file-name}, | 1323 | The high-level completion functions @code{read-file-name}, |
| 1362 | @code{read-directory-name}, and @code{read-shell-command} are designed | 1324 | @code{read-directory-name}, and @code{read-shell-command} are designed |
| 1363 | to read file names, directory names, and shell commands respectively. | 1325 | to read file names, directory names, and shell commands, respectively. |
| 1364 | They provide special features, including automatic insertion of the | 1326 | They provide special features, including automatic insertion of the |
| 1365 | default directory. | 1327 | default directory. |
| 1366 | 1328 | ||
| @@ -1369,15 +1331,29 @@ This function reads a file name, prompting with @var{prompt} and | |||
| 1369 | providing completion. | 1331 | providing completion. |
| 1370 | 1332 | ||
| 1371 | As an exception, this function reads a file name using a graphical | 1333 | As an exception, this function reads a file name using a graphical |
| 1372 | file dialog instead of the minibuffer, if (i) it is invoked via a | 1334 | file dialog instead of the minibuffer, if all of the following are |
| 1373 | mouse command, and (ii) the selected frame is on a graphical display | 1335 | true: |
| 1374 | supporting such dialogs, and (iii) the variable @code{use-dialog-box} | 1336 | |
| 1375 | is non-@code{nil} (@pxref{Dialog Boxes,, Dialog Boxes, emacs, The GNU | 1337 | @enumerate |
| 1376 | Emacs Manual}), and (iv) the @var{directory} argument, described | 1338 | @item |
| 1377 | below, does not specify a remote file (@pxref{Remote Files,, Remote | 1339 | It is invoked via a mouse command. |
| 1378 | Files, emacs, The GNU Emacs Manual}). The exact behavior when using a | 1340 | |
| 1379 | graphical file dialog is platform-dependent. Here, we simply document | 1341 | @item |
| 1380 | the behavior when using the minibuffer. | 1342 | The selected frame is on a graphical display supporting such dialogs. |
| 1343 | |||
| 1344 | @item | ||
| 1345 | The variable @code{use-dialog-box} is non-@code{nil}. | ||
| 1346 | @xref{Dialog Boxes,, Dialog Boxes, emacs, The GNU Emacs Manual}. | ||
| 1347 | |||
| 1348 | @item | ||
| 1349 | The @var{directory} argument, described below, does not specify a | ||
| 1350 | remote file. @xref{Remote Files,, Remote Files, emacs, The GNU Emacs Manual}. | ||
| 1351 | @end enumerate | ||
| 1352 | |||
| 1353 | @noindent | ||
| 1354 | The exact behavior when using a graphical file dialog is | ||
| 1355 | platform-dependent. Here, we simply document the behavior when using | ||
| 1356 | the minibuffer. | ||
| 1381 | 1357 | ||
| 1382 | @code{read-file-name} does not automatically expand the returned file | 1358 | @code{read-file-name} does not automatically expand the returned file |
| 1383 | name. You must call @code{expand-file-name} yourself if an absolute | 1359 | name. You must call @code{expand-file-name} yourself if an absolute |
| @@ -1388,7 +1364,7 @@ The optional argument @var{require-match} has the same meaning as in | |||
| 1388 | 1364 | ||
| 1389 | The argument @var{directory} specifies the directory to use for | 1365 | The argument @var{directory} specifies the directory to use for |
| 1390 | completing relative file names. It should be an absolute directory | 1366 | completing relative file names. It should be an absolute directory |
| 1391 | name. If @code{insert-default-directory} is non-@code{nil}, | 1367 | name. If the variable @code{insert-default-directory} is non-@code{nil}, |
| 1392 | @var{directory} is also inserted in the minibuffer as initial input. | 1368 | @var{directory} is also inserted in the minibuffer as initial input. |
| 1393 | It defaults to the current buffer's value of @code{default-directory}. | 1369 | It defaults to the current buffer's value of @code{default-directory}. |
| 1394 | 1370 | ||
| @@ -1396,9 +1372,9 @@ If you specify @var{initial}, that is an initial file name to insert | |||
| 1396 | in the buffer (after @var{directory}, if that is inserted). In this | 1372 | in the buffer (after @var{directory}, if that is inserted). In this |
| 1397 | case, point goes at the beginning of @var{initial}. The default for | 1373 | case, point goes at the beginning of @var{initial}. The default for |
| 1398 | @var{initial} is @code{nil}---don't insert any file name. To see what | 1374 | @var{initial} is @code{nil}---don't insert any file name. To see what |
| 1399 | @var{initial} does, try the command @kbd{C-x C-v}. @strong{Please | 1375 | @var{initial} does, try the command @kbd{C-x C-v} in a buffer visiting |
| 1400 | note:} we recommend using @var{default} rather than @var{initial} in | 1376 | a file. @strong{Please note:} we recommend using @var{default} rather |
| 1401 | most cases. | 1377 | than @var{initial} in most cases. |
| 1402 | 1378 | ||
| 1403 | If @var{default} is non-@code{nil}, then the function returns | 1379 | If @var{default} is non-@code{nil}, then the function returns |
| 1404 | @var{default} if the user exits the minibuffer with the same non-empty | 1380 | @var{default} if the user exits the minibuffer with the same non-empty |
| @@ -1501,7 +1477,7 @@ use the code letters @samp{f} or @samp{F} in their interactive form. | |||
| 1501 | @xref{Interactive Codes,, Code Characters for interactive}.) Its | 1477 | @xref{Interactive Codes,, Code Characters for interactive}.) Its |
| 1502 | value controls whether @code{read-file-name} starts by placing the | 1478 | value controls whether @code{read-file-name} starts by placing the |
| 1503 | name of the default directory in the minibuffer, plus the initial file | 1479 | name of the default directory in the minibuffer, plus the initial file |
| 1504 | name if any. If the value of this variable is @code{nil}, then | 1480 | name, if any. If the value of this variable is @code{nil}, then |
| 1505 | @code{read-file-name} does not place any initial input in the | 1481 | @code{read-file-name} does not place any initial input in the |
| 1506 | minibuffer (unless you specify initial input with the @var{initial} | 1482 | minibuffer (unless you specify initial input with the @var{initial} |
| 1507 | argument). In that case, the default directory is still used for | 1483 | argument). In that case, the default directory is still used for |
| @@ -1544,17 +1520,17 @@ The file is @point{} | |||
| 1544 | @end example | 1520 | @end example |
| 1545 | @end defopt | 1521 | @end defopt |
| 1546 | 1522 | ||
| 1547 | @defun read-shell-command prompt &optional initial-contents hist &rest args | 1523 | @defun read-shell-command prompt &optional initial history &rest args |
| 1548 | This function reads a shell command from the minibuffer, prompting | 1524 | This function reads a shell command from the minibuffer, prompting |
| 1549 | with @var{prompt} and providing intelligent completion. It completes | 1525 | with @var{prompt} and providing intelligent completion. It completes |
| 1550 | the first word of the command using candidates that are appropriate | 1526 | the first word of the command using candidates that are appropriate |
| 1551 | for command names, and the rest of the command words as file names. | 1527 | for command names, and the rest of the command words as file names. |
| 1552 | 1528 | ||
| 1553 | This function uses @code{minibuffer-local-shell-command-map} as the | 1529 | This function uses @code{minibuffer-local-shell-command-map} as the |
| 1554 | keymap for minibuffer input. The @var{hist} argument specifies the | 1530 | keymap for minibuffer input. The @var{history} argument specifies the |
| 1555 | history list to use; if is omitted or @code{nil}, it defaults to | 1531 | history list to use; if is omitted or @code{nil}, it defaults to |
| 1556 | @code{shell-command-history} (@pxref{Minibuffer History, | 1532 | @code{shell-command-history} (@pxref{Minibuffer History, |
| 1557 | shell-command-history}). The optional argument @var{initial-contents} | 1533 | shell-command-history}). The optional argument @var{initial} |
| 1558 | specifies the initial content of the minibuffer (@pxref{Initial | 1534 | specifies the initial content of the minibuffer (@pxref{Initial |
| 1559 | Input}). The rest of @var{args}, if present, are used as the | 1535 | Input}). The rest of @var{args}, if present, are used as the |
| 1560 | @var{default} and @var{inherit-input-method} arguments in | 1536 | @var{default} and @var{inherit-input-method} arguments in |
| @@ -1563,20 +1539,22 @@ Input}). The rest of @var{args}, if present, are used as the | |||
| 1563 | 1539 | ||
| 1564 | @defvar minibuffer-local-shell-command-map | 1540 | @defvar minibuffer-local-shell-command-map |
| 1565 | This keymap is used by @code{read-shell-command} for completing | 1541 | This keymap is used by @code{read-shell-command} for completing |
| 1566 | command and file names that are part of a shell command. | 1542 | command and file names that are part of a shell command. It uses |
| 1543 | @code{minibuffer-local-map} as its parent keymap, and binds @key{TAB} | ||
| 1544 | to @code{completion-at-point}. | ||
| 1567 | @end defvar | 1545 | @end defvar |
| 1568 | 1546 | ||
| 1569 | @node Completion Variables | 1547 | @node Completion Variables |
| 1570 | @subsection Completion Variables | 1548 | @subsection Completion Variables |
| 1571 | 1549 | ||
| 1572 | Here are some variables which can be used to alter the default | 1550 | Here are some variables that can be used to alter the default |
| 1573 | completion behavior. | 1551 | completion behavior. |
| 1574 | 1552 | ||
| 1575 | @cindex completion styles | 1553 | @cindex completion styles |
| 1576 | @defopt completion-styles | 1554 | @defopt completion-styles |
| 1577 | The value of this variable is a list of completion style (symbols) to | 1555 | The value of this variable is a list of completion style (symbols) to |
| 1578 | use for performing completion. A @dfn{completion style} is a set of | 1556 | use for performing completion. A @dfn{completion style} is a set of |
| 1579 | rules for generating completions. Each symbol in occurring this list | 1557 | rules for generating completions. Each symbol occurring this list |
| 1580 | must have a corresponding entry in @code{completion-styles-alist}. | 1558 | must have a corresponding entry in @code{completion-styles-alist}. |
| 1581 | @end defopt | 1559 | @end defopt |
| 1582 | 1560 | ||
| @@ -1623,13 +1601,14 @@ description of the available completion styles. | |||
| 1623 | @defopt completion-category-overrides | 1601 | @defopt completion-category-overrides |
| 1624 | This variable specifies special completion styles and other completion | 1602 | This variable specifies special completion styles and other completion |
| 1625 | behaviors to use when completing certain types of text. Its value | 1603 | behaviors to use when completing certain types of text. Its value |
| 1626 | should be a list of the form @code{(@var{category} . @var{alist})}. | 1604 | should be an alist with elements of the form @code{(@var{category} |
| 1627 | @var{category} is a symbol describing what is being completed; | 1605 | . @var{alist})}. @var{category} is a symbol describing what is being |
| 1628 | currently, the @code{buffer} and @code{file} categories are defined, | 1606 | completed; currently, the @code{buffer}, @code{file}, and |
| 1629 | but others can be defined via specialized completion functions | 1607 | @code{unicode-name} categories are defined, but others can be defined |
| 1630 | (@pxref{Programmed Completion}). @var{alist} is an association list | 1608 | via specialized completion functions (@pxref{Programmed Completion}). |
| 1631 | describing how completion should behave for the corresponding | 1609 | @var{alist} is an association list describing how completion should |
| 1632 | category. The following alist keys are supported: | 1610 | behave for the corresponding category. The following alist keys are |
| 1611 | supported: | ||
| 1633 | 1612 | ||
| 1634 | @table @code | 1613 | @table @code |
| 1635 | @item styles | 1614 | @item styles |
| @@ -1662,7 +1641,7 @@ the completion. | |||
| 1662 | The value should be a function to run after performing completion. | 1641 | The value should be a function to run after performing completion. |
| 1663 | The function should accept two arguments, @var{string} and | 1642 | The function should accept two arguments, @var{string} and |
| 1664 | @var{status}, where @var{string} is the text to which the field was | 1643 | @var{status}, where @var{string} is the text to which the field was |
| 1665 | completed and @var{status} indicates what kind of operation happened: | 1644 | completed, and @var{status} indicates what kind of operation happened: |
| 1666 | @code{finished} if text is now complete, @code{sole} if the text | 1645 | @code{finished} if text is now complete, @code{sole} if the text |
| 1667 | cannot be further completed but completion is not finished, or | 1646 | cannot be further completed but completion is not finished, or |
| 1668 | @code{exact} if the text is a valid completion but may be further | 1647 | @code{exact} if the text is a valid completion but may be further |
| @@ -1726,9 +1705,10 @@ some completion alternative; @code{nil} otherwise. | |||
| 1726 | 1705 | ||
| 1727 | @item (boundaries . @var{suffix}) | 1706 | @item (boundaries . @var{suffix}) |
| 1728 | This specifies a @code{completion-boundaries} operation. The function | 1707 | This specifies a @code{completion-boundaries} operation. The function |
| 1729 | should return @code{(boundaries START . END)}, where START is the | 1708 | should return @code{(boundaries @var{start} . @var{end})}, where |
| 1730 | position of the beginning boundary in the specified string, and END is | 1709 | @var{start} is the position of the beginning boundary in the specified |
| 1731 | the position of the end boundary in SUFFIX. | 1710 | string, and @var{end} is the position of the end boundary in |
| 1711 | @var{suffix}. | ||
| 1732 | 1712 | ||
| 1733 | @item metadata | 1713 | @item metadata |
| 1734 | This specifies a request for information about the state of the | 1714 | This specifies a request for information about the state of the |
| @@ -1773,7 +1753,7 @@ the same as for @code{display-sort-function}. | |||
| 1773 | 1753 | ||
| 1774 | @defun completion-table-dynamic function | 1754 | @defun completion-table-dynamic function |
| 1775 | This function is a convenient way to write a function that can act as | 1755 | This function is a convenient way to write a function that can act as |
| 1776 | programmed completion function. The argument @var{function} should be | 1756 | a programmed completion function. The argument @var{function} should be |
| 1777 | a function that takes one argument, a string, and returns an alist of | 1757 | a function that takes one argument, a string, and returns an alist of |
| 1778 | possible completions of it. You can think of | 1758 | possible completions of it. You can think of |
| 1779 | @code{completion-table-dynamic} as a transducer between that interface | 1759 | @code{completion-table-dynamic} as a transducer between that interface |
| @@ -1827,7 +1807,7 @@ satisfy. | |||
| 1827 | 1807 | ||
| 1828 | @item :exclusive | 1808 | @item :exclusive |
| 1829 | If the value is @code{no}, then if the completion table fails to match | 1809 | If the value is @code{no}, then if the completion table fails to match |
| 1830 | the text at point, then @code{completion-at-point} moves on to the | 1810 | the text at point, @code{completion-at-point} moves on to the |
| 1831 | next function in @code{completion-at-point-functions} instead of | 1811 | next function in @code{completion-at-point-functions} instead of |
| 1832 | reporting a completion failure. | 1812 | reporting a completion failure. |
| 1833 | @end table | 1813 | @end table |
| @@ -1841,7 +1821,7 @@ old code to using @code{completion-at-point}. | |||
| 1841 | The first function in @code{completion-at-point-functions} to return a | 1821 | The first function in @code{completion-at-point-functions} to return a |
| 1842 | non-@code{nil} value is used by @code{completion-at-point}. The | 1822 | non-@code{nil} value is used by @code{completion-at-point}. The |
| 1843 | remaining functions are not called. The exception to this is when | 1823 | remaining functions are not called. The exception to this is when |
| 1844 | there is a @code{:exclusive} specification, as described above. | 1824 | there is an @code{:exclusive} specification, as described above. |
| 1845 | @end defvar | 1825 | @end defvar |
| 1846 | 1826 | ||
| 1847 | The following function provides a convenient way to perform | 1827 | The following function provides a convenient way to perform |
| @@ -1879,7 +1859,7 @@ answer. | |||
| 1879 | using the mouse---more precisely, if @code{last-nonmenu-event} | 1859 | using the mouse---more precisely, if @code{last-nonmenu-event} |
| 1880 | (@pxref{Command Loop Info}) is either @code{nil} or a list---then it | 1860 | (@pxref{Command Loop Info}) is either @code{nil} or a list---then it |
| 1881 | uses a dialog box or pop-up menu to ask the question. Otherwise, it | 1861 | uses a dialog box or pop-up menu to ask the question. Otherwise, it |
| 1882 | uses keyboard input. You can force use of the mouse or use of keyboard | 1862 | uses keyboard input. You can force use either of the mouse or of keyboard |
| 1883 | input by binding @code{last-nonmenu-event} to a suitable value around | 1863 | input by binding @code{last-nonmenu-event} to a suitable value around |
| 1884 | the call. | 1864 | the call. |
| 1885 | 1865 | ||
| @@ -1890,7 +1870,7 @@ the call. | |||
| 1890 | This function asks the user a question, expecting input in the echo | 1870 | This function asks the user a question, expecting input in the echo |
| 1891 | area. It returns @code{t} if the user types @kbd{y}, @code{nil} if the | 1871 | area. It returns @code{t} if the user types @kbd{y}, @code{nil} if the |
| 1892 | user types @kbd{n}. This function also accepts @key{SPC} to mean yes | 1872 | user types @kbd{n}. This function also accepts @key{SPC} to mean yes |
| 1893 | and @key{DEL} to mean no. It accepts @kbd{C-]} to mean ``quit,'' like | 1873 | and @key{DEL} to mean no. It accepts @kbd{C-]} to mean ``quit'', like |
| 1894 | @kbd{C-g}, because the question might look like a minibuffer and for | 1874 | @kbd{C-g}, because the question might look like a minibuffer and for |
| 1895 | that reason the user might try to use @kbd{C-]} to get out. The answer | 1875 | that reason the user might try to use @kbd{C-]} to get out. The answer |
| 1896 | is a single character, with no @key{RET} needed to terminate it. Upper | 1876 | is a single character, with no @key{RET} needed to terminate it. Upper |
| @@ -1914,12 +1894,16 @@ hardwired. The keymap @code{query-replace-map} specifies them. | |||
| 1914 | In the following example, the user first types @kbd{q}, which is | 1894 | In the following example, the user first types @kbd{q}, which is |
| 1915 | invalid. At the next prompt the user types @kbd{y}. | 1895 | invalid. At the next prompt the user types @kbd{y}. |
| 1916 | 1896 | ||
| 1897 | @c Need an interactive example, because otherwise the return value | ||
| 1898 | @c obscures the display of the valid answer. | ||
| 1917 | @smallexample | 1899 | @smallexample |
| 1918 | @group | 1900 | @group |
| 1919 | (y-or-n-p "Do you need a lift? ") | 1901 | (defun ask () |
| 1902 | (interactive) | ||
| 1903 | (y-or-n-p "Do you need a lift? ")) | ||
| 1920 | 1904 | ||
| 1921 | ;; @r{After evaluation of the preceding expression,} | 1905 | ;; @r{After evaluation of the preceding definition, @kbd{M-x ask}} |
| 1922 | ;; @r{the following prompt appears in the echo area:} | 1906 | ;; @r{causes the following prompt to appear in the echo area:} |
| 1923 | @end group | 1907 | @end group |
| 1924 | 1908 | ||
| 1925 | @group | 1909 | @group |
| @@ -1951,10 +1935,10 @@ We show successive lines of echo area messages, but only one actually | |||
| 1951 | appears on the screen at a time. | 1935 | appears on the screen at a time. |
| 1952 | @end defun | 1936 | @end defun |
| 1953 | 1937 | ||
| 1954 | @defun y-or-n-p-with-timeout prompt seconds default-value | 1938 | @defun y-or-n-p-with-timeout prompt seconds default |
| 1955 | Like @code{y-or-n-p}, except that if the user fails to answer within | 1939 | Like @code{y-or-n-p}, except that if the user fails to answer within |
| 1956 | @var{seconds} seconds, this function stops waiting and returns | 1940 | @var{seconds} seconds, this function stops waiting and returns |
| 1957 | @var{default-value}. It works by setting up a timer; see @ref{Timers}. | 1941 | @var{default}. It works by setting up a timer; see @ref{Timers}. |
| 1958 | The argument @var{seconds} may be an integer or a floating point number. | 1942 | The argument @var{seconds} may be an integer or a floating point number. |
| 1959 | @end defun | 1943 | @end defun |
| 1960 | 1944 | ||
| @@ -2022,7 +2006,7 @@ single-character answer in the echo area for each one. | |||
| 2022 | The value of @var{list} specifies the objects to ask questions about. | 2006 | The value of @var{list} specifies the objects to ask questions about. |
| 2023 | It should be either a list of objects or a generator function. If it is | 2007 | It should be either a list of objects or a generator function. If it is |
| 2024 | a function, it should expect no arguments, and should return either the | 2008 | a function, it should expect no arguments, and should return either the |
| 2025 | next object to ask about, or @code{nil} meaning stop asking questions. | 2009 | next object to ask about, or @code{nil}, meaning to stop asking questions. |
| 2026 | 2010 | ||
| 2027 | The argument @var{prompter} specifies how to ask each question. If | 2011 | The argument @var{prompter} specifies how to ask each question. If |
| 2028 | @var{prompter} is a string, the question text is computed like this: | 2012 | @var{prompter} is a string, the question text is computed like this: |
| @@ -2038,8 +2022,8 @@ where @var{object} is the next object to ask about (as obtained from | |||
| 2038 | If not a string, @var{prompter} should be a function of one argument | 2022 | If not a string, @var{prompter} should be a function of one argument |
| 2039 | (the next object to ask about) and should return the question text. If | 2023 | (the next object to ask about) and should return the question text. If |
| 2040 | the value is a string, that is the question to ask the user. The | 2024 | the value is a string, that is the question to ask the user. The |
| 2041 | function can also return @code{t} meaning do act on this object (and | 2025 | function can also return @code{t}, meaning do act on this object (and |
| 2042 | don't ask the user), or @code{nil} meaning ignore this object (and don't | 2026 | don't ask the user), or @code{nil}, meaning ignore this object (and don't |
| 2043 | ask the user). | 2027 | ask the user). |
| 2044 | 2028 | ||
| 2045 | The argument @var{actor} says how to act on the answers that the user | 2029 | The argument @var{actor} says how to act on the answers that the user |
| @@ -2080,7 +2064,7 @@ answer); @var{function} is a function of one argument (an object from | |||
| 2080 | 2064 | ||
| 2081 | When the user responds with @var{char}, @code{map-y-or-n-p} calls | 2065 | When the user responds with @var{char}, @code{map-y-or-n-p} calls |
| 2082 | @var{function}. If it returns non-@code{nil}, the object is considered | 2066 | @var{function}. If it returns non-@code{nil}, the object is considered |
| 2083 | ``acted upon,'' and @code{map-y-or-n-p} advances to the next object in | 2067 | ``acted upon'', and @code{map-y-or-n-p} advances to the next object in |
| 2084 | @var{list}. If it returns @code{nil}, the prompt is repeated for the | 2068 | @var{list}. If it returns @code{nil}, the prompt is repeated for the |
| 2085 | same object. | 2069 | same object. |
| 2086 | 2070 | ||
| @@ -2092,12 +2076,14 @@ If @code{map-y-or-n-p} is called in a command that was invoked using the | |||
| 2092 | mouse---more precisely, if @code{last-nonmenu-event} (@pxref{Command | 2076 | mouse---more precisely, if @code{last-nonmenu-event} (@pxref{Command |
| 2093 | Loop Info}) is either @code{nil} or a list---then it uses a dialog box | 2077 | Loop Info}) is either @code{nil} or a list---then it uses a dialog box |
| 2094 | or pop-up menu to ask the question. In this case, it does not use | 2078 | or pop-up menu to ask the question. In this case, it does not use |
| 2095 | keyboard input or the echo area. You can force use of the mouse or use | 2079 | keyboard input or the echo area. You can force use either of the mouse or |
| 2096 | of keyboard input by binding @code{last-nonmenu-event} to a suitable | 2080 | of keyboard input by binding @code{last-nonmenu-event} to a suitable |
| 2097 | value around the call. | 2081 | value around the call. |
| 2098 | 2082 | ||
| 2099 | The return value of @code{map-y-or-n-p} is the number of objects acted on. | 2083 | The return value of @code{map-y-or-n-p} is the number of objects acted on. |
| 2100 | @end defun | 2084 | @end defun |
| 2085 | @c FIXME An example of this would be more useful than all the | ||
| 2086 | @c preceding examples of simple things. | ||
| 2101 | 2087 | ||
| 2102 | @node Reading a Password | 2088 | @node Reading a Password |
| 2103 | @section Reading a Password | 2089 | @section Reading a Password |
| @@ -2160,6 +2146,19 @@ This command replaces the minibuffer contents with the value of the | |||
| 2160 | regular expression). | 2146 | regular expression). |
| 2161 | @end deffn | 2147 | @end deffn |
| 2162 | 2148 | ||
| 2149 | @deffn Command previous-complete-history-element n | ||
| 2150 | This command replaces the minibuffer contents with the value of the | ||
| 2151 | @var{n}th previous (older) history element that completes the current | ||
| 2152 | contents of the minibuffer before the point. | ||
| 2153 | @end deffn | ||
| 2154 | |||
| 2155 | @deffn Command next-complete-history-element n | ||
| 2156 | This command replaces the minibuffer contents with the value of the | ||
| 2157 | @var{n}th next (newer) history element that completes the current | ||
| 2158 | contents of the minibuffer before the point. | ||
| 2159 | @end deffn | ||
| 2160 | |||
| 2161 | |||
| 2163 | @node Minibuffer Windows | 2162 | @node Minibuffer Windows |
| 2164 | @section Minibuffer Windows | 2163 | @section Minibuffer Windows |
| 2165 | @cindex minibuffer windows | 2164 | @cindex minibuffer windows |
| @@ -2169,7 +2168,7 @@ and test whether they are active. | |||
| 2169 | 2168 | ||
| 2170 | @defun active-minibuffer-window | 2169 | @defun active-minibuffer-window |
| 2171 | This function returns the currently active minibuffer window, or | 2170 | This function returns the currently active minibuffer window, or |
| 2172 | @code{nil} if none is currently active. | 2171 | @code{nil} if there is none. |
| 2173 | @end defun | 2172 | @end defun |
| 2174 | 2173 | ||
| 2175 | @defun minibuffer-window &optional frame | 2174 | @defun minibuffer-window &optional frame |
| @@ -2202,8 +2201,8 @@ there can be more than one minibuffer window if there is more than one | |||
| 2202 | frame. | 2201 | frame. |
| 2203 | 2202 | ||
| 2204 | @defun minibuffer-window-active-p window | 2203 | @defun minibuffer-window-active-p window |
| 2205 | This function returns non-@code{nil} if @var{window}, assumed to be | 2204 | This function returns non-@code{nil} if @var{window} is the currently |
| 2206 | a minibuffer window, is currently active. | 2205 | active minibuffer window. |
| 2207 | @end defun | 2206 | @end defun |
| 2208 | 2207 | ||
| 2209 | @node Minibuffer Contents | 2208 | @node Minibuffer Contents |
| @@ -2318,7 +2317,7 @@ minibuffer, it scrolls this window. | |||
| 2318 | @end defvar | 2317 | @end defvar |
| 2319 | 2318 | ||
| 2320 | @defun minibuffer-selected-window | 2319 | @defun minibuffer-selected-window |
| 2321 | This function returns the window which was selected when the | 2320 | This function returns the window that was selected when the |
| 2322 | minibuffer was entered. If selected window is not a minibuffer | 2321 | minibuffer was entered. If selected window is not a minibuffer |
| 2323 | window, it returns @code{nil}. | 2322 | window, it returns @code{nil}. |
| 2324 | @end defun | 2323 | @end defun |
| @@ -2329,10 +2328,19 @@ windows. If a float, it specifies a fraction of the height of the | |||
| 2329 | frame. If an integer, it specifies a number of lines. | 2328 | frame. If an integer, it specifies a number of lines. |
| 2330 | @end defopt | 2329 | @end defopt |
| 2331 | 2330 | ||
| 2331 | @vindex minibuffer-message-timeout | ||
| 2332 | @defun minibuffer-message string &rest args | 2332 | @defun minibuffer-message string &rest args |
| 2333 | This function displays @var{string} temporarily at the end of the | 2333 | This function displays @var{string} temporarily at the end of the |
| 2334 | minibuffer text, for two seconds, or until the next input event | 2334 | minibuffer text, for a few seconds, or until the next input event |
| 2335 | arrives, whichever comes first. If @var{args} is non-@code{nil}, the | 2335 | arrives, whichever comes first. The variable |
| 2336 | actual message is obtained by passing @var{string} and @var{args} | 2336 | @code{minibuffer-message-timeout} specifies the number of seconds to |
| 2337 | through @code{format}. @xref{Formatting Strings}. | 2337 | wait in the absence of input. It defaults to 2. If @var{args} is |
| 2338 | non-@code{nil}, the actual message is obtained by passing @var{string} | ||
| 2339 | and @var{args} through @code{format}. @xref{Formatting Strings}. | ||
| 2338 | @end defun | 2340 | @end defun |
| 2341 | |||
| 2342 | @deffn Command minibuffer-inactive-mode | ||
| 2343 | This is the major mode used in inactive minibuffers. It uses | ||
| 2344 | keymap @code{minibuffer-inactive-mode-map}. This can be useful | ||
| 2345 | if the minibuffer is in a separate frame. @xref{Minibuffers and Frames}. | ||
| 2346 | @end deffn | ||
diff --git a/doc/lispref/processes.texi b/doc/lispref/processes.texi index 5a08fc9711e..71736584865 100644 --- a/doc/lispref/processes.texi +++ b/doc/lispref/processes.texi | |||
| @@ -561,8 +561,13 @@ already exists, then @var{name} is modified (by appending @samp{<1>}, | |||
| 561 | etc.) to be unique. The buffer @var{buffer-or-name} is the buffer to | 561 | etc.) to be unique. The buffer @var{buffer-or-name} is the buffer to |
| 562 | associate with the process. | 562 | associate with the process. |
| 563 | 563 | ||
| 564 | If @var{program} is @code{nil}, Emacs opens a new pseudoterminal (pty) | ||
| 565 | and associates its input and output with @var{buffer-or-name}, without | ||
| 566 | creating a subprocess. In that case, the remaining arguments | ||
| 567 | @var{args} are ignored. | ||
| 568 | |||
| 564 | The remaining arguments, @var{args}, are strings that specify command | 569 | The remaining arguments, @var{args}, are strings that specify command |
| 565 | line arguments for the program. | 570 | line arguments for the subprocess. |
| 566 | 571 | ||
| 567 | In the example below, the first process is started and runs (rather, | 572 | In the example below, the first process is started and runs (rather, |
| 568 | sleeps) for 100 seconds (the output buffer @samp{foo} is created | 573 | sleeps) for 100 seconds (the output buffer @samp{foo} is created |
| @@ -728,17 +733,17 @@ happen sooner or later). | |||
| 728 | @section Process Information | 733 | @section Process Information |
| 729 | 734 | ||
| 730 | Several functions return information about processes. | 735 | Several functions return information about processes. |
| 731 | @code{list-processes} is provided for interactive use. | ||
| 732 | 736 | ||
| 733 | @deffn Command list-processes &optional query-only | 737 | @deffn Command list-processes &optional query-only buffer |
| 734 | This command displays a listing of all living processes. In addition, | 738 | This command displays a listing of all living processes. In addition, |
| 735 | it finally deletes any process whose status was @samp{Exited} or | 739 | it finally deletes any process whose status was @samp{Exited} or |
| 736 | @samp{Signaled}. It returns @code{nil}. | 740 | @samp{Signaled}. It returns @code{nil}. |
| 737 | 741 | ||
| 738 | The processes are shown in a buffer named @file{*Process List*}, whose | 742 | The processes are shown in a buffer named @file{*Process List*} |
| 739 | major mode is named Process Menu mode. | 743 | (unless you specify otherwise using the optional argument @var{buffer}), |
| 744 | whose major mode is Process Menu mode. | ||
| 740 | 745 | ||
| 741 | If @var{query-only} is non-@code{nil} then it lists only processes | 746 | If @var{query-only} is non-@code{nil}, it only lists processes |
| 742 | whose query flag is non-@code{nil}. @xref{Query Before Exit}. | 747 | whose query flag is non-@code{nil}. @xref{Query Before Exit}. |
| 743 | @end deffn | 748 | @end deffn |
| 744 | 749 | ||
| @@ -754,8 +759,8 @@ This function returns a list of all processes that have not been deleted. | |||
| 754 | @end defun | 759 | @end defun |
| 755 | 760 | ||
| 756 | @defun get-process name | 761 | @defun get-process name |
| 757 | This function returns the process named @var{name}, or @code{nil} if | 762 | This function returns the process named @var{name} (a string), or |
| 758 | there is none. An error is signaled if @var{name} is not a string. | 763 | @code{nil} if there is none. |
| 759 | 764 | ||
| 760 | @smallexample | 765 | @smallexample |
| 761 | @group | 766 | @group |
| @@ -774,7 +779,7 @@ were given to the program. | |||
| 774 | @smallexample | 779 | @smallexample |
| 775 | @group | 780 | @group |
| 776 | (process-command (get-process "shell")) | 781 | (process-command (get-process "shell")) |
| 777 | @result{} ("/bin/csh" "-i") | 782 | @result{} ("bash" "-i") |
| 778 | @end group | 783 | @end group |
| 779 | @end smallexample | 784 | @end smallexample |
| 780 | @end defun | 785 | @end defun |
| @@ -782,11 +787,10 @@ were given to the program. | |||
| 782 | @defun process-contact process &optional key | 787 | @defun process-contact process &optional key |
| 783 | 788 | ||
| 784 | This function returns information about how a network or serial | 789 | This function returns information about how a network or serial |
| 785 | process was set up. For a network process, when @var{key} is | 790 | process was set up. When @var{key} is @code{nil}, it returns |
| 786 | @code{nil}, it returns @code{(@var{hostname} @var{service})} which | 791 | @code{(@var{hostname} @var{service})} for a network process, and |
| 787 | specifies what you connected to. For a serial process, when @var{key} | 792 | @code{(@var{port} @var{speed})} for a serial process. |
| 788 | is @code{nil}, it returns @code{(@var{port} @var{speed})}. For an | 793 | For an ordinary child process, this function always returns @code{t}. |
| 789 | ordinary child process, this function always returns @code{t}. | ||
| 790 | 794 | ||
| 791 | If @var{key} is @code{t}, the value is the complete status information | 795 | If @var{key} is @code{t}, the value is the complete status information |
| 792 | for the connection, server, or serial port; that is, the list of | 796 | for the connection, server, or serial port; that is, the list of |
| @@ -794,7 +798,8 @@ keywords and values specified in @code{make-network-process} or | |||
| 794 | @code{make-serial-process}, except that some of the values represent | 798 | @code{make-serial-process}, except that some of the values represent |
| 795 | the current status instead of what you specified. | 799 | the current status instead of what you specified. |
| 796 | 800 | ||
| 797 | For a network process: | 801 | For a network process, the values include (see |
| 802 | @code{make-network-process} for a complete list): | ||
| 798 | 803 | ||
| 799 | @table @code | 804 | @table @code |
| 800 | @item :buffer | 805 | @item :buffer |
| @@ -831,7 +836,7 @@ process is started and remains constant as long as the process exists. | |||
| 831 | @end defun | 836 | @end defun |
| 832 | 837 | ||
| 833 | @defun process-name process | 838 | @defun process-name process |
| 834 | This function returns the name of @var{process}. | 839 | This function returns the name of @var{process}, as a string. |
| 835 | @end defun | 840 | @end defun |
| 836 | 841 | ||
| 837 | @defun process-status process-name | 842 | @defun process-status process-name |
| @@ -871,12 +876,6 @@ if @var{process-name} is not the name of an existing process. | |||
| 871 | (process-status (get-buffer "*shell*")) | 876 | (process-status (get-buffer "*shell*")) |
| 872 | @result{} run | 877 | @result{} run |
| 873 | @end group | 878 | @end group |
| 874 | @group | ||
| 875 | x | ||
| 876 | @result{} #<process xx<1>> | ||
| 877 | (process-status x) | ||
| 878 | @result{} exit | ||
| 879 | @end group | ||
| 880 | @end smallexample | 879 | @end smallexample |
| 881 | 880 | ||
| 882 | For a network connection, @code{process-status} returns one of the symbols | 881 | For a network connection, @code{process-status} returns one of the symbols |
| @@ -914,13 +913,9 @@ the remote host is provided as process property @code{remote-tty}. | |||
| 914 | 913 | ||
| 915 | @defun process-coding-system process | 914 | @defun process-coding-system process |
| 916 | @anchor{Coding systems for a subprocess} | 915 | @anchor{Coding systems for a subprocess} |
| 917 | This function returns a cons cell describing the coding systems in use | 916 | This function returns a cons cell @code{(@var{decode} . @var{encode})}, |
| 918 | for decoding output from @var{process} and for encoding input to | 917 | describing the coding systems in use for decoding output from, and |
| 919 | @var{process} (@pxref{Coding Systems}). The value has this form: | 918 | encoding input to, @var{process} (@pxref{Coding Systems}). |
| 920 | |||
| 921 | @example | ||
| 922 | (@var{coding-system-for-decoding} . @var{coding-system-for-encoding}) | ||
| 923 | @end example | ||
| 924 | @end defun | 919 | @end defun |
| 925 | 920 | ||
| 926 | @defun set-process-coding-system process &optional decoding-system encoding-system | 921 | @defun set-process-coding-system process &optional decoding-system encoding-system |
| @@ -960,6 +955,7 @@ Emacs, which is done with the functions in this section. You must | |||
| 960 | specify the process to send input to, and the input data to send. The | 955 | specify the process to send input to, and the input data to send. The |
| 961 | data appears on the ``standard input'' of the subprocess. | 956 | data appears on the ``standard input'' of the subprocess. |
| 962 | 957 | ||
| 958 | @c FIXME which? | ||
| 963 | Some operating systems have limited space for buffered input in a | 959 | Some operating systems have limited space for buffered input in a |
| 964 | @acronym{PTY}. On these systems, Emacs sends an @acronym{EOF} | 960 | @acronym{PTY}. On these systems, Emacs sends an @acronym{EOF} |
| 965 | periodically amidst the other characters, to force them through. For | 961 | periodically amidst the other characters, to force them through. For |
| @@ -986,26 +982,14 @@ the current buffer's process. | |||
| 986 | 982 | ||
| 987 | @defun process-send-string process string | 983 | @defun process-send-string process string |
| 988 | This function sends @var{process} the contents of @var{string} as | 984 | This function sends @var{process} the contents of @var{string} as |
| 989 | standard input. If it is @code{nil}, the current buffer's process is used. | 985 | standard input. It returns @code{nil}. For example, to make a |
| 990 | 986 | Shell buffer list files: | |
| 991 | The function returns @code{nil}. | ||
| 992 | 987 | ||
| 993 | @smallexample | 988 | @smallexample |
| 994 | @group | 989 | @group |
| 995 | (process-send-string "shell<1>" "ls\n") | 990 | (process-send-string "shell<1>" "ls\n") |
| 996 | @result{} nil | 991 | @result{} nil |
| 997 | @end group | 992 | @end group |
| 998 | |||
| 999 | |||
| 1000 | @group | ||
| 1001 | ---------- Buffer: *shell* ---------- | ||
| 1002 | ... | ||
| 1003 | introduction.texi syntax-tables.texi~ | ||
| 1004 | introduction.texi~ text.texi | ||
| 1005 | introduction.txt text.texi~ | ||
| 1006 | ... | ||
| 1007 | ---------- Buffer: *shell* ---------- | ||
| 1008 | @end group | ||
| 1009 | @end smallexample | 993 | @end smallexample |
| 1010 | @end defun | 994 | @end defun |
| 1011 | 995 | ||
| @@ -1021,7 +1005,6 @@ is unimportant which number is larger.) | |||
| 1021 | @defun process-send-eof &optional process | 1005 | @defun process-send-eof &optional process |
| 1022 | This function makes @var{process} see an end-of-file in its | 1006 | This function makes @var{process} see an end-of-file in its |
| 1023 | input. The @acronym{EOF} comes after any text already sent to it. | 1007 | input. The @acronym{EOF} comes after any text already sent to it. |
| 1024 | |||
| 1025 | The function returns @var{process}. | 1008 | The function returns @var{process}. |
| 1026 | 1009 | ||
| 1027 | @smallexample | 1010 | @smallexample |
| @@ -1052,7 +1035,7 @@ system. For example, the signal @code{SIGINT} means that the user has | |||
| 1052 | typed @kbd{C-c}, or that some analogous thing has happened. | 1035 | typed @kbd{C-c}, or that some analogous thing has happened. |
| 1053 | 1036 | ||
| 1054 | Each signal has a standard effect on the subprocess. Most signals | 1037 | Each signal has a standard effect on the subprocess. Most signals |
| 1055 | kill the subprocess, but some stop or resume execution instead. Most | 1038 | kill the subprocess, but some stop (or resume) execution instead. Most |
| 1056 | signals can optionally be handled by programs; if the program handles | 1039 | signals can optionally be handled by programs; if the program handles |
| 1057 | the signal, then we can say nothing in general about its effects. | 1040 | the signal, then we can say nothing in general about its effects. |
| 1058 | 1041 | ||
| @@ -1061,7 +1044,7 @@ section. Emacs also sends signals automatically at certain times: | |||
| 1061 | killing a buffer sends a @code{SIGHUP} signal to all its associated | 1044 | killing a buffer sends a @code{SIGHUP} signal to all its associated |
| 1062 | processes; killing Emacs sends a @code{SIGHUP} signal to all remaining | 1045 | processes; killing Emacs sends a @code{SIGHUP} signal to all remaining |
| 1063 | processes. (@code{SIGHUP} is a signal that usually indicates that the | 1046 | processes. (@code{SIGHUP} is a signal that usually indicates that the |
| 1064 | user hung up the phone.) | 1047 | user ``hung up the phone'', i.e., disconnected.) |
| 1065 | 1048 | ||
| 1066 | Each of the signal-sending functions takes two optional arguments: | 1049 | Each of the signal-sending functions takes two optional arguments: |
| 1067 | @var{process} and @var{current-group}. | 1050 | @var{process} and @var{current-group}. |
| @@ -1105,6 +1088,8 @@ and cannot be handled by the subprocess. | |||
| 1105 | @defun quit-process &optional process current-group | 1088 | @defun quit-process &optional process current-group |
| 1106 | This function sends the signal @code{SIGQUIT} to the process | 1089 | This function sends the signal @code{SIGQUIT} to the process |
| 1107 | @var{process}. This signal is the one sent by the ``quit | 1090 | @var{process}. This signal is the one sent by the ``quit |
| 1091 | @c FIXME? Never heard of C-b being used for this. In readline, eg | ||
| 1092 | @c bash, that is backward-word. | ||
| 1108 | character'' (usually @kbd{C-b} or @kbd{C-\}) when you are not inside | 1093 | character'' (usually @kbd{C-b} or @kbd{C-\}) when you are not inside |
| 1109 | Emacs. | 1094 | Emacs. |
| 1110 | @end defun | 1095 | @end defun |
| @@ -1129,11 +1114,12 @@ stopped previously. | |||
| 1129 | 1114 | ||
| 1130 | @defun signal-process process signal | 1115 | @defun signal-process process signal |
| 1131 | This function sends a signal to process @var{process}. The argument | 1116 | This function sends a signal to process @var{process}. The argument |
| 1132 | @var{signal} specifies which signal to send; it should be an integer. | 1117 | @var{signal} specifies which signal to send; it should be an integer, |
| 1118 | or a symbol whose name is a signal. | ||
| 1133 | 1119 | ||
| 1134 | The @var{process} argument can be a system process @acronym{ID}; that | 1120 | The @var{process} argument can be a system process @acronym{ID} (an |
| 1135 | allows you to send signals to processes that are not children of | 1121 | integer); that allows you to send signals to processes that are not |
| 1136 | Emacs. @xref{System Processes}. | 1122 | children of Emacs. @xref{System Processes}. |
| 1137 | @end defun | 1123 | @end defun |
| 1138 | 1124 | ||
| 1139 | @node Output from Processes | 1125 | @node Output from Processes |
| @@ -1143,10 +1129,10 @@ Emacs. @xref{System Processes}. | |||
| 1143 | 1129 | ||
| 1144 | There are two ways to receive the output that a subprocess writes to | 1130 | There are two ways to receive the output that a subprocess writes to |
| 1145 | its standard output stream. The output can be inserted in a buffer, | 1131 | its standard output stream. The output can be inserted in a buffer, |
| 1146 | which is called the associated buffer of the process, or a function | 1132 | which is called the associated buffer of the process (@pxref{Process |
| 1147 | called the @dfn{filter function} can be called to act on the output. If | 1133 | Buffers}), or a function called the @dfn{filter function} can be |
| 1148 | the process has no buffer and no filter function, its output is | 1134 | called to act on the output. If the process has no buffer and no |
| 1149 | discarded. | 1135 | filter function, its output is discarded. |
| 1150 | 1136 | ||
| 1151 | When a subprocess terminates, Emacs reads any pending output, | 1137 | When a subprocess terminates, Emacs reads any pending output, |
| 1152 | then stops reading output from that subprocess. Therefore, if the | 1138 | then stops reading output from that subprocess. Therefore, if the |
| @@ -1154,19 +1140,20 @@ subprocess has children that are still live and still producing | |||
| 1154 | output, Emacs won't receive that output. | 1140 | output, Emacs won't receive that output. |
| 1155 | 1141 | ||
| 1156 | Output from a subprocess can arrive only while Emacs is waiting: when | 1142 | Output from a subprocess can arrive only while Emacs is waiting: when |
| 1157 | reading terminal input, in @code{sit-for} and @code{sleep-for} | 1143 | reading terminal input (see the function @code{waiting-for-user-input-p}), |
| 1158 | (@pxref{Waiting}), and in @code{accept-process-output} (@pxref{Accepting | 1144 | in @code{sit-for} and @code{sleep-for} (@pxref{Waiting}), and in |
| 1159 | Output}). This minimizes the problem of timing errors that usually | 1145 | @code{accept-process-output} (@pxref{Accepting Output}). This |
| 1160 | plague parallel programming. For example, you can safely create a | 1146 | minimizes the problem of timing errors that usually plague parallel |
| 1161 | process and only then specify its buffer or filter function; no output | 1147 | programming. For example, you can safely create a process and only |
| 1162 | can arrive before you finish, if the code in between does not call any | 1148 | then specify its buffer or filter function; no output can arrive |
| 1163 | primitive that waits. | 1149 | before you finish, if the code in between does not call any primitive |
| 1150 | that waits. | ||
| 1164 | 1151 | ||
| 1165 | @defvar process-adaptive-read-buffering | 1152 | @defvar process-adaptive-read-buffering |
| 1166 | On some systems, when Emacs reads the output from a subprocess, the | 1153 | On some systems, when Emacs reads the output from a subprocess, the |
| 1167 | output data is read in very small blocks, potentially resulting in | 1154 | output data is read in very small blocks, potentially resulting in |
| 1168 | very poor performance. This behavior can be remedied to some extent | 1155 | very poor performance. This behavior can be remedied to some extent |
| 1169 | by setting the variable @var{process-adaptive-read-buffering} to a | 1156 | by setting the variable @code{process-adaptive-read-buffering} to a |
| 1170 | non-@code{nil} value (the default), as it will automatically delay reading | 1157 | non-@code{nil} value (the default), as it will automatically delay reading |
| 1171 | from such processes, thus allowing them to produce more output before | 1158 | from such processes, thus allowing them to produce more output before |
| 1172 | Emacs tries to read it. | 1159 | Emacs tries to read it. |
| @@ -1235,9 +1222,9 @@ to insert, and updates it to point after the inserted text. That is why | |||
| 1235 | successive batches of output are inserted consecutively. | 1222 | successive batches of output are inserted consecutively. |
| 1236 | 1223 | ||
| 1237 | Filter functions normally should use this marker in the same fashion | 1224 | Filter functions normally should use this marker in the same fashion |
| 1238 | as is done by direct insertion of output in the buffer. A good | 1225 | as is done by direct insertion of output in the buffer. For an |
| 1239 | example of a filter function that uses @code{process-mark} is found at | 1226 | example of a filter function that uses @code{process-mark}, |
| 1240 | the end of the following section. | 1227 | @pxref{Process Filter Example}. |
| 1241 | 1228 | ||
| 1242 | When the user is expected to enter input in the process buffer for | 1229 | When the user is expected to enter input in the process buffer for |
| 1243 | transmission to the process, the process marker separates the new input | 1230 | transmission to the process, the process marker separates the new input |
| @@ -1285,14 +1272,16 @@ there is no filter. | |||
| 1285 | 1272 | ||
| 1286 | The filter function can only be called when Emacs is waiting for | 1273 | The filter function can only be called when Emacs is waiting for |
| 1287 | something, because process output arrives only at such times. Emacs | 1274 | something, because process output arrives only at such times. Emacs |
| 1288 | waits when reading terminal input, in @code{sit-for} and | 1275 | waits when reading terminal input (see the function |
| 1289 | @code{sleep-for} (@pxref{Waiting}), and in @code{accept-process-output} | 1276 | @code{waiting-for-user-input-p}), in @code{sit-for} and |
| 1290 | (@pxref{Accepting Output}). | 1277 | @code{sleep-for} (@pxref{Waiting}), and in |
| 1278 | @code{accept-process-output} (@pxref{Accepting Output}). | ||
| 1291 | 1279 | ||
| 1292 | A filter function must accept two arguments: the associated process | 1280 | A filter function must accept two arguments: the associated process |
| 1293 | and a string, which is output just received from it. The function is | 1281 | and a string, which is output just received from it. The function is |
| 1294 | then free to do whatever it chooses with the output. | 1282 | then free to do whatever it chooses with the output. |
| 1295 | 1283 | ||
| 1284 | @c Note this text is duplicated in the sentinels section. | ||
| 1296 | Quitting is normally inhibited within a filter function---otherwise, | 1285 | Quitting is normally inhibited within a filter function---otherwise, |
| 1297 | the effect of typing @kbd{C-g} at command level or to quit a user | 1286 | the effect of typing @kbd{C-g} at command level or to quit a user |
| 1298 | command would be unpredictable. If you want to permit quitting inside | 1287 | command would be unpredictable. If you want to permit quitting inside |
| @@ -1303,19 +1292,20 @@ cases, the right way to do this is with the macro | |||
| 1303 | If an error happens during execution of a filter function, it is | 1292 | If an error happens during execution of a filter function, it is |
| 1304 | caught automatically, so that it doesn't stop the execution of whatever | 1293 | caught automatically, so that it doesn't stop the execution of whatever |
| 1305 | program was running when the filter function was started. However, if | 1294 | program was running when the filter function was started. However, if |
| 1306 | @code{debug-on-error} is non-@code{nil}, the error-catching is turned | 1295 | @code{debug-on-error} is non-@code{nil}, errors are not caught. |
| 1307 | off. This makes it possible to use the Lisp debugger to debug the | 1296 | This makes it possible to use the Lisp debugger to debug the |
| 1308 | filter function. @xref{Debugger}. | 1297 | filter function. @xref{Debugger}. |
| 1309 | 1298 | ||
| 1310 | Many filter functions sometimes or always insert the text in the | 1299 | Many filter functions sometimes (or always) insert the output in the |
| 1311 | process's buffer, mimicking the actions of Emacs when there is no | 1300 | process's buffer, mimicking the actions of Emacs when there is no |
| 1312 | filter. Such filter functions need to use @code{set-buffer} in order to | 1301 | filter. Such filter functions need to make sure that they save the |
| 1313 | be sure to insert in that buffer. To avoid setting the current buffer | 1302 | current buffer, select the correct buffer (if different) before |
| 1314 | semipermanently, these filter functions must save and restore the | 1303 | inserting output, and then restore the original buffer. |
| 1315 | current buffer. They should also check whether the buffer is still | 1304 | They should also check whether the buffer is still alive, update the |
| 1316 | alive, update the process marker, and in some cases update the value | 1305 | process marker, and in some cases update the value of point. Here is |
| 1317 | of point. Here is how to do these things: | 1306 | how to do these things: |
| 1318 | 1307 | ||
| 1308 | @anchor{Process Filter Example} | ||
| 1319 | @smallexample | 1309 | @smallexample |
| 1320 | @group | 1310 | @group |
| 1321 | (defun ordinary-insertion-filter (proc string) | 1311 | (defun ordinary-insertion-filter (proc string) |
| @@ -1325,7 +1315,7 @@ of point. Here is how to do these things: | |||
| 1325 | @end group | 1315 | @end group |
| 1326 | @group | 1316 | @group |
| 1327 | (save-excursion | 1317 | (save-excursion |
| 1328 | ;; @r{Insert the text, advancing the process marker.} | 1318 | ;; @r{Insert the text, advancing the process marker.} |
| 1329 | (goto-char (process-mark proc)) | 1319 | (goto-char (process-mark proc)) |
| 1330 | (insert string) | 1320 | (insert string) |
| 1331 | (set-marker (process-mark proc) (point))) | 1321 | (set-marker (process-mark proc) (point))) |
| @@ -1333,14 +1323,8 @@ of point. Here is how to do these things: | |||
| 1333 | @end group | 1323 | @end group |
| 1334 | @end smallexample | 1324 | @end smallexample |
| 1335 | 1325 | ||
| 1336 | @noindent | ||
| 1337 | The reason to use @code{with-current-buffer}, rather than using | ||
| 1338 | @code{save-excursion} to save and restore the current buffer, is so as | ||
| 1339 | to preserve the change in point made by the second call to | ||
| 1340 | @code{goto-char}. | ||
| 1341 | |||
| 1342 | To make the filter force the process buffer to be visible whenever new | 1326 | To make the filter force the process buffer to be visible whenever new |
| 1343 | text arrives, insert the following line just before the | 1327 | text arrives, you could insert a line like the following just before the |
| 1344 | @code{with-current-buffer} construct: | 1328 | @code{with-current-buffer} construct: |
| 1345 | 1329 | ||
| 1346 | @smallexample | 1330 | @smallexample |
| @@ -1351,12 +1335,16 @@ text arrives, insert the following line just before the | |||
| 1351 | previously, eliminate the variable @code{moving} and call | 1335 | previously, eliminate the variable @code{moving} and call |
| 1352 | @code{goto-char} unconditionally. | 1336 | @code{goto-char} unconditionally. |
| 1353 | 1337 | ||
| 1338 | @ignore | ||
| 1354 | In earlier Emacs versions, every filter function that did regular | 1339 | In earlier Emacs versions, every filter function that did regular |
| 1355 | expression searching or matching had to explicitly save and restore the | 1340 | expression searching or matching had to explicitly save and restore the |
| 1356 | match data. Now Emacs does this automatically for filter functions; | 1341 | match data. Now Emacs does this automatically for filter functions; |
| 1357 | they never need to do it explicitly. @xref{Match Data}. | 1342 | they never need to do it explicitly. |
| 1343 | @end ignore | ||
| 1344 | Note that Emacs automatically saves and restores the match data | ||
| 1345 | while executing filter functions. @xref{Match Data}. | ||
| 1358 | 1346 | ||
| 1359 | The output to the function may come in chunks of any size. A program | 1347 | The output to the filter may come in chunks of any size. A program |
| 1360 | that produces the same output twice in a row may send it as one batch of | 1348 | that produces the same output twice in a row may send it as one batch of |
| 1361 | 200 characters one time, and five batches of 40 characters the next. If | 1349 | 200 characters one time, and five batches of 40 characters the next. If |
| 1362 | the filter looks for certain text strings in the subprocess output, make | 1350 | the filter looks for certain text strings in the subprocess output, make |
| @@ -1374,7 +1362,7 @@ This function returns the filter function of @var{process}, or @code{nil} | |||
| 1374 | if it has none. | 1362 | if it has none. |
| 1375 | @end defun | 1363 | @end defun |
| 1376 | 1364 | ||
| 1377 | Here is an example of use of a filter function: | 1365 | Here is an example of the use of a filter function: |
| 1378 | 1366 | ||
| 1379 | @smallexample | 1367 | @smallexample |
| 1380 | @group | 1368 | @group |
| @@ -1394,7 +1382,7 @@ if it has none. | |||
| 1394 | (process-send-string "shell" "ls ~/other\n") | 1382 | (process-send-string "shell" "ls ~/other\n") |
| 1395 | @result{} nil | 1383 | @result{} nil |
| 1396 | kept | 1384 | kept |
| 1397 | @result{} ("lewis@@slug[8] % " | 1385 | @result{} ("lewis@@slug:$ " |
| 1398 | @end group | 1386 | @end group |
| 1399 | @group | 1387 | @group |
| 1400 | "FINAL-W87-SHORT.MSS backup.otl kolstad.mss~ | 1388 | "FINAL-W87-SHORT.MSS backup.otl kolstad.mss~ |
| @@ -1450,8 +1438,8 @@ bytes, Emacs by default uses @code{no-conversion} for it; see | |||
| 1450 | @ref{Lisp and Coding Systems, inhibit-null-byte-detection}, for how to | 1438 | @ref{Lisp and Coding Systems, inhibit-null-byte-detection}, for how to |
| 1451 | control this behavior. | 1439 | control this behavior. |
| 1452 | 1440 | ||
| 1453 | @strong{Warning:} Coding systems such as @code{undecided} which | 1441 | @strong{Warning:} Coding systems such as @code{undecided}, which |
| 1454 | determine the coding system from the data do not work entirely | 1442 | determine the coding system from the data, do not work entirely |
| 1455 | reliably with asynchronous subprocess output. This is because Emacs | 1443 | reliably with asynchronous subprocess output. This is because Emacs |
| 1456 | has to process asynchronous subprocess output in batches, as it | 1444 | has to process asynchronous subprocess output in batches, as it |
| 1457 | arrives. Emacs must try to detect the proper coding system from one | 1445 | arrives. Emacs must try to detect the proper coding system from one |
| @@ -1469,7 +1457,7 @@ output as a multibyte string or as a unibyte string according to the | |||
| 1469 | process's filter coding system. Emacs | 1457 | process's filter coding system. Emacs |
| 1470 | decodes the output according to the process output coding system, | 1458 | decodes the output according to the process output coding system, |
| 1471 | which usually produces a multibyte string, except for coding systems | 1459 | which usually produces a multibyte string, except for coding systems |
| 1472 | such as @code{binary} and @code{raw-text} | 1460 | such as @code{binary} and @code{raw-text}. |
| 1473 | 1461 | ||
| 1474 | @node Accepting Output | 1462 | @node Accepting Output |
| 1475 | @subsection Accepting Output from Processes | 1463 | @subsection Accepting Output from Processes |
| @@ -1487,7 +1475,6 @@ output is inserted in the associated buffers or given to their filter | |||
| 1487 | functions. If @var{process} is non-@code{nil} then this function does | 1475 | functions. If @var{process} is non-@code{nil} then this function does |
| 1488 | not return until some output has been received from @var{process}. | 1476 | not return until some output has been received from @var{process}. |
| 1489 | 1477 | ||
| 1490 | @c Emacs 19 feature | ||
| 1491 | The arguments @var{seconds} and @var{millisec} let you specify timeout | 1478 | The arguments @var{seconds} and @var{millisec} let you specify timeout |
| 1492 | periods. The former specifies a period measured in seconds and the | 1479 | periods. The former specifies a period measured in seconds and the |
| 1493 | latter specifies one measured in milliseconds. The two time periods | 1480 | latter specifies one measured in milliseconds. The two time periods |
| @@ -1495,10 +1482,10 @@ thus specified are added together, and @code{accept-process-output} | |||
| 1495 | returns after that much time, whether or not there has been any | 1482 | returns after that much time, whether or not there has been any |
| 1496 | subprocess output. | 1483 | subprocess output. |
| 1497 | 1484 | ||
| 1498 | The argument @var{millisec} is semi-obsolete nowadays because | 1485 | The argument @var{millisec} is obsolete (and should not be used), |
| 1499 | @var{seconds} can be a floating point number to specify waiting a | 1486 | because @var{seconds} can be a floating point number to specify |
| 1500 | fractional number of seconds. If @var{seconds} is 0, the function | 1487 | waiting a fractional number of seconds. If @var{seconds} is 0, the |
| 1501 | accepts whatever output is pending but does not wait. | 1488 | function accepts whatever output is pending but does not wait. |
| 1502 | 1489 | ||
| 1503 | @c Emacs 22.1 feature | 1490 | @c Emacs 22.1 feature |
| 1504 | If @var{process} is a process, and the argument @var{just-this-one} is | 1491 | If @var{process} is a process, and the argument @var{just-this-one} is |
| @@ -1529,6 +1516,7 @@ describing the type of event. | |||
| 1529 | 1516 | ||
| 1530 | The string describing the event looks like one of the following: | 1517 | The string describing the event looks like one of the following: |
| 1531 | 1518 | ||
| 1519 | @c FIXME? Also "killed\n" - see example below? | ||
| 1532 | @itemize @bullet | 1520 | @itemize @bullet |
| 1533 | @item | 1521 | @item |
| 1534 | @code{"finished\n"}. | 1522 | @code{"finished\n"}. |
| @@ -1545,7 +1533,7 @@ describing the type of event. | |||
| 1545 | 1533 | ||
| 1546 | A sentinel runs only while Emacs is waiting (e.g., for terminal | 1534 | A sentinel runs only while Emacs is waiting (e.g., for terminal |
| 1547 | input, or for time to elapse, or for process output). This avoids the | 1535 | input, or for time to elapse, or for process output). This avoids the |
| 1548 | timing errors that could result from running them at random places in | 1536 | timing errors that could result from running sentinels at random places in |
| 1549 | the middle of other Lisp programs. A program can wait, so that | 1537 | the middle of other Lisp programs. A program can wait, so that |
| 1550 | sentinels will run, by calling @code{sit-for} or @code{sleep-for} | 1538 | sentinels will run, by calling @code{sit-for} or @code{sleep-for} |
| 1551 | (@pxref{Waiting}), or @code{accept-process-output} (@pxref{Accepting | 1539 | (@pxref{Waiting}), or @code{accept-process-output} (@pxref{Accepting |
| @@ -1569,6 +1557,7 @@ should check whether the buffer is still alive. If it tries to insert | |||
| 1569 | into a dead buffer, it will get an error. If the buffer is dead, | 1557 | into a dead buffer, it will get an error. If the buffer is dead, |
| 1570 | @code{(buffer-name (process-buffer @var{process}))} returns @code{nil}. | 1558 | @code{(buffer-name (process-buffer @var{process}))} returns @code{nil}. |
| 1571 | 1559 | ||
| 1560 | @c Note this text is duplicated in the filter functions section. | ||
| 1572 | Quitting is normally inhibited within a sentinel---otherwise, the | 1561 | Quitting is normally inhibited within a sentinel---otherwise, the |
| 1573 | effect of typing @kbd{C-g} at command level or to quit a user command | 1562 | effect of typing @kbd{C-g} at command level or to quit a user command |
| 1574 | would be unpredictable. If you want to permit quitting inside a | 1563 | would be unpredictable. If you want to permit quitting inside a |
| @@ -1579,8 +1568,8 @@ right way to do this is with the macro @code{with-local-quit}. | |||
| 1579 | If an error happens during execution of a sentinel, it is caught | 1568 | If an error happens during execution of a sentinel, it is caught |
| 1580 | automatically, so that it doesn't stop the execution of whatever | 1569 | automatically, so that it doesn't stop the execution of whatever |
| 1581 | programs was running when the sentinel was started. However, if | 1570 | programs was running when the sentinel was started. However, if |
| 1582 | @code{debug-on-error} is non-@code{nil}, the error-catching is turned | 1571 | @code{debug-on-error} is non-@code{nil}, errors are not caught. |
| 1583 | off. This makes it possible to use the Lisp debugger to debug the | 1572 | This makes it possible to use the Lisp debugger to debug the |
| 1584 | sentinel. @xref{Debugger}. | 1573 | sentinel. @xref{Debugger}. |
| 1585 | 1574 | ||
| 1586 | While a sentinel is running, the process sentinel is temporarily | 1575 | While a sentinel is running, the process sentinel is temporarily |
| @@ -1588,10 +1577,14 @@ set to @code{nil} so that the sentinel won't run recursively. | |||
| 1588 | For this reason it is not possible for a sentinel to specify | 1577 | For this reason it is not possible for a sentinel to specify |
| 1589 | a new sentinel. | 1578 | a new sentinel. |
| 1590 | 1579 | ||
| 1580 | @ignore | ||
| 1591 | In earlier Emacs versions, every sentinel that did regular expression | 1581 | In earlier Emacs versions, every sentinel that did regular expression |
| 1592 | searching or matching had to explicitly save and restore the match data. | 1582 | searching or matching had to explicitly save and restore the match data. |
| 1593 | Now Emacs does this automatically for sentinels; they never need to do | 1583 | Now Emacs does this automatically for sentinels; they never need to do |
| 1594 | it explicitly. @xref{Match Data}. | 1584 | it explicitly. |
| 1585 | @end ignore | ||
| 1586 | Note that Emacs automatically saves and restores the match data | ||
| 1587 | while executing sentinels. @xref{Match Data}. | ||
| 1595 | 1588 | ||
| 1596 | @defun set-process-sentinel process sentinel | 1589 | @defun set-process-sentinel process sentinel |
| 1597 | This function associates @var{sentinel} with @var{process}. If | 1590 | This function associates @var{sentinel} with @var{process}. If |
| @@ -1599,7 +1592,7 @@ This function associates @var{sentinel} with @var{process}. If | |||
| 1599 | The default behavior when there is no sentinel is to insert a message in | 1592 | The default behavior when there is no sentinel is to insert a message in |
| 1600 | the process's buffer when the process status changes. | 1593 | the process's buffer when the process status changes. |
| 1601 | 1594 | ||
| 1602 | Changes in process sentinel take effect immediately---if the sentinel | 1595 | Changes in process sentinels take effect immediately---if the sentinel |
| 1603 | is slated to be run but has not been called yet, and you specify a new | 1596 | is slated to be run but has not been called yet, and you specify a new |
| 1604 | sentinel, the eventual call to the sentinel will use the new one. | 1597 | sentinel, the eventual call to the sentinel will use the new one. |
| 1605 | 1598 | ||
| @@ -1627,7 +1620,7 @@ has none. | |||
| 1627 | @defun waiting-for-user-input-p | 1620 | @defun waiting-for-user-input-p |
| 1628 | While a sentinel or filter function is running, this function returns | 1621 | While a sentinel or filter function is running, this function returns |
| 1629 | non-@code{nil} if Emacs was waiting for keyboard input from the user at | 1622 | non-@code{nil} if Emacs was waiting for keyboard input from the user at |
| 1630 | the time the sentinel or filter function was called, @code{nil} if it | 1623 | the time the sentinel or filter function was called, or @code{nil} if it |
| 1631 | was not. | 1624 | was not. |
| 1632 | @end defun | 1625 | @end defun |
| 1633 | 1626 | ||
| @@ -1637,7 +1630,7 @@ was not. | |||
| 1637 | When Emacs exits, it terminates all its subprocesses by sending them | 1630 | When Emacs exits, it terminates all its subprocesses by sending them |
| 1638 | the @code{SIGHUP} signal. Because subprocesses may be doing | 1631 | the @code{SIGHUP} signal. Because subprocesses may be doing |
| 1639 | valuable work, Emacs normally asks the user to confirm that it is ok | 1632 | valuable work, Emacs normally asks the user to confirm that it is ok |
| 1640 | to terminate them. Each process has a query flag which, if | 1633 | to terminate them. Each process has a query flag, which, if |
| 1641 | non-@code{nil}, says that Emacs should ask for confirmation before | 1634 | non-@code{nil}, says that Emacs should ask for confirmation before |
| 1642 | exiting and thus killing that process. The default for the query flag | 1635 | exiting and thus killing that process. The default for the query flag |
| 1643 | is @code{t}, meaning @emph{do} query. | 1636 | is @code{t}, meaning @emph{do} query. |
| @@ -1656,7 +1649,7 @@ shell process to avoid querying: | |||
| 1656 | @smallexample | 1649 | @smallexample |
| 1657 | @group | 1650 | @group |
| 1658 | (set-process-query-on-exit-flag (get-process "shell") nil) | 1651 | (set-process-query-on-exit-flag (get-process "shell") nil) |
| 1659 | @result{} t | 1652 | @result{} nil |
| 1660 | @end group | 1653 | @end group |
| 1661 | @end smallexample | 1654 | @end smallexample |
| 1662 | @end defun | 1655 | @end defun |
| @@ -1668,7 +1661,7 @@ shell process to avoid querying: | |||
| 1668 | In addition to accessing and manipulating processes that are | 1661 | In addition to accessing and manipulating processes that are |
| 1669 | subprocesses of the current Emacs session, Emacs Lisp programs can | 1662 | subprocesses of the current Emacs session, Emacs Lisp programs can |
| 1670 | also access other processes running on the same machine. We call | 1663 | also access other processes running on the same machine. We call |
| 1671 | these @dfn{system processes}, to distinguish between them and Emacs | 1664 | these @dfn{system processes}, to distinguish them from Emacs |
| 1672 | subprocesses. | 1665 | subprocesses. |
| 1673 | 1666 | ||
| 1674 | Emacs provides several primitives for accessing system processes. | 1667 | Emacs provides several primitives for accessing system processes. |
| @@ -1688,7 +1681,7 @@ This function returns an alist of attributes for the process specified | |||
| 1688 | by its process ID @var{pid}. Each association in the alist is of the | 1681 | by its process ID @var{pid}. Each association in the alist is of the |
| 1689 | form @code{(@var{key} . @var{value})}, where @var{key} designates the | 1682 | form @code{(@var{key} . @var{value})}, where @var{key} designates the |
| 1690 | attribute and @var{value} is the value of that attribute. The various | 1683 | attribute and @var{value} is the value of that attribute. The various |
| 1691 | attribute @var{key}'s that this function can return are listed below. | 1684 | attribute @var{key}s that this function can return are listed below. |
| 1692 | Not all platforms support all of these attributes; if an attribute is | 1685 | Not all platforms support all of these attributes; if an attribute is |
| 1693 | not supported, its association will not appear in the returned alist. | 1686 | not supported, its association will not appear in the returned alist. |
| 1694 | Values that are numbers can be either integer or floating-point, | 1687 | Values that are numbers can be either integer or floating-point, |
| @@ -1849,6 +1842,8 @@ as @code{shell-command}. | |||
| 1849 | @section Transaction Queues | 1842 | @section Transaction Queues |
| 1850 | @cindex transaction queue | 1843 | @cindex transaction queue |
| 1851 | 1844 | ||
| 1845 | @c That's not very informative. What is a transaction, and when might | ||
| 1846 | @c I want to use one? | ||
| 1852 | You can use a @dfn{transaction queue} to communicate with a subprocess | 1847 | You can use a @dfn{transaction queue} to communicate with a subprocess |
| 1853 | using transactions. First use @code{tq-create} to create a transaction | 1848 | using transactions. First use @code{tq-create} to create a transaction |
| 1854 | queue communicating with a specified process. Then you can call | 1849 | queue communicating with a specified process. Then you can call |
| @@ -1878,8 +1873,11 @@ text at the end of the entire answer, but nothing before; that's how | |||
| 1878 | If the argument @var{delay-question} is non-@code{nil}, delay sending | 1873 | If the argument @var{delay-question} is non-@code{nil}, delay sending |
| 1879 | this question until the process has finished replying to any previous | 1874 | this question until the process has finished replying to any previous |
| 1880 | questions. This produces more reliable results with some processes. | 1875 | questions. This produces more reliable results with some processes. |
| 1876 | @ignore | ||
| 1881 | 1877 | ||
| 1878 | @c Let's not mention it then. | ||
| 1882 | The return value of @code{tq-enqueue} itself is not meaningful. | 1879 | The return value of @code{tq-enqueue} itself is not meaningful. |
| 1880 | @end ignore | ||
| 1883 | @end defun | 1881 | @end defun |
| 1884 | 1882 | ||
| 1885 | @defun tq-close queue | 1883 | @defun tq-close queue |
| @@ -1897,10 +1895,11 @@ Transaction queues are implemented by means of a filter function. | |||
| 1897 | @cindex UDP | 1895 | @cindex UDP |
| 1898 | 1896 | ||
| 1899 | Emacs Lisp programs can open stream (TCP) and datagram (UDP) network | 1897 | Emacs Lisp programs can open stream (TCP) and datagram (UDP) network |
| 1900 | connections to other processes on the same machine or other machines. | 1898 | connections (@pxref{Datagrams}) to other processes on the same machine |
| 1899 | or other machines. | ||
| 1901 | A network connection is handled by Lisp much like a subprocess, and is | 1900 | A network connection is handled by Lisp much like a subprocess, and is |
| 1902 | represented by a process object. However, the process you are | 1901 | represented by a process object. However, the process you are |
| 1903 | communicating with is not a child of the Emacs process, so it has no | 1902 | communicating with is not a child of the Emacs process, has no |
| 1904 | process @acronym{ID}, and you can't kill it or send it signals. All you | 1903 | process @acronym{ID}, and you can't kill it or send it signals. All you |
| 1905 | can do is send and receive data. @code{delete-process} closes the | 1904 | can do is send and receive data. @code{delete-process} closes the |
| 1906 | connection, but does not kill the program at the other end; that | 1905 | connection, but does not kill the program at the other end; that |
| @@ -1928,7 +1927,7 @@ network connection or server, @code{serial} for a serial port | |||
| 1928 | connection, or @code{real} for a real subprocess. | 1927 | connection, or @code{real} for a real subprocess. |
| 1929 | 1928 | ||
| 1930 | The @code{process-status} function returns @code{open}, | 1929 | The @code{process-status} function returns @code{open}, |
| 1931 | @code{closed}, @code{connect}, and @code{failed} for network | 1930 | @code{closed}, @code{connect}, or @code{failed} for network |
| 1932 | connections. For a network server, the status is always | 1931 | connections. For a network server, the status is always |
| 1933 | @code{listen}. None of those values is possible for a real | 1932 | @code{listen}. None of those values is possible for a real |
| 1934 | subprocess. @xref{Process Information}. | 1933 | subprocess. @xref{Process Information}. |
| @@ -1938,35 +1937,48 @@ subprocess. @xref{Process Information}. | |||
| 1938 | process, being stopped means not accepting new connections. (Up to 5 | 1937 | process, being stopped means not accepting new connections. (Up to 5 |
| 1939 | connection requests will be queued for when you resume the server; you | 1938 | connection requests will be queued for when you resume the server; you |
| 1940 | can increase this limit, unless it is imposed by the operating | 1939 | can increase this limit, unless it is imposed by the operating |
| 1941 | system.) For a network stream connection, being stopped means not | 1940 | system---see the @code{:server} keyword of @code{make-network-process}, |
| 1942 | processing input (any arriving input waits until you resume the | 1941 | @ref{Network Processes}.) For a network stream connection, being |
| 1943 | connection). For a datagram connection, some number of packets may be | 1942 | stopped means not processing input (any arriving input waits until you |
| 1944 | queued but input may be lost. You can use the function | 1943 | resume the connection). For a datagram connection, some number of |
| 1944 | packets may be queued but input may be lost. You can use the function | ||
| 1945 | @code{process-command} to determine whether a network connection or | 1945 | @code{process-command} to determine whether a network connection or |
| 1946 | server is stopped; a non-@code{nil} value means yes. | 1946 | server is stopped; a non-@code{nil} value means yes. |
| 1947 | 1947 | ||
| 1948 | @cindex network connection, encrypted | 1948 | @cindex network connection, encrypted |
| 1949 | @cindex encrypted network connections | 1949 | @cindex encrypted network connections |
| 1950 | @cindex TLS network connections | 1950 | @cindex @acronym{TLS} network connections |
| 1951 | @cindex STARTTLS network connections | 1951 | @cindex @acronym{STARTTLS} network connections |
| 1952 | @defun open-network-stream name buffer-or-name host service &rest parameters | 1952 | Emacs can create encrypted network connections, using either built-in |
| 1953 | or external support. The built-in support uses the GnuTLS | ||
| 1954 | (``Transport Layer Security'') library; see | ||
| 1955 | @uref{http://www.gnu.org/software/gnutls/, the GnuTLS project page}. | ||
| 1956 | If your Emacs was compiled with GnuTLS support, the function | ||
| 1957 | @code{gnutls-available-p} is defined and returns non-@code{nil}. For | ||
| 1958 | more details, @pxref{Top,, Overview, emacs-gnutls, The Emacs-GnuTLS manual}. | ||
| 1959 | The external support uses the @file{starttls.el} library, which | ||
| 1960 | requires a helper utility such as @command{gnutls-cli} to be installed | ||
| 1961 | on the system. The @code{open-network-stream} function can | ||
| 1962 | transparently handle the details of creating encrypted connections for | ||
| 1963 | you, using whatever support is available. | ||
| 1964 | |||
| 1965 | @defun open-network-stream name buffer host service &rest parameters | ||
| 1953 | This function opens a TCP connection, with optional encryption, and | 1966 | This function opens a TCP connection, with optional encryption, and |
| 1954 | returns a process object that represents the connection. | 1967 | returns a process object that represents the connection. |
| 1955 | 1968 | ||
| 1956 | The @var{name} argument specifies the name for the process object. It | 1969 | The @var{name} argument specifies the name for the process object. It |
| 1957 | is modified as necessary to make it unique. | 1970 | is modified as necessary to make it unique. |
| 1958 | 1971 | ||
| 1959 | The @var{buffer-or-name} argument is the buffer to associate with the | 1972 | The @var{buffer} argument is the buffer to associate with the |
| 1960 | connection. Output from the connection is inserted in the buffer, | 1973 | connection. Output from the connection is inserted in the buffer, |
| 1961 | unless you specify a filter function to handle the output. If | 1974 | unless you specify a filter function to handle the output. If |
| 1962 | @var{buffer-or-name} is @code{nil}, it means that the connection is not | 1975 | @var{buffer} is @code{nil}, it means that the connection is not |
| 1963 | associated with any buffer. | 1976 | associated with any buffer. |
| 1964 | 1977 | ||
| 1965 | The arguments @var{host} and @var{service} specify where to connect to; | 1978 | The arguments @var{host} and @var{service} specify where to connect to; |
| 1966 | @var{host} is the host name (a string), and @var{service} is the name of | 1979 | @var{host} is the host name (a string), and @var{service} is the name of |
| 1967 | a defined network service (a string) or a port number (an integer). | 1980 | a defined network service (a string) or a port number (an integer). |
| 1968 | 1981 | ||
| 1969 | @c FIXME? Is this too lengthy for the printed manual? | ||
| 1970 | The remaining arguments @var{parameters} are keyword/argument pairs | 1982 | The remaining arguments @var{parameters} are keyword/argument pairs |
| 1971 | that are mainly relevant to encrypted connections: | 1983 | that are mainly relevant to encrypted connections: |
| 1972 | 1984 | ||
| @@ -1983,14 +1995,15 @@ The type of connection. Options are: | |||
| 1983 | An ordinary, unencrypted connection. | 1995 | An ordinary, unencrypted connection. |
| 1984 | @item tls | 1996 | @item tls |
| 1985 | @itemx ssl | 1997 | @itemx ssl |
| 1986 | A TLS (``Transport Layer Security'') connection. | 1998 | A @acronym{TLS} (``Transport Layer Security'') connection. |
| 1987 | @item nil | 1999 | @item nil |
| 1988 | @itemx network | 2000 | @itemx network |
| 1989 | Start with a plain connection, and if parameters @samp{:success} | 2001 | Start with a plain connection, and if parameters @samp{:success} |
| 1990 | and @samp{:capability-command} are supplied, try to upgrade to an encrypted | 2002 | and @samp{:capability-command} are supplied, try to upgrade to an encrypted |
| 1991 | connection via STARTTLS. If that fails, retain the unencrypted connection. | 2003 | connection via @acronym{STARTTLS}. If that fails, retain the |
| 2004 | unencrypted connection. | ||
| 1992 | @item starttls | 2005 | @item starttls |
| 1993 | As for @code{nil}, but if STARTTLS fails drop the connection. | 2006 | As for @code{nil}, but if @acronym{STARTTLS} fails drop the connection. |
| 1994 | @item shell | 2007 | @item shell |
| 1995 | A shell connection. | 2008 | A shell connection. |
| 1996 | @end table | 2009 | @end table |
| @@ -2009,22 +2022,22 @@ command @var{capability-command}. The latter defaults to the former. | |||
| 2009 | 2022 | ||
| 2010 | @item :starttls-function @var{function} | 2023 | @item :starttls-function @var{function} |
| 2011 | Function of one argument (the response to @var{capability-command}), | 2024 | Function of one argument (the response to @var{capability-command}), |
| 2012 | which returns either @code{nil}, or the command to activate STARTTLS | 2025 | which returns either @code{nil}, or the command to activate @acronym{STARTTLS} |
| 2013 | if supported. | 2026 | if supported. |
| 2014 | 2027 | ||
| 2015 | @item :success @var{regexp} | 2028 | @item :success @var{regexp} |
| 2016 | Regular expression matching a successful STARTTLS negotiation. | 2029 | Regular expression matching a successful @acronym{STARTTLS} negotiation. |
| 2017 | 2030 | ||
| 2018 | @item :use-starttls-if-possible @var{boolean} | 2031 | @item :use-starttls-if-possible @var{boolean} |
| 2019 | If non-@code{nil}, do opportunistic STARTTLS upgrades even if Emacs | 2032 | If non-@code{nil}, do opportunistic @acronym{STARTTLS} upgrades even if Emacs |
| 2020 | doesn't have built-in TLS support. | 2033 | doesn't have built-in @acronym{TLS} support. |
| 2021 | 2034 | ||
| 2022 | @item :client-certificate @var{list-or-t} | 2035 | @item :client-certificate @var{list-or-t} |
| 2023 | Either a list of the form @code{(@var{key-file} @var{cert-file})}, | 2036 | Either a list of the form @code{(@var{key-file} @var{cert-file})}, |
| 2024 | naming the certificate key file and certificate file itself, or | 2037 | naming the certificate key file and certificate file itself, or |
| 2025 | @code{t}, meaning to query @code{auth-source} for this information | 2038 | @code{t}, meaning to query @code{auth-source} for this information |
| 2026 | (@pxref{Top,,auth-source, auth, Emacs auth-source Library}). | 2039 | (@pxref{Top,,Overview, auth, The Auth-Source Manual}). |
| 2027 | Only used for TLS or STARTTLS. | 2040 | Only used for @acronym{TLS} or @acronym{STARTTLS}. |
| 2028 | 2041 | ||
| 2029 | @item :return-list @var{cons-or-nil} | 2042 | @item :return-list @var{cons-or-nil} |
| 2030 | The return value of this function. If omitted or @code{nil}, return a | 2043 | The return value of this function. If omitted or @code{nil}, return a |
| @@ -2048,18 +2061,20 @@ The connection type: @samp{plain} or @samp{tls}. | |||
| 2048 | @section Network Servers | 2061 | @section Network Servers |
| 2049 | @cindex network servers | 2062 | @cindex network servers |
| 2050 | 2063 | ||
| 2051 | You create a server by calling @code{make-network-process} with | 2064 | You create a server by calling @code{make-network-process} |
| 2052 | @code{:server t}. The server will listen for connection requests from | 2065 | (@pxref{Network Processes}) with @code{:server t}. The server will |
| 2053 | clients. When it accepts a client connection request, that creates a | 2066 | listen for connection requests from clients. When it accepts a client |
| 2054 | new network connection, itself a process object, with the following | 2067 | connection request, that creates a new network connection, itself a |
| 2055 | parameters: | 2068 | process object, with the following parameters: |
| 2056 | 2069 | ||
| 2057 | @itemize @bullet | 2070 | @itemize @bullet |
| 2058 | @item | 2071 | @item |
| 2059 | The connection's process name is constructed by concatenating the | 2072 | The connection's process name is constructed by concatenating the |
| 2060 | server process's @var{name} with a client identification string. The | 2073 | server process's @var{name} with a client identification string. The |
| 2074 | @c FIXME? What about IPv6? Say briefly what the difference is? | ||
| 2061 | client identification string for an IPv4 connection looks like | 2075 | client identification string for an IPv4 connection looks like |
| 2062 | @samp{<@var{a}.@var{b}.@var{c}.@var{d}:@var{p}>}. Otherwise, it is a | 2076 | @samp{<@var{a}.@var{b}.@var{c}.@var{d}:@var{p}>}, which represents an |
| 2077 | address and port number. Otherwise, it is a | ||
| 2063 | unique number in brackets, as in @samp{<@var{nnn}>}. The number | 2078 | unique number in brackets, as in @samp{<@var{nnn}>}. The number |
| 2064 | is unique for each connection in the Emacs session. | 2079 | is unique for each connection in the Emacs session. |
| 2065 | 2080 | ||
| @@ -2080,7 +2095,7 @@ uses its filter and sentinel; their sole purpose is to initialize | |||
| 2080 | connections made to the server. | 2095 | connections made to the server. |
| 2081 | 2096 | ||
| 2082 | @item | 2097 | @item |
| 2083 | The connection's process contact info is set according to the client's | 2098 | The connection's process contact information is set according to the client's |
| 2084 | addressing information (typically an IP address and a port number). | 2099 | addressing information (typically an IP address and a port number). |
| 2085 | This information is associated with the @code{process-contact} | 2100 | This information is associated with the @code{process-contact} |
| 2086 | keywords @code{:host}, @code{:service}, @code{:remote}. | 2101 | keywords @code{:host}, @code{:service}, @code{:remote}. |
| @@ -2097,7 +2112,7 @@ The client process's plist is initialized from the server's plist. | |||
| 2097 | @section Datagrams | 2112 | @section Datagrams |
| 2098 | @cindex datagrams | 2113 | @cindex datagrams |
| 2099 | 2114 | ||
| 2100 | A datagram connection communicates with individual packets rather | 2115 | A @dfn{datagram} connection communicates with individual packets rather |
| 2101 | than streams of data. Each call to @code{process-send} sends one | 2116 | than streams of data. Each call to @code{process-send} sends one |
| 2102 | datagram packet (@pxref{Input to Processes}), and each datagram | 2117 | datagram packet (@pxref{Input to Processes}), and each datagram |
| 2103 | received results in one call to the filter function. | 2118 | received results in one call to the filter function. |
| @@ -2150,7 +2165,8 @@ process object that represents it. The arguments @var{args} are a | |||
| 2150 | list of keyword/argument pairs. Omitting a keyword is always | 2165 | list of keyword/argument pairs. Omitting a keyword is always |
| 2151 | equivalent to specifying it with value @code{nil}, except for | 2166 | equivalent to specifying it with value @code{nil}, except for |
| 2152 | @code{:coding}, @code{:filter-multibyte}, and @code{:reuseaddr}. Here | 2167 | @code{:coding}, @code{:filter-multibyte}, and @code{:reuseaddr}. Here |
| 2153 | are the meaningful keywords: | 2168 | are the meaningful keywords (those corresponding to network options |
| 2169 | are listed in the following section): | ||
| 2154 | 2170 | ||
| 2155 | @table @asis | 2171 | @table @asis |
| 2156 | @item :name @var{name} | 2172 | @item :name @var{name} |
| @@ -2166,7 +2182,7 @@ connection. Both connections and servers can be of these types. | |||
| 2166 | @item :server @var{server-flag} | 2182 | @item :server @var{server-flag} |
| 2167 | If @var{server-flag} is non-@code{nil}, create a server. Otherwise, | 2183 | If @var{server-flag} is non-@code{nil}, create a server. Otherwise, |
| 2168 | create a connection. For a stream type server, @var{server-flag} may | 2184 | create a connection. For a stream type server, @var{server-flag} may |
| 2169 | be an integer which then specifies the length of the queue of pending | 2185 | be an integer, which then specifies the length of the queue of pending |
| 2170 | connections to the server. The default queue length is 5. | 2186 | connections to the server. The default queue length is 5. |
| 2171 | 2187 | ||
| 2172 | @item :host @var{host} | 2188 | @item :host @var{host} |
| @@ -2177,7 +2193,7 @@ specify a valid address for the local host, and only clients | |||
| 2177 | connecting to that address will be accepted. | 2193 | connecting to that address will be accepted. |
| 2178 | 2194 | ||
| 2179 | @item :service @var{service} | 2195 | @item :service @var{service} |
| 2180 | @var{service} specifies a port number to connect to, or, for a server, | 2196 | @var{service} specifies a port number to connect to; or, for a server, |
| 2181 | the port number to listen on. It should be a service name that | 2197 | the port number to listen on. It should be a service name that |
| 2182 | translates to a port number, or an integer specifying the port number | 2198 | translates to a port number, or an integer specifying the port number |
| 2183 | directly. For a server, it can also be @code{t}, which means to let | 2199 | directly. For a server, it can also be @code{t}, which means to let |
| @@ -2188,18 +2204,18 @@ the system select an unused port number. | |||
| 2188 | communication. @code{nil} means determine the proper address family | 2204 | communication. @code{nil} means determine the proper address family |
| 2189 | automatically for the given @var{host} and @var{service}. | 2205 | automatically for the given @var{host} and @var{service}. |
| 2190 | @code{local} specifies a Unix socket, in which case @var{host} is | 2206 | @code{local} specifies a Unix socket, in which case @var{host} is |
| 2191 | ignored. @code{ipv4} and @code{ipv6} specify to use IPv4 and IPv6 | 2207 | ignored. @code{ipv4} and @code{ipv6} specify to use IPv4 and IPv6, |
| 2192 | respectively. | 2208 | respectively. |
| 2193 | 2209 | ||
| 2194 | @item :local @var{local-address} | 2210 | @item :local @var{local-address} |
| 2195 | For a server process, @var{local-address} is the address to listen on. | 2211 | For a server process, @var{local-address} is the address to listen on. |
| 2196 | It overrides @var{family}, @var{host} and @var{service}, and you | 2212 | It overrides @var{family}, @var{host} and @var{service}, so you |
| 2197 | may as well not specify them. | 2213 | might as well not specify them. |
| 2198 | 2214 | ||
| 2199 | @item :remote @var{remote-address} | 2215 | @item :remote @var{remote-address} |
| 2200 | For a connection, @var{remote-address} is the address to connect to. | 2216 | For a connection, @var{remote-address} is the address to connect to. |
| 2201 | It overrides @var{family}, @var{host} and @var{service}, and you | 2217 | It overrides @var{family}, @var{host} and @var{service}, so you |
| 2202 | may as well not specify them. | 2218 | might as well not specify them. |
| 2203 | 2219 | ||
| 2204 | For a datagram server, @var{remote-address} specifies the initial | 2220 | For a datagram server, @var{remote-address} specifies the initial |
| 2205 | setting of the remote datagram address. | 2221 | setting of the remote datagram address. |
| @@ -2223,7 +2239,7 @@ integers @code{[@var{a} @var{b} @var{c} @var{d} @var{e} @var{f} | |||
| 2223 | port number @var{p}. | 2239 | port number @var{p}. |
| 2224 | 2240 | ||
| 2225 | @item | 2241 | @item |
| 2226 | A local address is represented as a string which specifies the address | 2242 | A local address is represented as a string, which specifies the address |
| 2227 | in the local address space. | 2243 | in the local address space. |
| 2228 | 2244 | ||
| 2229 | @item | 2245 | @item |
| @@ -2245,8 +2261,8 @@ second argument matching @code{"open"} (if successful) or | |||
| 2245 | has succeeded or failed. | 2261 | has succeeded or failed. |
| 2246 | 2262 | ||
| 2247 | @item :stop @var{stopped} | 2263 | @item :stop @var{stopped} |
| 2248 | Start the network connection or server in the `stopped' state if | 2264 | If @var{stopped} is non-@code{nil}, start the network connection or |
| 2249 | @var{stopped} is non-@code{nil}. | 2265 | server in the ``stopped'' state. |
| 2250 | 2266 | ||
| 2251 | @item :buffer @var{buffer} | 2267 | @item :buffer @var{buffer} |
| 2252 | Use @var{buffer} as the process buffer. | 2268 | Use @var{buffer} as the process buffer. |
| @@ -2267,6 +2283,11 @@ Initialize the process query flag to @var{query-flag}. | |||
| 2267 | @item :filter @var{filter} | 2283 | @item :filter @var{filter} |
| 2268 | Initialize the process filter to @var{filter}. | 2284 | Initialize the process filter to @var{filter}. |
| 2269 | 2285 | ||
| 2286 | @item :filter-multibyte @var{multibyte} | ||
| 2287 | If @var{multibyte} is non-@code{nil}, strings given to the process | ||
| 2288 | filter are multibyte, otherwise they are unibyte. The default is the | ||
| 2289 | default value of @code{enable-multibyte-characters}. | ||
| 2290 | |||
| 2270 | @item :sentinel @var{sentinel} | 2291 | @item :sentinel @var{sentinel} |
| 2271 | Initialize the process sentinel to @var{sentinel}. | 2292 | Initialize the process sentinel to @var{sentinel}. |
| 2272 | 2293 | ||
| @@ -2274,7 +2295,7 @@ Initialize the process sentinel to @var{sentinel}. | |||
| 2274 | Initialize the log function of a server process to @var{log}. The log | 2295 | Initialize the log function of a server process to @var{log}. The log |
| 2275 | function is called each time the server accepts a network connection | 2296 | function is called each time the server accepts a network connection |
| 2276 | from a client. The arguments passed to the log function are | 2297 | from a client. The arguments passed to the log function are |
| 2277 | @var{server}, @var{connection}, and @var{message}, where @var{server} | 2298 | @var{server}, @var{connection}, and @var{message}; where @var{server} |
| 2278 | is the server process, @var{connection} is the new process for the | 2299 | is the server process, @var{connection} is the new process for the |
| 2279 | connection, and @var{message} is a string describing what has | 2300 | connection, and @var{message} is a string describing what has |
| 2280 | happened. | 2301 | happened. |
| @@ -2311,7 +2332,7 @@ Using this option may require special privileges on some systems. | |||
| 2311 | @item :broadcast @var{broadcast-flag} | 2332 | @item :broadcast @var{broadcast-flag} |
| 2312 | If @var{broadcast-flag} is non-@code{nil} for a datagram process, the | 2333 | If @var{broadcast-flag} is non-@code{nil} for a datagram process, the |
| 2313 | process will receive datagram packet sent to a broadcast address, and | 2334 | process will receive datagram packet sent to a broadcast address, and |
| 2314 | be able to send packets to a broadcast address. Ignored for a stream | 2335 | be able to send packets to a broadcast address. This is ignored for a stream |
| 2315 | connection. | 2336 | connection. |
| 2316 | 2337 | ||
| 2317 | @item :dontroute @var{dontroute-flag} | 2338 | @item :dontroute @var{dontroute-flag} |
| @@ -2327,10 +2348,11 @@ If @var{linger-arg} is non-@code{nil}, wait for successful | |||
| 2327 | transmission of all queued packets on the connection before it is | 2348 | transmission of all queued packets on the connection before it is |
| 2328 | deleted (see @code{delete-process}). If @var{linger-arg} is an | 2349 | deleted (see @code{delete-process}). If @var{linger-arg} is an |
| 2329 | integer, it specifies the maximum time in seconds to wait for queued | 2350 | integer, it specifies the maximum time in seconds to wait for queued |
| 2330 | packets to be sent before closing the connection. Default is | 2351 | packets to be sent before closing the connection. The default is |
| 2331 | @code{nil} which means to discard unsent queued packets when the | 2352 | @code{nil}, which means to discard unsent queued packets when the |
| 2332 | process is deleted. | 2353 | process is deleted. |
| 2333 | 2354 | ||
| 2355 | @c FIXME Where out-of-band data is ...? | ||
| 2334 | @item :oobinline @var{oobinline-flag} | 2356 | @item :oobinline @var{oobinline-flag} |
| 2335 | If @var{oobinline-flag} is non-@code{nil} for a stream connection, | 2357 | If @var{oobinline-flag} is non-@code{nil} for a stream connection, |
| 2336 | receive out-of-band data in the normal data stream. Otherwise, ignore | 2358 | receive out-of-band data in the normal data stream. Otherwise, ignore |
| @@ -2339,7 +2361,7 @@ out-of-band data. | |||
| 2339 | @item :priority @var{priority} | 2361 | @item :priority @var{priority} |
| 2340 | Set the priority for packets sent on this connection to the integer | 2362 | Set the priority for packets sent on this connection to the integer |
| 2341 | @var{priority}. The interpretation of this number is protocol | 2363 | @var{priority}. The interpretation of this number is protocol |
| 2342 | specific, such as setting the TOS (type of service) field on IP | 2364 | specific; such as setting the TOS (type of service) field on IP |
| 2343 | packets sent on this connection. It may also have system dependent | 2365 | packets sent on this connection. It may also have system dependent |
| 2344 | effects, such as selecting a specific output queue on the network | 2366 | effects, such as selecting a specific output queue on the network |
| 2345 | interface. | 2367 | interface. |
| @@ -2347,20 +2369,20 @@ interface. | |||
| 2347 | @item :reuseaddr @var{reuseaddr-flag} | 2369 | @item :reuseaddr @var{reuseaddr-flag} |
| 2348 | If @var{reuseaddr-flag} is non-@code{nil} (the default) for a stream | 2370 | If @var{reuseaddr-flag} is non-@code{nil} (the default) for a stream |
| 2349 | server process, allow this server to reuse a specific port number (see | 2371 | server process, allow this server to reuse a specific port number (see |
| 2350 | @code{:service}) unless another process on this host is already | 2372 | @code{:service}), unless another process on this host is already |
| 2351 | listening on that port. If @var{reuseaddr-flag} is @code{nil}, there | 2373 | listening on that port. If @var{reuseaddr-flag} is @code{nil}, there |
| 2352 | may be a period of time after the last use of that port (by any | 2374 | may be a period of time after the last use of that port (by any |
| 2353 | process on the host), where it is not possible to make a new server on | 2375 | process on the host) where it is not possible to make a new server on |
| 2354 | that port. | 2376 | that port. |
| 2355 | @end table | 2377 | @end table |
| 2356 | 2378 | ||
| 2357 | @defun set-network-process-option process option value &optional no-error | 2379 | @defun set-network-process-option process option value &optional no-error |
| 2358 | This function sets or modifies a network option for network process | 2380 | This function sets or modifies a network option for network process |
| 2359 | @var{process}. See @code{make-network-process} for details of options | 2381 | @var{process}. The accepted options and values are as for |
| 2360 | @var{option} and their corresponding values @var{value}. If | 2382 | @code{make-network-process}. If @var{no-error} is non-@code{nil}, |
| 2361 | @var{no-error} is non-@code{nil}, this function returns @code{nil} | 2383 | this function returns @code{nil} instead of signaling an error if |
| 2362 | instead of signaling an error if @var{option} is not a supported | 2384 | @var{option} is not a supported option. If the function successfully |
| 2363 | option. If the function successfully completes, it returns @code{t}. | 2385 | completes, it returns @code{t}. |
| 2364 | 2386 | ||
| 2365 | The current setting of an option is available via the | 2387 | The current setting of an option is available via the |
| 2366 | @code{process-contact} function. | 2388 | @code{process-contact} function. |
| @@ -2377,11 +2399,9 @@ The current setting of an option is available via the | |||
| 2377 | @end example | 2399 | @end example |
| 2378 | 2400 | ||
| 2379 | @noindent | 2401 | @noindent |
| 2380 | The result of the first form is @code{t} if it works to specify | 2402 | The result of this form is @code{t} if it works to specify |
| 2381 | @var{keyword} with value @var{value} in @code{make-network-process}. | 2403 | @var{keyword} with value @var{value} in @code{make-network-process}. |
| 2382 | The result of the second form is @code{t} if @var{keyword} is | 2404 | Here are some of the @var{keyword}---@var{value} pairs you can test in |
| 2383 | supported by @code{make-network-process}. Here are some of the | ||
| 2384 | @var{keyword}---@var{value} pairs you can test in | ||
| 2385 | this way. | 2405 | this way. |
| 2386 | 2406 | ||
| 2387 | @table @code | 2407 | @table @code |
| @@ -2405,20 +2425,10 @@ Non-@code{nil} if the system can select the port for a server. | |||
| 2405 | @end example | 2425 | @end example |
| 2406 | 2426 | ||
| 2407 | @noindent | 2427 | @noindent |
| 2408 | Here are some of the options you can test in this way. | 2428 | The accepted @var{keyword} values are @code{:bindtodevice}, etc. |
| 2409 | 2429 | For the complete list, @pxref{Network Options}. This form returns | |
| 2410 | @table @code | 2430 | non-@code{nil} if that particular network option is supported by |
| 2411 | @item :bindtodevice | 2431 | @code{make-network-process} (or @code{set-network-process-option}). |
| 2412 | @itemx :broadcast | ||
| 2413 | @itemx :dontroute | ||
| 2414 | @itemx :keepalive | ||
| 2415 | @itemx :linger | ||
| 2416 | @itemx :oobinline | ||
| 2417 | @itemx :priority | ||
| 2418 | @itemx :reuseaddr | ||
| 2419 | That particular network option is supported by | ||
| 2420 | @code{make-network-process} and @code{set-network-process-option}. | ||
| 2421 | @end table | ||
| 2422 | 2432 | ||
| 2423 | @node Misc Network | 2433 | @node Misc Network |
| 2424 | @section Misc Network Facilities | 2434 | @section Misc Network Facilities |
| @@ -2490,11 +2500,11 @@ lets you change the speed, bytesize, and other parameters. In a | |||
| 2490 | terminal window created by @code{serial-term}, you can click on the | 2500 | terminal window created by @code{serial-term}, you can click on the |
| 2491 | mode line for configuration. | 2501 | mode line for configuration. |
| 2492 | 2502 | ||
| 2493 | A serial connection is represented by a process object which can be | 2503 | A serial connection is represented by a process object, which can be |
| 2494 | used similar to a subprocess or network process. You can send and | 2504 | used in a similar way to a subprocess or network process. You can send and |
| 2495 | receive data and configure the serial port. A serial process object | 2505 | receive data, and configure the serial port. A serial process object |
| 2496 | has no process ID, you can't send signals to it, and the status codes | 2506 | has no process ID, however, and you can't send signals to it, and the |
| 2497 | are different from other types of processes. | 2507 | status codes are different from other types of processes. |
| 2498 | @code{delete-process} on the process object or @code{kill-buffer} on | 2508 | @code{delete-process} on the process object or @code{kill-buffer} on |
| 2499 | the process buffer close the connection, but this does not affect the | 2509 | the process buffer close the connection, but this does not affect the |
| 2500 | device connected to the serial port. | 2510 | device connected to the serial port. |
| @@ -2502,15 +2512,17 @@ device connected to the serial port. | |||
| 2502 | The function @code{process-type} returns the symbol @code{serial} | 2512 | The function @code{process-type} returns the symbol @code{serial} |
| 2503 | for a process object representing a serial port connection. | 2513 | for a process object representing a serial port connection. |
| 2504 | 2514 | ||
| 2505 | Serial ports are available on GNU/Linux, Unix, and Windows systems. | 2515 | Serial ports are available on GNU/Linux, Unix, and MS Windows systems. |
| 2506 | 2516 | ||
| 2507 | @deffn Command serial-term port speed | 2517 | @deffn Command serial-term port speed |
| 2508 | Start a terminal-emulator for a serial port in a new buffer. | 2518 | Start a terminal-emulator for a serial port in a new buffer. |
| 2509 | @var{port} is the name of the serial port to which to connect. For | 2519 | @var{port} is the name of the serial port to connect to. For |
| 2510 | example, this could be @file{/dev/ttyS0} on Unix. On Windows, this | 2520 | example, this could be @file{/dev/ttyS0} on Unix. On MS Windows, this |
| 2511 | could be @file{COM1}, or @file{\\.\COM10} (double the backslashes in | 2521 | could be @file{COM1}, or @file{\\.\COM10} (double the backslashes in |
| 2512 | Lisp strings). | 2522 | Lisp strings). |
| 2513 | 2523 | ||
| 2524 | @c FIXME is 9600 still the most common value, or is it 115200 now? | ||
| 2525 | @c (Same value, 9600, appears below as well.) | ||
| 2514 | @var{speed} is the speed of the serial port in bits per second. 9600 | 2526 | @var{speed} is the speed of the serial port in bits per second. 9600 |
| 2515 | is a common value. The buffer is in Term mode; see @ref{Term Mode,,, | 2527 | is a common value. The buffer is in Term mode; see @ref{Term Mode,,, |
| 2516 | emacs, The GNU Emacs Manual}, for the commands to use in that buffer. | 2528 | emacs, The GNU Emacs Manual}, for the commands to use in that buffer. |
| @@ -2519,25 +2531,27 @@ You can change the speed and the configuration in the mode line menu. | |||
| 2519 | 2531 | ||
| 2520 | @defun make-serial-process &rest args | 2532 | @defun make-serial-process &rest args |
| 2521 | This function creates a process and a buffer. Arguments are specified | 2533 | This function creates a process and a buffer. Arguments are specified |
| 2522 | as keyword/argument pairs. Here's the list of the meaningful keywords: | 2534 | as keyword/argument pairs. Here's the list of the meaningful |
| 2535 | keywords, with the first two (@var{port} and @var{speed}) being mandatory: | ||
| 2523 | 2536 | ||
| 2524 | @table @code | 2537 | @table @code |
| 2525 | @item :port @var{port}@r{ (mandatory)} | 2538 | @item :port @var{port} |
| 2526 | This is the name of the serial port. On Unix and GNU systems, this is | 2539 | This is the name of the serial port. On Unix and GNU systems, this is |
| 2527 | a file name such as @file{/dev/ttyS0}. On Windows, this could be | 2540 | a file name such as @file{/dev/ttyS0}. On Windows, this could be |
| 2528 | @file{COM1}, or @file{\\.\COM10} for ports higher than @file{COM9} | 2541 | @file{COM1}, or @file{\\.\COM10} for ports higher than @file{COM9} |
| 2529 | (double the backslashes in Lisp strings). | 2542 | (double the backslashes in Lisp strings). |
| 2530 | 2543 | ||
| 2531 | @item :speed @var{speed}@r{ (mandatory)} | 2544 | @item :speed @var{speed} |
| 2532 | The speed of the serial port in bits per second. This function calls | 2545 | The speed of the serial port in bits per second. This function calls |
| 2533 | @code{serial-process-configure} to handle the speed. | 2546 | @code{serial-process-configure} to handle the speed; see the |
| 2547 | following documentation of that function for more details. | ||
| 2534 | 2548 | ||
| 2535 | @item :name @var{name} | 2549 | @item :name @var{name} |
| 2536 | The name of the process. If @var{name} is not given, @var{port} will | 2550 | The name of the process. If @var{name} is not given, @var{port} will |
| 2537 | serve as the process name as well. | 2551 | serve as the process name as well. |
| 2538 | 2552 | ||
| 2539 | @item :buffer @var{buffer} | 2553 | @item :buffer @var{buffer} |
| 2540 | The buffer to associate with the process. The value could be either a | 2554 | The buffer to associate with the process. The value can be either a |
| 2541 | buffer or a string that names a buffer. Process output goes at the | 2555 | buffer or a string that names a buffer. Process output goes at the |
| 2542 | end of that buffer, unless you specify an output stream or filter | 2556 | end of that buffer, unless you specify an output stream or filter |
| 2543 | function to handle the output. If @var{buffer} is not given, the | 2557 | function to handle the output. If @var{buffer} is not given, the |
| @@ -2547,16 +2561,16 @@ keyword. | |||
| 2547 | @item :coding @var{coding} | 2561 | @item :coding @var{coding} |
| 2548 | If @var{coding} is a symbol, it specifies the coding system used for | 2562 | If @var{coding} is a symbol, it specifies the coding system used for |
| 2549 | both reading and writing for this process. If @var{coding} is a cons | 2563 | both reading and writing for this process. If @var{coding} is a cons |
| 2550 | @code{(decoding . encoding)}, @var{decoding} is used for reading, and | 2564 | @code{(@var{decoding} . @var{encoding})}, @var{decoding} is used for |
| 2551 | @var{encoding} is used for writing. If not specified, the default is | 2565 | reading, and @var{encoding} is used for writing. If not specified, |
| 2552 | to determine the coding systems from data itself. | 2566 | the default is to determine the coding systems from the data itself. |
| 2553 | 2567 | ||
| 2554 | @item :noquery @var{query-flag} | 2568 | @item :noquery @var{query-flag} |
| 2555 | Initialize the process query flag to @var{query-flag}. @xref{Query | 2569 | Initialize the process query flag to @var{query-flag}. @xref{Query |
| 2556 | Before Exit}. The flags defaults to @code{nil} if unspecified. | 2570 | Before Exit}. The flags defaults to @code{nil} if unspecified. |
| 2557 | 2571 | ||
| 2558 | @item :stop @var{bool} | 2572 | @item :stop @var{bool} |
| 2559 | Start process in the @code{stopped} state if @var{bool} is | 2573 | Start process in the ``stopped'' state if @var{bool} is |
| 2560 | non-@code{nil}. In the stopped state, a serial process does not | 2574 | non-@code{nil}. In the stopped state, a serial process does not |
| 2561 | accept incoming data, but you can send outgoing data. The stopped | 2575 | accept incoming data, but you can send outgoing data. The stopped |
| 2562 | state is cleared by @code{continue-process} and set by | 2576 | state is cleared by @code{continue-process} and set by |
| @@ -2571,8 +2585,7 @@ Install @var{sentinel} as the process sentinel. | |||
| 2571 | @item :plist @var{plist} | 2585 | @item :plist @var{plist} |
| 2572 | Install @var{plist} as the initial plist of the process. | 2586 | Install @var{plist} as the initial plist of the process. |
| 2573 | 2587 | ||
| 2574 | @item :speed | 2588 | @item :bytesize |
| 2575 | @itemx :bytesize | ||
| 2576 | @itemx :parity | 2589 | @itemx :parity |
| 2577 | @itemx :stopbits | 2590 | @itemx :stopbits |
| 2578 | @itemx :flowcontrol | 2591 | @itemx :flowcontrol |
| @@ -2600,7 +2613,7 @@ Here is an example: | |||
| 2600 | This functions configures a serial port connection. Arguments are | 2613 | This functions configures a serial port connection. Arguments are |
| 2601 | specified as keyword/argument pairs. Attributes that are not given | 2614 | specified as keyword/argument pairs. Attributes that are not given |
| 2602 | are re-initialized from the process's current configuration (available | 2615 | are re-initialized from the process's current configuration (available |
| 2603 | via the function @code{process-contact}) or set to reasonable default | 2616 | via the function @code{process-contact}), or set to reasonable default |
| 2604 | values. The following arguments are defined: | 2617 | values. The following arguments are defined: |
| 2605 | 2618 | ||
| 2606 | @table @code | 2619 | @table @code |
| @@ -2618,8 +2631,8 @@ rate}. The value can be any number, but most serial ports work only | |||
| 2618 | at a few defined values between 1200 and 115200, with 9600 being the | 2631 | at a few defined values between 1200 and 115200, with 9600 being the |
| 2619 | most common value. If @var{speed} is @code{nil}, the function ignores | 2632 | most common value. If @var{speed} is @code{nil}, the function ignores |
| 2620 | all other arguments and does not configure the port. This may be | 2633 | all other arguments and does not configure the port. This may be |
| 2621 | useful for special serial ports such as Bluetooth-to-serial converters | 2634 | useful for special serial ports such as Bluetooth-to-serial converters, |
| 2622 | which can only be configured through AT commands sent through the | 2635 | which can only be configured through @samp{AT} commands sent through the |
| 2623 | connection. The value of @code{nil} for @var{speed} is valid only for | 2636 | connection. The value of @code{nil} for @var{speed} is valid only for |
| 2624 | connections that were already opened by a previous call to | 2637 | connections that were already opened by a previous call to |
| 2625 | @code{make-serial-process} or @code{serial-term}. | 2638 | @code{make-serial-process} or @code{serial-term}. |
| @@ -2646,9 +2659,9 @@ flow control). If @var{flowcontrol} is not given, it defaults to no | |||
| 2646 | flow control. | 2659 | flow control. |
| 2647 | @end table | 2660 | @end table |
| 2648 | 2661 | ||
| 2649 | @code{serial-process-configure} is called by | 2662 | Internally, @code{make-serial-process} calls |
| 2650 | @code{make-serial-process} for the initial configuration of the serial | 2663 | @code{serial-process-configure} for the initial configuration of the |
| 2651 | port. | 2664 | serial port. |
| 2652 | @end defun | 2665 | @end defun |
| 2653 | 2666 | ||
| 2654 | @node Byte Packing | 2667 | @node Byte Packing |
| @@ -2658,8 +2671,12 @@ port. | |||
| 2658 | This section describes how to pack and unpack arrays of bytes, | 2671 | This section describes how to pack and unpack arrays of bytes, |
| 2659 | usually for binary network protocols. These functions convert byte arrays | 2672 | usually for binary network protocols. These functions convert byte arrays |
| 2660 | to alists, and vice versa. The byte array can be represented as a | 2673 | to alists, and vice versa. The byte array can be represented as a |
| 2674 | @c FIXME? No multibyte? | ||
| 2661 | unibyte string or as a vector of integers, while the alist associates | 2675 | unibyte string or as a vector of integers, while the alist associates |
| 2662 | symbols either with fixed-size objects or with recursive sub-alists. | 2676 | symbols either with fixed-size objects or with recursive sub-alists. |
| 2677 | To use the functions referred to in this section, load the | ||
| 2678 | @code{bindat} library. | ||
| 2679 | @c It doesn't have any autoloads. | ||
| 2663 | 2680 | ||
| 2664 | @cindex serializing | 2681 | @cindex serializing |
| 2665 | @cindex deserializing | 2682 | @cindex deserializing |
| @@ -2680,7 +2697,7 @@ direction is also known as @dfn{serializing} or @dfn{packing}. | |||
| 2680 | 2697 | ||
| 2681 | To control unpacking and packing, you write a @dfn{data layout | 2698 | To control unpacking and packing, you write a @dfn{data layout |
| 2682 | specification}, a special nested list describing named and typed | 2699 | specification}, a special nested list describing named and typed |
| 2683 | @dfn{fields}. This specification controls length of each field to be | 2700 | @dfn{fields}. This specification controls the length of each field to be |
| 2684 | processed, and how to pack or unpack it. We normally keep bindat specs | 2701 | processed, and how to pack or unpack it. We normally keep bindat specs |
| 2685 | in variables whose names end in @samp{-bindat-spec}; that kind of name | 2702 | in variables whose names end in @samp{-bindat-spec}; that kind of name |
| 2686 | is automatically recognized as ``risky''. | 2703 | is automatically recognized as ``risky''. |
| @@ -2729,12 +2746,12 @@ String of length @var{len}. | |||
| 2729 | Zero-terminated string, in a fixed-size field with length @var{len}. | 2746 | Zero-terminated string, in a fixed-size field with length @var{len}. |
| 2730 | 2747 | ||
| 2731 | @item vec @var{len} [@var{type}] | 2748 | @item vec @var{len} [@var{type}] |
| 2732 | Vector of @var{len} elements of type @var{type}, or bytes if not | 2749 | Vector of @var{len} elements of type @var{type}, defaulting to bytes. |
| 2733 | @var{type} is specified. | ||
| 2734 | The @var{type} is any of the simple types above, or another vector | 2750 | The @var{type} is any of the simple types above, or another vector |
| 2735 | specified as a list @code{(vec @var{len} [@var{type}])}. | 2751 | specified as a list of the form @code{(vec @var{len} [@var{type}])}. |
| 2736 | 2752 | ||
| 2737 | @item ip | 2753 | @item ip |
| 2754 | @c FIXME? IPv6? | ||
| 2738 | Four-byte vector representing an Internet address. For example: | 2755 | Four-byte vector representing an Internet address. For example: |
| 2739 | @code{[127 0 0 1]} for localhost. | 2756 | @code{[127 0 0 1]} for localhost. |
| 2740 | 2757 | ||
| @@ -2762,12 +2779,11 @@ below, or by an expression @code{(eval @var{form})} where @var{form} | |||
| 2762 | should evaluate to an integer, specifying the field length. | 2779 | should evaluate to an integer, specifying the field length. |
| 2763 | 2780 | ||
| 2764 | A field specification generally has the form @code{([@var{name}] | 2781 | A field specification generally has the form @code{([@var{name}] |
| 2765 | @var{handler})}. The square braces indicate that @var{name} is | 2782 | @var{handler})}, where @var{name} is optional. Don't use names that |
| 2766 | optional. (Don't use names that are symbols meaningful as type | 2783 | are symbols meaningful as type specifications (above) or handler |
| 2767 | specifications (above) or handler specifications (below), since that | 2784 | specifications (below), since that would be ambiguous. @var{name} can |
| 2768 | would be ambiguous.) @var{name} can be a symbol or the expression | 2785 | be a symbol or an expression @code{(eval @var{form})}, in which case |
| 2769 | @code{(eval @var{form})}, in which case @var{form} should evaluate to | 2786 | @var{form} should evaluate to a symbol. |
| 2770 | a symbol. | ||
| 2771 | 2787 | ||
| 2772 | @var{handler} describes how to unpack or pack the field and can be one | 2788 | @var{handler} describes how to unpack or pack the field and can be one |
| 2773 | of the following: | 2789 | of the following: |
| @@ -2814,10 +2830,11 @@ of @var{form}. A non-@code{nil} result indicates a match. | |||
| 2814 | 2830 | ||
| 2815 | @item repeat @var{count} @var{field-specs}@dots{} | 2831 | @item repeat @var{count} @var{field-specs}@dots{} |
| 2816 | Process the @var{field-specs} recursively, in order, then repeat | 2832 | Process the @var{field-specs} recursively, in order, then repeat |
| 2817 | starting from the first one, processing all the specs @var{count} | 2833 | starting from the first one, processing all the specifications @var{count} |
| 2818 | times overall. The @var{count} is given using the same formats as a | 2834 | times overall. The @var{count} is given using the same formats as a |
| 2819 | field length---if an @code{eval} form is used, it is evaluated just once. | 2835 | field length---if an @code{eval} form is used, it is evaluated just once. |
| 2820 | For correct operation, each spec in @var{field-specs} must include a name. | 2836 | For correct operation, each specification in @var{field-specs} must |
| 2837 | include a name. | ||
| 2821 | @end table | 2838 | @end table |
| 2822 | 2839 | ||
| 2823 | For the @code{(eval @var{form})} forms used in a bindat specification, | 2840 | For the @code{(eval @var{form})} forms used in a bindat specification, |
| @@ -2856,9 +2873,10 @@ specification, @code{bindat-raw} to a byte array, and @var{struct} to an | |||
| 2856 | alist representing unpacked field data. | 2873 | alist representing unpacked field data. |
| 2857 | 2874 | ||
| 2858 | @defun bindat-unpack spec bindat-raw &optional bindat-idx | 2875 | @defun bindat-unpack spec bindat-raw &optional bindat-idx |
| 2876 | @c FIXME? Again, no multibyte? | ||
| 2859 | This function unpacks data from the unibyte string or byte | 2877 | This function unpacks data from the unibyte string or byte |
| 2860 | array @code{bindat-raw} | 2878 | array @code{bindat-raw} |
| 2861 | according to @var{spec}. Normally this starts unpacking at the | 2879 | according to @var{spec}. Normally, this starts unpacking at the |
| 2862 | beginning of the byte array, but if @var{bindat-idx} is non-@code{nil}, it | 2880 | beginning of the byte array, but if @var{bindat-idx} is non-@code{nil}, it |
| 2863 | specifies a zero-based starting position to use instead. | 2881 | specifies a zero-based starting position to use instead. |
| 2864 | 2882 | ||
| @@ -2894,7 +2912,7 @@ according to @var{spec}. | |||
| 2894 | 2912 | ||
| 2895 | @defun bindat-pack spec struct &optional bindat-raw bindat-idx | 2913 | @defun bindat-pack spec struct &optional bindat-raw bindat-idx |
| 2896 | This function returns a byte array packed according to @var{spec} from | 2914 | This function returns a byte array packed according to @var{spec} from |
| 2897 | the data in the alist @var{struct}. Normally it creates and fills a | 2915 | the data in the alist @var{struct}. It normally creates and fills a |
| 2898 | new byte array starting at the beginning. However, if @var{bindat-raw} | 2916 | new byte array starting at the beginning. However, if @var{bindat-raw} |
| 2899 | is non-@code{nil}, it specifies a pre-allocated unibyte string or vector to | 2917 | is non-@code{nil}, it specifies a pre-allocated unibyte string or vector to |
| 2900 | pack into. If @var{bindat-idx} is non-@code{nil}, it specifies the starting | 2918 | pack into. If @var{bindat-idx} is non-@code{nil}, it specifies the starting |
| @@ -2907,6 +2925,7 @@ meets or exceeds the total length to avoid an out-of-range error. | |||
| 2907 | @defun bindat-ip-to-string ip | 2925 | @defun bindat-ip-to-string ip |
| 2908 | Convert the Internet address vector @var{ip} to a string in the usual | 2926 | Convert the Internet address vector @var{ip} to a string in the usual |
| 2909 | dotted notation. | 2927 | dotted notation. |
| 2928 | @c FIXME? Does it do IPv6? | ||
| 2910 | 2929 | ||
| 2911 | @example | 2930 | @example |
| 2912 | (bindat-ip-to-string [127 0 0 1]) | 2931 | (bindat-ip-to-string [127 0 0 1]) |
| @@ -2916,10 +2935,16 @@ dotted notation. | |||
| 2916 | 2935 | ||
| 2917 | @node Bindat Examples | 2936 | @node Bindat Examples |
| 2918 | @subsection Examples of Byte Unpacking and Packing | 2937 | @subsection Examples of Byte Unpacking and Packing |
| 2938 | @c FIXME? This seems a very long example for something that is not used | ||
| 2939 | @c very often. As of 24.1, gdb-mi.el is the only user of bindat.el in Emacs. | ||
| 2940 | @c Maybe one or both of these examples should just be moved to the | ||
| 2941 | @c commentary of bindat.el. | ||
| 2919 | 2942 | ||
| 2920 | Here is a complete example of byte unpacking and packing: | 2943 | Here is a complete example of byte unpacking and packing: |
| 2921 | 2944 | ||
| 2922 | @lisp | 2945 | @lisp |
| 2946 | (require 'bindat) | ||
| 2947 | |||
| 2923 | (defvar fcookie-index-spec | 2948 | (defvar fcookie-index-spec |
| 2924 | '((:version u32) | 2949 | '((:version u32) |
| 2925 | (:count u32) | 2950 | (:count u32) |
| @@ -2928,16 +2953,14 @@ dotted notation. | |||
| 2928 | (:flags u32) | 2953 | (:flags u32) |
| 2929 | (:delim u8) | 2954 | (:delim u8) |
| 2930 | (:ignored fill 3) | 2955 | (:ignored fill 3) |
| 2931 | (:offset repeat (:count) | 2956 | (:offset repeat (:count) (:foo u32))) |
| 2932 | (:foo u32))) | ||
| 2933 | "Description of a fortune cookie index file's contents.") | 2957 | "Description of a fortune cookie index file's contents.") |
| 2934 | 2958 | ||
| 2935 | (defun fcookie (cookies &optional index) | 2959 | (defun fcookie (cookies &optional index) |
| 2936 | "Display a random fortune cookie from file COOKIES. | 2960 | "Display a random fortune cookie from file COOKIES. |
| 2937 | Optional second arg INDEX specifies the associated index | 2961 | Optional second arg INDEX specifies the associated index |
| 2938 | filename, which is by default constructed by appending | 2962 | filename, by default \"COOKIES.dat\". Display cookie text |
| 2939 | \".dat\" to COOKIES. Display cookie text in possibly | 2963 | in buffer \"*Fortune Cookie: BASENAME*\", where BASENAME |
| 2940 | new buffer \"*Fortune Cookie: BASENAME*\" where BASENAME | ||
| 2941 | is COOKIES without the directory part." | 2964 | is COOKIES without the directory part." |
| 2942 | (interactive "fCookies file: ") | 2965 | (interactive "fCookies file: ") |
| 2943 | (let* ((info (with-temp-buffer | 2966 | (let* ((info (with-temp-buffer |
| @@ -2960,10 +2983,9 @@ is COOKIES without the directory part." | |||
| 2960 | 2983 | ||
| 2961 | (defun fcookie-create-index (cookies &optional index delim) | 2984 | (defun fcookie-create-index (cookies &optional index delim) |
| 2962 | "Scan file COOKIES, and write out its index file. | 2985 | "Scan file COOKIES, and write out its index file. |
| 2963 | Optional second arg INDEX specifies the index filename, | 2986 | Optional arg INDEX specifies the index filename, which by |
| 2964 | which is by default constructed by appending \".dat\" to | 2987 | default is \"COOKIES.dat\". Optional arg DELIM specifies the |
| 2965 | COOKIES. Optional third arg DELIM specifies the unibyte | 2988 | unibyte character that, when found on a line of its own in |
| 2966 | character which, when found on a line of its own in | ||
| 2967 | COOKIES, indicates the border between entries." | 2989 | COOKIES, indicates the border between entries." |
| 2968 | (interactive "fCookies file: ") | 2990 | (interactive "fCookies file: ") |
| 2969 | (setq delim (or delim ?%)) | 2991 | (setq delim (or delim ?%)) |
| @@ -3000,8 +3022,8 @@ COOKIES, indicates the border between entries." | |||
| 3000 | (write-file (or index (concat cookies ".dat"))))))) | 3022 | (write-file (or index (concat cookies ".dat"))))))) |
| 3001 | @end lisp | 3023 | @end lisp |
| 3002 | 3024 | ||
| 3003 | Following is an example of defining and unpacking a complex structure. | 3025 | The following is an example of defining and unpacking a complex |
| 3004 | Consider the following C structures: | 3026 | structure. Consider the following C structures: |
| 3005 | 3027 | ||
| 3006 | @example | 3028 | @example |
| 3007 | struct header @{ | 3029 | struct header @{ |
| @@ -3014,14 +3036,14 @@ struct header @{ | |||
| 3014 | struct data @{ | 3036 | struct data @{ |
| 3015 | unsigned char type; | 3037 | unsigned char type; |
| 3016 | unsigned char opcode; | 3038 | unsigned char opcode; |
| 3017 | unsigned short length; /* In network byte order */ | 3039 | unsigned short length; /* in network byte order */ |
| 3018 | unsigned char id[8]; /* null-terminated string */ | 3040 | unsigned char id[8]; /* null-terminated string */ |
| 3019 | unsigned char data[/* (length + 3) & ~3 */]; | 3041 | unsigned char data[/* (length + 3) & ~3 */]; |
| 3020 | @}; | 3042 | @}; |
| 3021 | 3043 | ||
| 3022 | struct packet @{ | 3044 | struct packet @{ |
| 3023 | struct header header; | 3045 | struct header header; |
| 3024 | unsigned long counters[2]; /* In little endian order */ | 3046 | unsigned long counters[2]; /* in little endian order */ |
| 3025 | unsigned char items; | 3047 | unsigned char items; |
| 3026 | unsigned char filler[3]; | 3048 | unsigned char filler[3]; |
| 3027 | struct data item[/* items */]; | 3049 | struct data item[/* items */]; |
| @@ -3029,7 +3051,7 @@ struct packet @{ | |||
| 3029 | @}; | 3051 | @}; |
| 3030 | @end example | 3052 | @end example |
| 3031 | 3053 | ||
| 3032 | The corresponding data layout specification: | 3054 | The corresponding data layout specification is: |
| 3033 | 3055 | ||
| 3034 | @lisp | 3056 | @lisp |
| 3035 | (setq header-spec | 3057 | (setq header-spec |
| @@ -3041,21 +3063,21 @@ The corresponding data layout specification: | |||
| 3041 | (setq data-spec | 3063 | (setq data-spec |
| 3042 | '((type u8) | 3064 | '((type u8) |
| 3043 | (opcode u8) | 3065 | (opcode u8) |
| 3044 | (length u16) ;; network byte order | 3066 | (length u16) ; network byte order |
| 3045 | (id strz 8) | 3067 | (id strz 8) |
| 3046 | (data vec (length)) | 3068 | (data vec (length)) |
| 3047 | (align 4))) | 3069 | (align 4))) |
| 3048 | 3070 | ||
| 3049 | (setq packet-spec | 3071 | (setq packet-spec |
| 3050 | '((header struct header-spec) | 3072 | '((header struct header-spec) |
| 3051 | (counters vec 2 u32r) ;; little endian order | 3073 | (counters vec 2 u32r) ; little endian order |
| 3052 | (items u8) | 3074 | (items u8) |
| 3053 | (fill 3) | 3075 | (fill 3) |
| 3054 | (item repeat (items) | 3076 | (item repeat (items) |
| 3055 | (struct data-spec)))) | 3077 | (struct data-spec)))) |
| 3056 | @end lisp | 3078 | @end lisp |
| 3057 | 3079 | ||
| 3058 | A binary data representation: | 3080 | A binary data representation is: |
| 3059 | 3081 | ||
| 3060 | @lisp | 3082 | @lisp |
| 3061 | (setq binary-data | 3083 | (setq binary-data |
| @@ -3065,7 +3087,7 @@ A binary data representation: | |||
| 3065 | 1 4 0 7 ?B ?C ?D ?E ?F ?G 0 0 6 7 8 9 10 11 12 0 ]) | 3087 | 1 4 0 7 ?B ?C ?D ?E ?F ?G 0 0 6 7 8 9 10 11 12 0 ]) |
| 3066 | @end lisp | 3088 | @end lisp |
| 3067 | 3089 | ||
| 3068 | The corresponding decoded structure: | 3090 | The corresponding decoded structure is: |
| 3069 | 3091 | ||
| 3070 | @lisp | 3092 | @lisp |
| 3071 | (setq decoded (bindat-unpack packet-spec binary-data)) | 3093 | (setq decoded (bindat-unpack packet-spec binary-data)) |
| @@ -3089,7 +3111,7 @@ The corresponding decoded structure: | |||
| 3089 | (type . 1)))) | 3111 | (type . 1)))) |
| 3090 | @end lisp | 3112 | @end lisp |
| 3091 | 3113 | ||
| 3092 | Fetching data from this structure: | 3114 | An example of fetching data from this structure: |
| 3093 | 3115 | ||
| 3094 | @lisp | 3116 | @lisp |
| 3095 | (bindat-get-field decoded 'item 1 'id) | 3117 | (bindat-get-field decoded 'item 1 'id) |
diff --git a/doc/lispref/vol1.texi b/doc/lispref/vol1.texi index 45a0dee3b1c..25ea8577467 100644 --- a/doc/lispref/vol1.texi +++ b/doc/lispref/vol1.texi | |||
| @@ -658,8 +658,8 @@ Minibuffers | |||
| 658 | * Multiple Queries:: Asking a series of similar questions. | 658 | * Multiple Queries:: Asking a series of similar questions. |
| 659 | * Reading a Password:: Reading a password from the terminal. | 659 | * Reading a Password:: Reading a password from the terminal. |
| 660 | * Minibuffer Commands:: Commands used as key bindings in minibuffers. | 660 | * Minibuffer Commands:: Commands used as key bindings in minibuffers. |
| 661 | * Minibuffer Contents:: How such commands access the minibuffer text. | ||
| 662 | * Minibuffer Windows:: Operating on the special minibuffer windows. | 661 | * Minibuffer Windows:: Operating on the special minibuffer windows. |
| 662 | * Minibuffer Contents:: How such commands access the minibuffer text. | ||
| 663 | * Recursive Mini:: Whether recursive entry to minibuffer is allowed. | 663 | * Recursive Mini:: Whether recursive entry to minibuffer is allowed. |
| 664 | * Minibuffer Misc:: Various customization hooks and variables. | 664 | * Minibuffer Misc:: Various customization hooks and variables. |
| 665 | 665 | ||
| @@ -670,7 +670,7 @@ Completion | |||
| 670 | * Minibuffer Completion:: Invoking the minibuffer with completion. | 670 | * Minibuffer Completion:: Invoking the minibuffer with completion. |
| 671 | * Completion Commands:: Minibuffer commands that do completion. | 671 | * Completion Commands:: Minibuffer commands that do completion. |
| 672 | * High-Level Completion:: Convenient special cases of completion | 672 | * High-Level Completion:: Convenient special cases of completion |
| 673 | (reading buffer name, file name, etc.). | 673 | (reading buffer names, variable names, etc.). |
| 674 | * Reading File Names:: Using completion to read file names and | 674 | * Reading File Names:: Using completion to read file names and |
| 675 | shell commands. | 675 | shell commands. |
| 676 | * Completion Variables:: Variables controlling completion behavior. | 676 | * Completion Variables:: Variables controlling completion behavior. |
diff --git a/doc/lispref/vol2.texi b/doc/lispref/vol2.texi index 01a3e3c129e..2fd2a8d8224 100644 --- a/doc/lispref/vol2.texi +++ b/doc/lispref/vol2.texi | |||
| @@ -657,8 +657,8 @@ Minibuffers | |||
| 657 | * Multiple Queries:: Asking a series of similar questions. | 657 | * Multiple Queries:: Asking a series of similar questions. |
| 658 | * Reading a Password:: Reading a password from the terminal. | 658 | * Reading a Password:: Reading a password from the terminal. |
| 659 | * Minibuffer Commands:: Commands used as key bindings in minibuffers. | 659 | * Minibuffer Commands:: Commands used as key bindings in minibuffers. |
| 660 | * Minibuffer Contents:: How such commands access the minibuffer text. | ||
| 661 | * Minibuffer Windows:: Operating on the special minibuffer windows. | 660 | * Minibuffer Windows:: Operating on the special minibuffer windows. |
| 661 | * Minibuffer Contents:: How such commands access the minibuffer text. | ||
| 662 | * Recursive Mini:: Whether recursive entry to minibuffer is allowed. | 662 | * Recursive Mini:: Whether recursive entry to minibuffer is allowed. |
| 663 | * Minibuffer Misc:: Various customization hooks and variables. | 663 | * Minibuffer Misc:: Various customization hooks and variables. |
| 664 | 664 | ||
| @@ -669,7 +669,7 @@ Completion | |||
| 669 | * Minibuffer Completion:: Invoking the minibuffer with completion. | 669 | * Minibuffer Completion:: Invoking the minibuffer with completion. |
| 670 | * Completion Commands:: Minibuffer commands that do completion. | 670 | * Completion Commands:: Minibuffer commands that do completion. |
| 671 | * High-Level Completion:: Convenient special cases of completion | 671 | * High-Level Completion:: Convenient special cases of completion |
| 672 | (reading buffer name, file name, etc.). | 672 | (reading buffer names, variable names, etc.). |
| 673 | * Reading File Names:: Using completion to read file names and | 673 | * Reading File Names:: Using completion to read file names and |
| 674 | shell commands. | 674 | shell commands. |
| 675 | * Completion Variables:: Variables controlling completion behavior. | 675 | * Completion Variables:: Variables controlling completion behavior. |
diff --git a/doc/misc/ChangeLog b/doc/misc/ChangeLog index 46fea77107b..20c453544bc 100644 --- a/doc/misc/ChangeLog +++ b/doc/misc/ChangeLog | |||
| @@ -1,3 +1,23 @@ | |||
| 1 | 2012-04-20 Glenn Morris <rgm@gnu.org> | ||
| 2 | |||
| 3 | * faq.texi (New in Emacs 24): New section. | ||
| 4 | (Packages that do not come with Emacs): Mention M-x list-packages. | ||
| 5 | |||
| 6 | 2012-04-20 Glenn Morris <rgm@gnu.org> | ||
| 7 | |||
| 8 | * Makefile.in: Replace non-portable use of $< in emacs-gnutls rules. | ||
| 9 | |||
| 10 | 2012-04-20 Eli Zaretskii <eliz@gnu.org> | ||
| 11 | |||
| 12 | * makefile.w32-in (INFO_TARGETS, DVI_TARGETS, clean): Add emacs-gnutls. | ||
| 13 | ($(infodir)/emacs-gnutls, emacs-gnutls.dvi): New targets. | ||
| 14 | |||
| 15 | 2012-04-20 Teodor Zlatanov <tzz@lifelogs.com> | ||
| 16 | |||
| 17 | * emacs-gnutls.texi: Add documentation for the GnuTLS integration. | ||
| 18 | * Makefile.in: Add emacs-gnutls.texi to build. | ||
| 19 | |||
| 20 | 2012-04-20 Alan Mackenzie <acm@muc.de> | ||
| 1 | 2012-04-14 Alan Mackenzie <acm@muc.de> | 21 | 2012-04-14 Alan Mackenzie <acm@muc.de> |
| 2 | 22 | ||
| 3 | * cc-mode.texi (c-offsets-alist): Correct a typo. | 23 | * cc-mode.texi (c-offsets-alist): Correct a typo. |
diff --git a/doc/misc/faq.texi b/doc/misc/faq.texi index 5b7bb7ec9ce..0f20c41c8eb 100644 --- a/doc/misc/faq.texi +++ b/doc/misc/faq.texi | |||
| @@ -942,6 +942,7 @@ status of its latest version. | |||
| 942 | @menu | 942 | @menu |
| 943 | * Origin of the term Emacs:: | 943 | * Origin of the term Emacs:: |
| 944 | * Latest version of Emacs:: | 944 | * Latest version of Emacs:: |
| 945 | * New in Emacs 24:: | ||
| 945 | * New in Emacs 23:: | 946 | * New in Emacs 23:: |
| 946 | * New in Emacs 22:: | 947 | * New in Emacs 22:: |
| 947 | * New in Emacs 21:: | 948 | * New in Emacs 21:: |
| @@ -1009,12 +1010,84 @@ Emacs, type @kbd{C-h C-n} (@kbd{M-x view-emacs-news}). As of Emacs 22, | |||
| 1009 | you can give this command a prefix argument to read about which features | 1010 | you can give this command a prefix argument to read about which features |
| 1010 | were new in older versions. | 1011 | were new in older versions. |
| 1011 | 1012 | ||
| 1013 | @node New in Emacs 24 | ||
| 1014 | @section What is different about Emacs 24? | ||
| 1015 | @cindex Differences between Emacs 23 and Emacs 24 | ||
| 1016 | @cindex Emacs 24, new features in | ||
| 1017 | |||
| 1018 | @itemize | ||
| 1019 | @cindex packages, installing more | ||
| 1020 | @item | ||
| 1021 | Emacs now includes a package manager. Type @kbd{M-x list-packages} to | ||
| 1022 | get started. You can use this to download and automatically install | ||
| 1023 | many more Lisp packages. | ||
| 1024 | |||
| 1025 | @cindex lexical binding | ||
| 1026 | @item | ||
| 1027 | Emacs Lisp now supports lexical binding on a per-file basis. In | ||
| 1028 | @emph{lexical binding}, variable references must be located textually | ||
| 1029 | within the binding construct. This contrasts with @emph{dynamic | ||
| 1030 | binding}, where programs can refer to variables defined outside their | ||
| 1031 | local textual scope. A Lisp file can use a local variable setting of | ||
| 1032 | @code{lexical-binding: t} to indicate that the contents should be | ||
| 1033 | interpreted using lexical binding. See the Emacs Lisp Reference | ||
| 1034 | Manual for more details. | ||
| 1035 | |||
| 1036 | @cindex bidirectional display | ||
| 1037 | @cindex right-to-left languages | ||
| 1038 | @item | ||
| 1039 | Some human languages, such as English, are written from left to right. | ||
| 1040 | Others, such as Arabic, are written from right to left. Emacs now has | ||
| 1041 | support for any mixture of these forms---this is ``bidirectional text''. | ||
| 1042 | |||
| 1043 | @item | ||
| 1044 | Handling of text selections has been improved, and now integrates | ||
| 1045 | better with external clipboards. | ||
| 1046 | |||
| 1047 | @cindex themes | ||
| 1048 | @item | ||
| 1049 | A new command @kbd{customize-themes} allows you to easily change the | ||
| 1050 | appearance of your Emacs. | ||
| 1051 | |||
| 1052 | @item | ||
| 1053 | Emacs can be compiled with the Gtk+ 3 toolkit. | ||
| 1054 | |||
| 1055 | @item | ||
| 1056 | Support for several new external libraries can be included at compile | ||
| 1057 | time: | ||
| 1058 | |||
| 1059 | @itemize | ||
| 1060 | |||
| 1061 | @item | ||
| 1062 | ``Security-Enhanced Linux'' (SELinux) is a Linux kernel feature that | ||
| 1063 | provides more sophisticated file access controls than ordinary | ||
| 1064 | ``Unix-style'' file permissions. | ||
| 1065 | |||
| 1066 | @item | ||
| 1067 | The ImageMagick display library. This allows you to display many more | ||
| 1068 | image format in Emacs, as well as carry out transformations such as | ||
| 1069 | rotations. | ||
| 1070 | |||
| 1071 | @item | ||
| 1072 | The GnuTLS library for secure network communications. Emacs uses this | ||
| 1073 | transparently for email if your mail server supports it. | ||
| 1074 | |||
| 1075 | @item | ||
| 1076 | The libxml2 library for parsing XML structures. | ||
| 1077 | @end itemize | ||
| 1078 | |||
| 1079 | @item | ||
| 1080 | Much more flexibility in the handling of windows and buffer display. | ||
| 1081 | |||
| 1082 | @end itemize | ||
| 1083 | |||
| 1084 | As always, consult the @file{NEWS} file for more information. | ||
| 1085 | |||
| 1086 | |||
| 1012 | @node New in Emacs 23 | 1087 | @node New in Emacs 23 |
| 1013 | @section What is different about Emacs 23? | 1088 | @section What is different about Emacs 23? |
| 1014 | @cindex Differences between Emacs 22 and Emacs 23 | 1089 | @cindex Differences between Emacs 22 and Emacs 23 |
| 1015 | @cindex Emacs 23, new features in | 1090 | @cindex Emacs 23, new features in |
| 1016 | @cindex Recently introduced features | ||
| 1017 | @cindex Default features | ||
| 1018 | 1091 | ||
| 1019 | @itemize | 1092 | @itemize |
| 1020 | 1093 | ||
| @@ -1065,8 +1138,7 @@ Other changes include: support for serial port access; D-Bus bindings; a | |||
| 1065 | new Visual Line mode for line-motion; improved completion; a new mode | 1138 | new Visual Line mode for line-motion; improved completion; a new mode |
| 1066 | (@samp{DocView}) for viewing of PDF, PostScript, and DVI documents; nXML | 1139 | (@samp{DocView}) for viewing of PDF, PostScript, and DVI documents; nXML |
| 1067 | mode (for editing XML documents) is included; VC has been updated for | 1140 | mode (for editing XML documents) is included; VC has been updated for |
| 1068 | newer version control systems; etc. As always, consult the @file{NEWS} | 1141 | newer version control systems; etc. |
| 1069 | file for more information. | ||
| 1070 | 1142 | ||
| 1071 | 1143 | ||
| 1072 | @node New in Emacs 22 | 1144 | @node New in Emacs 22 |
| @@ -3225,6 +3297,14 @@ see @ref{Packages that do not come with Emacs}. | |||
| 3225 | @cindex Emacs Lisp List | 3297 | @cindex Emacs Lisp List |
| 3226 | @cindex Emacs Lisp Archive | 3298 | @cindex Emacs Lisp Archive |
| 3227 | 3299 | ||
| 3300 | Your first port of call should be the @kbd{M-x list-packages} command. | ||
| 3301 | This connects to the @uref{http:///elpa.gnu.org, GNU ELPA} (``Emacs | ||
| 3302 | Lisp Package Archive'') server and fetches the list of additional | ||
| 3303 | packages that it offers. These are GNU packages that are available | ||
| 3304 | for use with Emacs, but are distributed separately. Select a package | ||
| 3305 | to get more details about the features that it offers, and then if you | ||
| 3306 | wish, Emacs can download and automatically install it for you. | ||
| 3307 | |||
| 3228 | @uref{http://www.damtp.cam.ac.uk/user/sje30/emacs/ell.html, The Emacs Lisp | 3308 | @uref{http://www.damtp.cam.ac.uk/user/sje30/emacs/ell.html, The Emacs Lisp |
| 3229 | List (ELL)}, maintained by @email{S.J.Eglen@@damtp.cam.ac.uk, Stephen Eglen}, | 3309 | List (ELL)}, maintained by @email{S.J.Eglen@@damtp.cam.ac.uk, Stephen Eglen}, |
| 3230 | aims to provide one compact list with links to all of the current Emacs | 3310 | aims to provide one compact list with links to all of the current Emacs |