aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorChong Yidong2012-04-20 16:48:50 +0800
committerChong Yidong2012-04-20 16:48:50 +0800
commitc07a4c0b599e0debfb10acdf02ac6559b998a88a (patch)
treef87bca47c21f04b43cca2347a21ed89c57b67958
parent6cf2a23e297b8a57a70c2a1dab5aa28b73461b0b (diff)
parent50e5ebca7edcf5299b89ff74499991de01e22046 (diff)
downloademacs-c07a4c0b599e0debfb10acdf02ac6559b998a88a.tar.gz
emacs-c07a4c0b599e0debfb10acdf02ac6559b998a88a.zip
Merge from emacs-24 branch
-rw-r--r--ChangeLog8
-rw-r--r--admin/FOR-RELEASE9
-rwxr-xr-xautogen/configure2
-rw-r--r--configure.in2
-rw-r--r--doc/lispref/ChangeLog72
-rw-r--r--doc/lispref/elisp.texi4
-rw-r--r--doc/lispref/files.texi12
-rw-r--r--doc/lispref/help.texi15
-rw-r--r--doc/lispref/keymaps.texi13
-rw-r--r--doc/lispref/minibuf.texi378
-rw-r--r--doc/lispref/processes.texi496
-rw-r--r--doc/lispref/vol1.texi4
-rw-r--r--doc/lispref/vol2.texi4
-rw-r--r--doc/misc/ChangeLog20
-rw-r--r--doc/misc/faq.texi88
-rw-r--r--etc/CONTRIBUTE25
-rw-r--r--etc/ChangeLog6
-rw-r--r--etc/MORE.STUFF137
-rw-r--r--lib-src/ChangeLog5
-rw-r--r--lib-src/emacsclient.c33
-rw-r--r--lisp/ChangeLog74
-rw-r--r--lisp/battery.el4
-rw-r--r--lisp/comint.el34
-rw-r--r--lisp/emacs-lisp/tabulated-list.el4
-rw-r--r--lisp/net/network-stream.el5
-rw-r--r--lisp/progmodes/cc-cmds.el39
-rw-r--r--lisp/progmodes/cc-mode.el4
-rw-r--r--lisp/progmodes/gdb-mi.el121
-rw-r--r--lisp/progmodes/grep.el13
-rw-r--r--lisp/server.el7
-rw-r--r--lisp/subr.el5
-rw-r--r--lisp/window.el137
-rw-r--r--src/ChangeLog27
-rw-r--r--src/process.c43
-rw-r--r--src/xdisp.c21
35 files changed, 1136 insertions, 735 deletions
diff --git a/ChangeLog b/ChangeLog
index 95baf9c5294..d2da3d8527b 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,11 @@
12012-04-20 Ludovic Courtès <ludo@gnu.org>
2
3 * configure.in: Don't use the -R option (Bug#11251).
4
52012-04-20 Teodor Zlatanov <tzz@lifelogs.com>
6
7 * info/dir, Makefile.in (INFO_FILES): Add emacs-gnutls.
8
12012-04-18 Paul Eggert <eggert@cs.ucla.edu> 92012-04-18 Paul Eggert <eggert@cs.ucla.edu>
2 10
3 configure: new option --enable-gcc-warnings (Bug#11207) 11 configure: new option --enable-gcc-warnings (Bug#11207)
diff --git a/admin/FOR-RELEASE b/admin/FOR-RELEASE
index adbeeaa296c..ad427397524 100644
--- a/admin/FOR-RELEASE
+++ b/admin/FOR-RELEASE
@@ -53,12 +53,17 @@ pt-br Rodrigo Real
53ru Alex Ott 53ru Alex Ott
54sk Miroslav Vaško 54sk Miroslav Vaško
55 55
56** For a major release, add a "New in Emacs XX" section to faq.texi.
57
56** Remove temporary +++/--- lines in NEWS. 58** Remove temporary +++/--- lines in NEWS.
57 59
58** Try to reorder NEWS: most important things first, related items together. 60** Try to reorder NEWS: most important things first, related items together.
59 61
60** Consider bumping customize-changed-options-previous-release. 62** Consider bumping customize-changed-options-previous-release.
61 63
64** cusver-check from admin.el cam help find new defcustoms missing
65:version tags.
66
62* BUGS 67* BUGS
63 68
64** Check for modes which bind M-s that conflicts with a new global binding M-s 69** Check for modes which bind M-s that conflicts with a new global binding M-s
@@ -206,7 +211,7 @@ loading.texi cyd
206macros.texi cyd 211macros.texi cyd
207maps.texi rgm 212maps.texi rgm
208markers.texi rgm 213markers.texi rgm
209minibuf.texi 214minibuf.texi rgm
210modes.texi cyd 215modes.texi cyd
211nonascii.texi cyd 216nonascii.texi cyd
212numbers.texi cyd 217numbers.texi cyd
@@ -214,7 +219,7 @@ objects.texi cyd
214os.texi cyd 219os.texi cyd
215package.texi rgm 220package.texi rgm
216positions.texi cyd 221positions.texi cyd
217processes.texi 222processes.texi rgm
218searching.texi rgm 223searching.texi rgm
219sequences.texi cyd 224sequences.texi cyd
220streams.texi cyd 225streams.texi cyd
diff --git a/autogen/configure b/autogen/configure
index 08f35898ff4..0d9d1abdaa4 100755
--- a/autogen/configure
+++ b/autogen/configure
@@ -22866,7 +22866,7 @@ case "$opsys" in
22866 ## had not yet been defined and was expanded to null. Hence LD_SWITCH_SYSTEM 22866 ## had not yet been defined and was expanded to null. Hence LD_SWITCH_SYSTEM
22867 ## had different values in configure (in ac_link) and src/Makefile.in. 22867 ## had different values in configure (in ac_link) and src/Makefile.in.
22868 ## It seems clearer therefore to put this piece in LD_SWITCH_SYSTEM_TEMACS. 22868 ## It seems clearer therefore to put this piece in LD_SWITCH_SYSTEM_TEMACS.
22869 gnu-linux) LD_SWITCH_SYSTEM_TEMACS="\$(LD_SWITCH_X_SITE_AUX)" ;; 22869 gnu*) LD_SWITCH_SYSTEM_TEMACS="\$(LD_SWITCH_X_SITE_AUX_RPATH)" ;;
22870 22870
22871 *) LD_SWITCH_SYSTEM_TEMACS= ;; 22871 *) LD_SWITCH_SYSTEM_TEMACS= ;;
22872esac 22872esac
diff --git a/configure.in b/configure.in
index 21b8c9d2b8f..1554e10145f 100644
--- a/configure.in
+++ b/configure.in
@@ -3510,7 +3510,7 @@ case "$opsys" in
3510 ## had not yet been defined and was expanded to null. Hence LD_SWITCH_SYSTEM 3510 ## had not yet been defined and was expanded to null. Hence LD_SWITCH_SYSTEM
3511 ## had different values in configure (in ac_link) and src/Makefile.in. 3511 ## had different values in configure (in ac_link) and src/Makefile.in.
3512 ## It seems clearer therefore to put this piece in LD_SWITCH_SYSTEM_TEMACS. 3512 ## It seems clearer therefore to put this piece in LD_SWITCH_SYSTEM_TEMACS.
3513 gnu-linux) LD_SWITCH_SYSTEM_TEMACS="\$(LD_SWITCH_X_SITE_AUX)" ;; 3513 gnu*) LD_SWITCH_SYSTEM_TEMACS="\$(LD_SWITCH_X_SITE_AUX_RPATH)" ;;
3514 3514
3515 *) LD_SWITCH_SYSTEM_TEMACS= ;; 3515 *) LD_SWITCH_SYSTEM_TEMACS= ;;
3516esac 3516esac
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 @@
12012-04-20 Chong Yidong <cyd@gnu.org>
2
3 * processes.texi (Asynchronous Processes): Mention nil argument to
4 start-process.
5
62012-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
192012-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
392012-04-18 Glenn Morris <rgm@gnu.org>
40
41 * processes.texi (Serial Ports, Byte Packing, Bindat Spec)
42 (Bindat Functions): Copyedits.
43
442012-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
492012-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
592012-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
662012-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
12012-04-15 Glenn Morris <rgm@gnu.org> 732012-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
490This variable determines whether files may be written out that do 490This 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
493the file whenever the buffer being saved does not already end in one. 493of the buffer whenever it does not already end in one. If the value
494If the value of the variable is non-@code{nil}, but not @code{t}, then 494is @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 495file. If the value is @code{visit-save}, Emacs adds a missing newline
496case arises. 496both 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
498the case arises.
497 499
498If the value of the variable is @code{nil}, then @code{save-buffer} 500If the value of the variable is @code{nil}, then @code{save-buffer}
499doesn't add newlines at all. @code{nil} is the default value, but a few 501doesn'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
347replaces them by what they stand for, returning the result as a string. 347replaces them by what they stand for, returning the result as a string.
348This permits display of documentation that refers accurately to the 348This permits display of documentation that refers accurately to the
349user's own customized key bindings. 349user's own customized key bindings.
350
351@cindex advertised binding
352If a command has multiple bindings, this function normally uses the
353first one it finds. You can specify one particular key binding by
354assigning an @code{:advertised-binding} symbol property to the
355command, like this:
356
357@smallexample
358(put 'undo :advertised-binding [?\C-/])
359@end smallexample
360
361@noindent
362The @code{:advertised-binding} property also affects the binding shown
363in menu items (@pxref{Menu Bar}). The property is ignored if it
364specifies 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
2548convenient hint for users who do not know the key binding. If a 2548convenient hint for users who do not know the key binding. If a
2549command has multiple bindings, Emacs normally displays the first one 2549command has multiple bindings, Emacs normally displays the first one
2550it finds. You can specify one particular key binding by assigning an 2550it 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
2552instance, the following tells Emacs to show @kbd{C-/} for the 2552in Documentation}.
2553@code{undo} menu item:
2554
2555@smallexample
2556(put 'undo :advertised-binding [?\C-/])
2557@end smallexample
2558
2559@noindent
2560If the @code{:advertised-binding} property specifies a key binding
2561that 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
61automatically if the contents require more space. You can explicitly 61automatically if the contents require more space. You can explicitly
62@c FIXME? Works in 23.4, not 24.0.95. (Bug#11276)
62resize it temporarily with the window sizing commands; it reverts to 63resize it temporarily with the window sizing commands; it reverts to
63its normal size when the minibuffer is exited. You can resize it 64its normal size when the minibuffer is exited. You can resize it
65@c FIXME? Doesn't work in any version of Emacs?
64permanently by using the window sizing commands in the frame's other 66permanently by using the window sizing commands in the frame's other
65window, when the minibuffer is not active. If the frame contains just 67window, when the minibuffer is not active. If the frame contains just
66a minibuffer, you can change the minibuffer's size by changing the 68a 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}
72code that uses the minibuffer, if you do not want that to change them. 74code 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
75there is an active minibuffer; such minibuffers are called a 77there 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
78incrementing the number at the end of the name. (The names begin with 80incrementing the number at the end of the name. (The names begin with
79a space so that they won't show up in normal buffer lists.) Of 81a space so that they won't show up in normal buffer lists.) Of
80several recursive minibuffers, the innermost (or most recently 82several recursive minibuffers, the innermost (or most recently
@@ -90,6 +92,12 @@ to be done. @xref{Text from Minibuffer}, for the non-completion
90minibuffer local maps. @xref{Completion Commands}, for the minibuffer 92minibuffer local maps. @xref{Completion Commands}, for the minibuffer
91local maps for completion. 93local 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
99the 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
94minibuffer actually reads a line from the standard input descriptor that 102minibuffer actually reads a line from the standard input descriptor that
95was supplied when Emacs was started. 103was supplied when Emacs was started.
@@ -110,7 +118,7 @@ middle of a Lisp function. Instead, do all minibuffer input as part of
110reading the arguments for a command, in the @code{interactive} 118reading the arguments for a command, in the @code{interactive}
111specification. @xref{Defining Commands}. 119specification. @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
114This function is the most general way to get input from the 122This function is the most general way to get input from the
115minibuffer. By default, it accepts arbitrary text and returns it as a 123minibuffer. By default, it accepts arbitrary text and returns it as a
116string; however, if @var{read} is non-@code{nil}, then it uses 124string; 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
118Functions}). 126Functions}).
119 127
120The first thing this function does is to activate a minibuffer and 128The first thing this function does is to activate a minibuffer and
121display it with @var{prompt-string} as the prompt. This value must be a 129display it with @var{prompt} (which must be a string) as the
122string. Then the user can edit text in the minibuffer. 130prompt. Then the user can edit text in the minibuffer.
123 131
124When the user types a command to exit the minibuffer, 132When 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.
131The argument @var{default} specifies default values to make available 139The argument @var{default} specifies default values to make available
132through the history commands. It should be a string, a list of 140through the history commands. It should be a string, a list of
133strings, or @code{nil}. The string or strings become the minibuffer's 141strings, 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
136If @var{read} is non-@code{nil}, then @var{default} is also used 144If @var{read} is non-@code{nil}, then @var{default} is also used
137as the input to @code{read}, if the user enters empty input. 145as 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
148a keymap is the most important way to customize the minibuffer for 156a keymap is the most important way to customize the minibuffer for
149various applications such as completion. 157various applications such as completion.
150 158
151The argument @var{hist} specifies which history list variable to use 159The argument @var{history} specifies a history list variable to use
152for saving the input and for history commands used in the minibuffer. 160for saving the input and for history commands used in the minibuffer.
153It defaults to @code{minibuffer-history}. @xref{Minibuffer History}. 161It defaults to @code{minibuffer-history}. You can optionally specify
162a starting position in the history list as well. @xref{Minibuffer History}.
154 163
155If the variable @code{minibuffer-allow-text-properties} is 164If the variable @code{minibuffer-allow-text-properties} is
156non-@code{nil}, then the string which is returned includes whatever text 165non-@code{nil}, then the string that is returned includes whatever text
157properties were present in the minibuffer. Otherwise all the text 166properties were present in the minibuffer. Otherwise all the text
158properties are stripped when the value is returned. 167properties are stripped when the value is returned.
159 168
@@ -163,9 +172,9 @@ the setting of @code{enable-multibyte-characters} (@pxref{Text
163Representations}) from whichever buffer was current before entering the 172Representations}) from whichever buffer was current before entering the
164minibuffer. 173minibuffer.
165 174
166Use of @var{initial-contents} is mostly deprecated; we recommend using 175Use of @var{initial} is mostly deprecated; we recommend using
167a non-@code{nil} value only in conjunction with specifying a cons cell 176a non-@code{nil} value only in conjunction with specifying a cons cell
168for @var{hist}. @xref{Initial Input}. 177for @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
179specifies a default value to return if the user enters null input. As 188specifies a default value to return if the user enters null input. As
180in @code{read-from-minibuffer} it should be a string, a list of 189in @code{read-from-minibuffer} it should be a string, a list of
181strings, or @code{nil} which is equivalent to an empty string. When 190strings, 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
183is a list of strings, the first string is the default value. (All 192is a list of strings, the first string is the default value. (All
184these strings are available to the user in the ``future minibuffer 193these strings are available to the user in the ``future minibuffer
185history.'') 194history''.)
186 195
187This function works by calling the 196This 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
205This function reads a regular expression as a string from the 214This function reads a regular expression as a string from the
206minibuffer and returns it. The argument @var{prompt} is used as in 215minibuffer 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
209history list (@pxref{Minibuffer History, regexp-history}). 218history list (@pxref{Minibuffer History, regexp-history}).
210 219
211The optional argument @var{default-value} specifies a default value to 220The optional argument @var{default} specifies a default value to
212return if the user enters null input; it should be a string, or 221return 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
215In addition, @code{read-regexp} collects a few useful candidates for 224In addition, @code{read-regexp} collects a few useful candidates for
216input and passes them to @code{read-from-minibuffer}, to make them 225input 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
237If this variable is @code{nil}, then @code{read-from-minibuffer} strips 246If this variable is @code{nil}, then @code{read-from-minibuffer}
238all text properties from the minibuffer input before returning it. 247and @code{read-string} strip all text properties from the minibuffer
239This variable also affects @code{read-string}. However, 248input 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
242Minibuffer,, Reading Lisp Objects With the Minibuffer}), and all 251Minibuffer,, 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
308This built-in variable is the keymap used as the minibuffer local keymap 325This built-in variable is the keymap used as the minibuffer local keymap
309in the function @code{read-no-blanks-input}. By default, it makes the 326in 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
391This function reads a Lisp expression in the minibuffer, and then 408This function reads a Lisp expression in the minibuffer, evaluates it,
392evaluates it. The difference between this command and 409then 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
394optional and it is treated as a Lisp object to be converted to printed 411optional and it is treated as a Lisp object to be converted to printed
395representation rather than as a string of text. It is printed with 412representation 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{"})
397appear in the initial text. @xref{Output Functions}. 414appear in the initial text. @xref{Output Functions}.
398 415
399The first thing @code{edit-and-eval-command} does is to activate the
400minibuffer with @var{prompt} as the prompt. Then it inserts the printed
401representation of @var{form} in the minibuffer, and lets the user edit it.
402When the user exits the minibuffer, the edited text is read with
403@code{read} and then evaluated. The resulting value becomes the value
404of @code{edit-and-eval-command}.
405
406In the following example, we offer the user an expression with initial 416In the following example, we offer the user an expression with initial
407text which is a valid form already: 417text 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
425Typing @key{RET} right away would exit the minibuffer and evaluate the 435Typing @key{RET} right away would exit the minibuffer and evaluate the
426expression, thus moving point forward one word. 436expression, 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.
440kinds of inputs. It's the Lisp programmer's job to specify the right 449kinds of inputs. It's the Lisp programmer's job to specify the right
441history list for each use of the minibuffer. 450history 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}
444argument to @code{read-from-minibuffer} or @code{completing-read}. 453argument to @code{read-from-minibuffer} or @code{completing-read}.
445Here are the possible values for it: 454Here are the possible values for it:
446 455
@@ -456,7 +465,7 @@ Specifying 0 for @var{startpos} is equivalent to just specifying the
456symbol @var{variable}. @code{previous-history-element} will display 465symbol @var{variable}. @code{previous-history-element} will display
457the most recent element of the history list in the minibuffer. If you 466the most recent element of the history list in the minibuffer. If you
458specify a positive @var{startpos}, the minibuffer history functions 467specify a positive @var{startpos}, the minibuffer history functions
459behave as if @code{(elt @var{variable} (1- @var{STARTPOS}))} were the 468behave as if @code{(elt @var{variable} (1- @var{startpos}))} were the
460history element currently shown in the minibuffer. 469history element currently shown in the minibuffer.
461 470
462For consistency, you should also specify that element of the history 471For consistency, you should also specify that element of the history
@@ -464,7 +473,7 @@ as the initial minibuffer contents, using the @var{initial} argument
464to the minibuffer input function (@pxref{Initial Input}). 473to 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,
469see below. You can also create your own history list variable; just 478see below. You can also create your own history list variable; just
470initialize it to @code{nil} before the first use. 479initialize it to @code{nil} before the first use.
@@ -503,15 +512,15 @@ If the value of this variable is @code{nil}, standard functions that
503read from the minibuffer don't add new elements to the history list. 512read from the minibuffer don't add new elements to the history list.
504This lets Lisp programs explicitly manage input history by using 513This 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
506set to a non-@code{nil} value. 515non-@code{nil}.
507@end defvar 516@end defvar
508 517
509@defopt history-length 518@defopt history-length
510The value of this variable specifies the maximum length for all 519The value of this variable specifies the maximum length for all
511history lists that don't specify their own maximum lengths. If the 520history lists that don't specify their own maximum lengths. If the
512value is @code{t}, that means there is no maximum (don't delete old 521value is @code{t}, that means there is no maximum (don't delete old
513elements). The value of @code{history-length} property of the history 522elements). If a history list variable's symbol has a non-@code{nil}
514list variable's symbol, if set, overrides this variable for that 523@code{history-length} property, it overrides this variable for that
515particular history list. 524particular history list.
516@end defopt 525@end defopt
517 526
@@ -555,11 +564,19 @@ A history list for arguments that are shell commands.
555A history list for arguments that are Lisp expressions to evaluate. 564A history list for arguments that are Lisp expressions to evaluate.
556@end defvar 565@end defvar
557 566
567@defvar face-name-history
568A 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
561Several of the functions for minibuffer input have an argument called 578Several 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
563feature for specifying that the minibuffer should start out with 580feature for specifying that the minibuffer should start out with
564certain text, instead of empty as usual. 581certain text, instead of empty as usual.
565 582
@@ -576,7 +593,7 @@ to offer useful default inputs to the user.
576 593
577There is just one situation where you should specify a string for an 594There 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},
588of 0 means the beginning of the string, 1 means after the first 605of 0 means the beginning of the string, 1 means after the first
589character, etc. In @code{read-minibuffer}, and the other 606character, etc. In @code{read-minibuffer}, and the other
590non-completion minibuffer input functions that support this argument, 607non-completion minibuffer input functions that support this argument,
5911 means the beginning of the string 2 means after the first character, 6081 means the beginning of the string, 2 means after the first character,
592etc. 609etc.
593 610
594Use of a cons cell as the value for @var{initial} arguments is 611Use of a cons cell as the value for @var{initial} arguments is deprecated.
595deprecated 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
603user's input against a list of valid names and determining how much of 619user's input against a list of valid names and determining how much of
604the name is determined uniquely by what the user has typed. For 620the name is determined uniquely by what the user has typed. For
605example, when you type @kbd{C-x b} (@code{switch-to-buffer}) and then 621example, 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."
606type the first few letters of the name of the buffer to which you wish 623type the first few letters of the name of the buffer to which you wish
607to switch, and then type @key{TAB} (@code{minibuffer-complete}), Emacs 624to switch, and then type @key{TAB} (@code{minibuffer-complete}), Emacs
608extends the name as far as it can. 625extends 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
662permissible completions are the elements of the alist that are either 679permissible completions are the elements of the alist that are either
663strings, or conses whose @sc{car} is a string or symbol. 680strings, or conses whose @sc{car} is a string or symbol.
664Symbols are converted to strings using @code{symbol-name}. Other 681Symbols are converted to strings using @code{symbol-name}. Other
665elements of the alist are ignored. (Remember that in Emacs Lisp, the 682elements of the alist are ignored. (Remember that in Emacs Lisp, the
666elements of alists do not @emph{have} to be conses.) In particular, a 683elements of alists do not @emph{have} to be conses.) In particular, a
667list of strings is allowed, even though we usually do not 684list of strings is allowed, even though we usually do not
668think of such lists as alists. 685think of such lists as alists.
669 686
670@cindex obarray in completion 687@cindex obarray in completion
671If @var{collection} is an obarray (@pxref{Creating Symbols}), the names 688If @var{collection} is an obarray (@pxref{Creating Symbols}), the names
672of all symbols in the obarray form the set of permissible completions. The 689of all symbols in the obarray form the set of permissible completions.
673global variable @code{obarray} holds an obarray containing the names of
674all interned Lisp symbols.
675
676Note that the only valid way to make a new obarray is to create it
677empty and then add symbols to it one by one using @code{intern}.
678Also, you cannot intern a given symbol in more than one obarray.
679 690
680If @var{collection} is a hash table, then the keys that are strings 691If @var{collection} is a hash table, then the keys that are strings
681are the possible completions. Other keys are ignored. 692are 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
760This function returns a list of all possible completions of 772This 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})
763this function uses @code{completion-regexp-list} in the same way that 775are the same as those of @code{try-completion}, and it
776uses @code{completion-regexp-list} in the same way that
764@code{try-completion} does. 777@code{try-completion} does.
765 778
779@ignore
766The optional argument @var{nospace} is obsolete. If it is 780The optional argument @var{nospace} is obsolete. If it is
767non-@code{nil}, completions that start with a space are ignored unless 781non-@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
770If @var{collection} is a function, it is called with three arguments: 785If @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
837If you store a completion alist in a variable, you should mark the 852If you store a completion alist in a variable, you should mark the
838variable as ``risky'' with a non-@code{nil} 853variable 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}.
864It is done by calling @var{fun} with no arguments. The 879It is done by calling @var{fun} with no arguments. The
865value @var{fun} returns becomes the permanent value of @var{var}. 880value @var{fun} returns becomes the permanent value of @var{var}.
866 881
867Here is a usage example: 882Here 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
880minibuffer with completion. 895minibuffer 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
883This function reads a string in the minibuffer, assisting the user by 898This function reads a string in the minibuffer, assisting the user by
884providing completion. It activates the minibuffer with prompt 899providing 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
935non-@code{nil}. @xref{Completion Commands}. 950non-@code{nil}. @xref{Completion Commands}.
936 951
937The argument @var{hist} specifies which history list variable to use for 952The argument @var{history} specifies which history list variable to use for
938saving the input and for minibuffer history commands. It defaults to 953saving 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
941The argument @var{initial} is mostly deprecated; we recommend using a 956The argument @var{initial} is mostly deprecated; we recommend using a
942non-@code{nil} value only in conjunction with specifying a cons cell 957non-@code{nil} value only in conjunction with specifying a cons cell
943for @var{hist}. @xref{Initial Input}. For default input, use 958for @var{history}. @xref{Initial Input}. For default input, use
944@var{default} instead. 959@var{default} instead.
945 960
946If the argument @var{inherit-input-method} is non-@code{nil}, then the 961If 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
950entering the minibuffer. 965entering the minibuffer.
951 966
952If the built-in variable @code{completion-ignore-case} is 967If the variable @code{completion-ignore-case} is
953non-@code{nil}, completion ignores case when comparing the input 968non-@code{nil}, completion ignores case when comparing the input
954against the possible matches. @xref{Basic Completion}. In this mode 969against the possible matches. @xref{Basic Completion}. In this mode
955of operation, @var{predicate} must also ignore case, or you will get 970of 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
1082feedback. This is not needed in the minibuffer; for minibuffer 1097feedback. This is not needed in the minibuffer; for minibuffer
1083completion, you can pass @code{nil}. 1098completion, you can pass @code{nil}.
1084 1099
1085This function is called by @code{minibuffer-completion-help}. The 1100This function is called by @code{minibuffer-completion-help}. A
1086most common way to use it is together with 1101common 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
1120with other characters bound as in @code{minibuffer-local-map} 1135and 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
1129bindings: 1144bindings:
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
1149with other characters bound as in @code{minibuffer-local-map}. 1155and 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
1153This is like @code{minibuffer-local-completion-map} 1159This is a sparse keymap that simply unbinds @key{SPC}; because
1154except that it does not bind @key{SPC}. This keymap is used by the 1160filenames can contain spaces. The function @code{read-file-name}
1155function @code{read-file-name}. 1161combines this keymap with either @code{minibuffer-local-completion-map}
1162or @code{minibuffer-local-must-match-map}.
1156@end defvar 1163@end defvar
1157 1164
1158@defvar minibuffer-local-filename-must-match-map
1159This is like @code{minibuffer-local-must-match-map}
1160except that it does not bind @key{SPC}. This keymap is used by the
1161function @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
1168reading certain sorts of names with completion. 1170reading 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}.
1238The argument @var{default} specifies what to return if the user enters 1240The argument @var{default} specifies what to return if the user enters
1239null input. It can be a symbol, a string or a list of strings. If it 1241null input. It can be a symbol, a string or a list of strings. If it
1240is a string, @code{read-command} interns it before returning it. 1242is a string, @code{read-command} interns it before returning it.
1241If it is a list, @code{read-command} returns the first element of this list. 1243If it is a list, @code{read-command} interns the first element of this list.
1242If @var{default} is @code{nil}, that means no default has been 1244If @var{default} is @code{nil}, that means no default has been
1243specified; then if the user enters null input, the return value is 1245specified; 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}
1283This function reads the name of a user variable and returns it as a 1285This function reads the name of a customizable variable and returns it
1284symbol. 1286as a symbol. Its arguments have the same form as those of
1285 1287@code{read-command}. It behaves just like @code{read-command}, except
1286The argument @var{default} specifies the default value to return if 1288that it uses the predicate @code{custom-variable-p} instead of
1287the user enters null input. It can be a symbol, a string, or a list 1289@code{commandp}.
1288of strings. If it is a string, @code{read-variable} interns it to
1289make the default value. If it is a list, @code{read-variable} interns
1290the first element. If @var{default} is @code{nil}, that means no
1291default has been specified; then if the user enters null input, the
1292return 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 ----------
1305Variable name? @point{}
1306---------- Buffer: Minibuffer ----------
1307@end group
1308@end example
1309
1310@noindent
1311If the user then types @kbd{fill-p @key{RET}}, @code{read-variable}
1312returns @code{fill-prefix}.
1313
1314In general, @code{read-variable} is similar to @code{read-command},
1315but 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
1342argument @var{convert} is non-@code{nil}, it converts any input color 1304argument @var{convert} is non-@code{nil}, it converts any input color
1343name into the corresponding RGB value string and instead returns that. 1305name into the corresponding RGB value string and instead returns that.
1344This function requires a valid color specification to be input. 1306This function requires a valid color specification to be input.
1345Empty color names are allowed when @code{allow-empty} is 1307Empty color names are allowed when @var{allow-empty} is
1346non-@code{nil} and the user enters null input. 1308non-@code{nil} and the user enters null input.
1347 1309
1348Interactively, or when @var{display} is non-@code{nil}, the return 1310Interactively, 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
1363to read file names, directory names, and shell commands respectively. 1325to read file names, directory names, and shell commands, respectively.
1364They provide special features, including automatic insertion of the 1326They provide special features, including automatic insertion of the
1365default directory. 1327default directory.
1366 1328
@@ -1369,15 +1331,29 @@ This function reads a file name, prompting with @var{prompt} and
1369providing completion. 1331providing completion.
1370 1332
1371As an exception, this function reads a file name using a graphical 1333As an exception, this function reads a file name using a graphical
1372file dialog instead of the minibuffer, if (i) it is invoked via a 1334file dialog instead of the minibuffer, if all of the following are
1373mouse command, and (ii) the selected frame is on a graphical display 1335true:
1374supporting such dialogs, and (iii) the variable @code{use-dialog-box} 1336
1375is non-@code{nil} (@pxref{Dialog Boxes,, Dialog Boxes, emacs, The GNU 1337@enumerate
1376Emacs Manual}), and (iv) the @var{directory} argument, described 1338@item
1377below, does not specify a remote file (@pxref{Remote Files,, Remote 1339It is invoked via a mouse command.
1378Files, emacs, The GNU Emacs Manual}). The exact behavior when using a 1340
1379graphical file dialog is platform-dependent. Here, we simply document 1341@item
1380the behavior when using the minibuffer. 1342The selected frame is on a graphical display supporting such dialogs.
1343
1344@item
1345The variable @code{use-dialog-box} is non-@code{nil}.
1346@xref{Dialog Boxes,, Dialog Boxes, emacs, The GNU Emacs Manual}.
1347
1348@item
1349The @var{directory} argument, described below, does not specify a
1350remote file. @xref{Remote Files,, Remote Files, emacs, The GNU Emacs Manual}.
1351@end enumerate
1352
1353@noindent
1354The exact behavior when using a graphical file dialog is
1355platform-dependent. Here, we simply document the behavior when using
1356the 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
1383name. You must call @code{expand-file-name} yourself if an absolute 1359name. 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
1389The argument @var{directory} specifies the directory to use for 1365The argument @var{directory} specifies the directory to use for
1390completing relative file names. It should be an absolute directory 1366completing relative file names. It should be an absolute directory
1391name. If @code{insert-default-directory} is non-@code{nil}, 1367name. 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.
1393It defaults to the current buffer's value of @code{default-directory}. 1369It 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
1396in the buffer (after @var{directory}, if that is inserted). In this 1372in the buffer (after @var{directory}, if that is inserted). In this
1397case, point goes at the beginning of @var{initial}. The default for 1373case, 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
1400note:} we recommend using @var{default} rather than @var{initial} in 1376a file. @strong{Please note:} we recommend using @var{default} rather
1401most cases. 1377than @var{initial} in most cases.
1402 1378
1403If @var{default} is non-@code{nil}, then the function returns 1379If @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
1502value controls whether @code{read-file-name} starts by placing the 1478value controls whether @code{read-file-name} starts by placing the
1503name of the default directory in the minibuffer, plus the initial file 1479name of the default directory in the minibuffer, plus the initial file
1504name if any. If the value of this variable is @code{nil}, then 1480name, 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
1506minibuffer (unless you specify initial input with the @var{initial} 1482minibuffer (unless you specify initial input with the @var{initial}
1507argument). In that case, the default directory is still used for 1483argument). 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
1548This function reads a shell command from the minibuffer, prompting 1524This function reads a shell command from the minibuffer, prompting
1549with @var{prompt} and providing intelligent completion. It completes 1525with @var{prompt} and providing intelligent completion. It completes
1550the first word of the command using candidates that are appropriate 1526the first word of the command using candidates that are appropriate
1551for command names, and the rest of the command words as file names. 1527for command names, and the rest of the command words as file names.
1552 1528
1553This function uses @code{minibuffer-local-shell-command-map} as the 1529This function uses @code{minibuffer-local-shell-command-map} as the
1554keymap for minibuffer input. The @var{hist} argument specifies the 1530keymap for minibuffer input. The @var{history} argument specifies the
1555history list to use; if is omitted or @code{nil}, it defaults to 1531history 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,
1557shell-command-history}). The optional argument @var{initial-contents} 1533shell-command-history}). The optional argument @var{initial}
1558specifies the initial content of the minibuffer (@pxref{Initial 1534specifies the initial content of the minibuffer (@pxref{Initial
1559Input}). The rest of @var{args}, if present, are used as the 1535Input}). 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
1565This keymap is used by @code{read-shell-command} for completing 1541This keymap is used by @code{read-shell-command} for completing
1566command and file names that are part of a shell command. 1542command 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}
1544to @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
1573completion behavior. 1551completion behavior.
1574 1552
1575@cindex completion styles 1553@cindex completion styles
1576@defopt completion-styles 1554@defopt completion-styles
1577The value of this variable is a list of completion style (symbols) to 1555The value of this variable is a list of completion style (symbols) to
1578use for performing completion. A @dfn{completion style} is a set of 1556use for performing completion. A @dfn{completion style} is a set of
1579rules for generating completions. Each symbol in occurring this list 1557rules for generating completions. Each symbol occurring this list
1580must have a corresponding entry in @code{completion-styles-alist}. 1558must 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
1624This variable specifies special completion styles and other completion 1602This variable specifies special completion styles and other completion
1625behaviors to use when completing certain types of text. Its value 1603behaviors to use when completing certain types of text. Its value
1626should be a list of the form @code{(@var{category} . @var{alist})}. 1604should 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
1628currently, the @code{buffer} and @code{file} categories are defined, 1606completed; currently, the @code{buffer}, @code{file}, and
1629but 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 1608via specialized completion functions (@pxref{Programmed Completion}).
1631describing how completion should behave for the corresponding 1609@var{alist} is an association list describing how completion should
1632category. The following alist keys are supported: 1610behave for the corresponding category. The following alist keys are
1611supported:
1633 1612
1634@table @code 1613@table @code
1635@item styles 1614@item styles
@@ -1662,7 +1641,7 @@ the completion.
1662The value should be a function to run after performing completion. 1641The value should be a function to run after performing completion.
1663The function should accept two arguments, @var{string} and 1642The 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
1665completed and @var{status} indicates what kind of operation happened: 1644completed, 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
1667cannot be further completed but completion is not finished, or 1646cannot 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})
1728This specifies a @code{completion-boundaries} operation. The function 1707This specifies a @code{completion-boundaries} operation. The function
1729should return @code{(boundaries START . END)}, where START is the 1708should return @code{(boundaries @var{start} . @var{end})}, where
1730position of the beginning boundary in the specified string, and END is 1709@var{start} is the position of the beginning boundary in the specified
1731the position of the end boundary in SUFFIX. 1710string, and @var{end} is the position of the end boundary in
1711@var{suffix}.
1732 1712
1733@item metadata 1713@item metadata
1734This specifies a request for information about the state of the 1714This 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
1775This function is a convenient way to write a function that can act as 1755This function is a convenient way to write a function that can act as
1776programmed completion function. The argument @var{function} should be 1756a programmed completion function. The argument @var{function} should be
1777a function that takes one argument, a string, and returns an alist of 1757a function that takes one argument, a string, and returns an alist of
1778possible completions of it. You can think of 1758possible 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
1829If the value is @code{no}, then if the completion table fails to match 1809If the value is @code{no}, then if the completion table fails to match
1830the text at point, then @code{completion-at-point} moves on to the 1810the text at point, @code{completion-at-point} moves on to the
1831next function in @code{completion-at-point-functions} instead of 1811next function in @code{completion-at-point-functions} instead of
1832reporting a completion failure. 1812reporting a completion failure.
1833@end table 1813@end table
@@ -1841,7 +1821,7 @@ old code to using @code{completion-at-point}.
1841The first function in @code{completion-at-point-functions} to return a 1821The first function in @code{completion-at-point-functions} to return a
1842non-@code{nil} value is used by @code{completion-at-point}. The 1822non-@code{nil} value is used by @code{completion-at-point}. The
1843remaining functions are not called. The exception to this is when 1823remaining functions are not called. The exception to this is when
1844there is a @code{:exclusive} specification, as described above. 1824there 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.
1879using the mouse---more precisely, if @code{last-nonmenu-event} 1859using 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
1881uses a dialog box or pop-up menu to ask the question. Otherwise, it 1861uses a dialog box or pop-up menu to ask the question. Otherwise, it
1882uses keyboard input. You can force use of the mouse or use of keyboard 1862uses keyboard input. You can force use either of the mouse or of keyboard
1883input by binding @code{last-nonmenu-event} to a suitable value around 1863input by binding @code{last-nonmenu-event} to a suitable value around
1884the call. 1864the call.
1885 1865
@@ -1890,7 +1870,7 @@ the call.
1890This function asks the user a question, expecting input in the echo 1870This function asks the user a question, expecting input in the echo
1891area. It returns @code{t} if the user types @kbd{y}, @code{nil} if the 1871area. It returns @code{t} if the user types @kbd{y}, @code{nil} if the
1892user types @kbd{n}. This function also accepts @key{SPC} to mean yes 1872user types @kbd{n}. This function also accepts @key{SPC} to mean yes
1893and @key{DEL} to mean no. It accepts @kbd{C-]} to mean ``quit,'' like 1873and @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
1895that reason the user might try to use @kbd{C-]} to get out. The answer 1875that reason the user might try to use @kbd{C-]} to get out. The answer
1896is a single character, with no @key{RET} needed to terminate it. Upper 1876is 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.
1914In the following example, the user first types @kbd{q}, which is 1894In the following example, the user first types @kbd{q}, which is
1915invalid. At the next prompt the user types @kbd{y}. 1895invalid. 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
1951appears on the screen at a time. 1935appears 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
1955Like @code{y-or-n-p}, except that if the user fails to answer within 1939Like @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}.
1958The argument @var{seconds} may be an integer or a floating point number. 1942The 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.
2022The value of @var{list} specifies the objects to ask questions about. 2006The value of @var{list} specifies the objects to ask questions about.
2023It should be either a list of objects or a generator function. If it is 2007It should be either a list of objects or a generator function. If it is
2024a function, it should expect no arguments, and should return either the 2008a function, it should expect no arguments, and should return either the
2025next object to ask about, or @code{nil} meaning stop asking questions. 2009next object to ask about, or @code{nil}, meaning to stop asking questions.
2026 2010
2027The argument @var{prompter} specifies how to ask each question. If 2011The 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
2038If not a string, @var{prompter} should be a function of one argument 2022If 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
2040the value is a string, that is the question to ask the user. The 2024the value is a string, that is the question to ask the user. The
2041function can also return @code{t} meaning do act on this object (and 2025function can also return @code{t}, meaning do act on this object (and
2042don't ask the user), or @code{nil} meaning ignore this object (and don't 2026don't ask the user), or @code{nil}, meaning ignore this object (and don't
2043ask the user). 2027ask the user).
2044 2028
2045The argument @var{actor} says how to act on the answers that the user 2029The 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
2081When the user responds with @var{char}, @code{map-y-or-n-p} calls 2065When 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
2085same object. 2069same object.
2086 2070
@@ -2092,12 +2076,14 @@ If @code{map-y-or-n-p} is called in a command that was invoked using the
2092mouse---more precisely, if @code{last-nonmenu-event} (@pxref{Command 2076mouse---more precisely, if @code{last-nonmenu-event} (@pxref{Command
2093Loop Info}) is either @code{nil} or a list---then it uses a dialog box 2077Loop Info}) is either @code{nil} or a list---then it uses a dialog box
2094or pop-up menu to ask the question. In this case, it does not use 2078or pop-up menu to ask the question. In this case, it does not use
2095keyboard input or the echo area. You can force use of the mouse or use 2079keyboard input or the echo area. You can force use either of the mouse or
2096of keyboard input by binding @code{last-nonmenu-event} to a suitable 2080of keyboard input by binding @code{last-nonmenu-event} to a suitable
2097value around the call. 2081value around the call.
2098 2082
2099The return value of @code{map-y-or-n-p} is the number of objects acted on. 2083The 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
2160regular expression). 2146regular expression).
2161@end deffn 2147@end deffn
2162 2148
2149@deffn Command previous-complete-history-element n
2150This command replaces the minibuffer contents with the value of the
2151@var{n}th previous (older) history element that completes the current
2152contents of the minibuffer before the point.
2153@end deffn
2154
2155@deffn Command next-complete-history-element n
2156This command replaces the minibuffer contents with the value of the
2157@var{n}th next (newer) history element that completes the current
2158contents 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
2171This function returns the currently active minibuffer window, or 2170This 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
2202frame. 2201frame.
2203 2202
2204@defun minibuffer-window-active-p window 2203@defun minibuffer-window-active-p window
2205This function returns non-@code{nil} if @var{window}, assumed to be 2204This function returns non-@code{nil} if @var{window} is the currently
2206a minibuffer window, is currently active. 2205active 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
2321This function returns the window which was selected when the 2320This function returns the window that was selected when the
2322minibuffer was entered. If selected window is not a minibuffer 2321minibuffer was entered. If selected window is not a minibuffer
2323window, it returns @code{nil}. 2322window, 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
2329frame. If an integer, it specifies a number of lines. 2328frame. 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
2333This function displays @var{string} temporarily at the end of the 2333This function displays @var{string} temporarily at the end of the
2334minibuffer text, for two seconds, or until the next input event 2334minibuffer text, for a few seconds, or until the next input event
2335arrives, whichever comes first. If @var{args} is non-@code{nil}, the 2335arrives, whichever comes first. The variable
2336actual message is obtained by passing @var{string} and @var{args} 2336@code{minibuffer-message-timeout} specifies the number of seconds to
2337through @code{format}. @xref{Formatting Strings}. 2337wait in the absence of input. It defaults to 2. If @var{args} is
2338non-@code{nil}, the actual message is obtained by passing @var{string}
2339and @var{args} through @code{format}. @xref{Formatting Strings}.
2338@end defun 2340@end defun
2341
2342@deffn Command minibuffer-inactive-mode
2343This is the major mode used in inactive minibuffers. It uses
2344keymap @code{minibuffer-inactive-mode-map}. This can be useful
2345if 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>},
561etc.) to be unique. The buffer @var{buffer-or-name} is the buffer to 561etc.) to be unique. The buffer @var{buffer-or-name} is the buffer to
562associate with the process. 562associate with the process.
563 563
564If @var{program} is @code{nil}, Emacs opens a new pseudoterminal (pty)
565and associates its input and output with @var{buffer-or-name}, without
566creating a subprocess. In that case, the remaining arguments
567@var{args} are ignored.
568
564The remaining arguments, @var{args}, are strings that specify command 569The remaining arguments, @var{args}, are strings that specify command
565line arguments for the program. 570line arguments for the subprocess.
566 571
567In the example below, the first process is started and runs (rather, 572In the example below, the first process is started and runs (rather,
568sleeps) for 100 seconds (the output buffer @samp{foo} is created 573sleeps) 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
734This command displays a listing of all living processes. In addition, 738This command displays a listing of all living processes. In addition,
735it finally deletes any process whose status was @samp{Exited} or 739it 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
738The processes are shown in a buffer named @file{*Process List*}, whose 742The processes are shown in a buffer named @file{*Process List*}
739major mode is named Process Menu mode. 743(unless you specify otherwise using the optional argument @var{buffer}),
744whose major mode is Process Menu mode.
740 745
741If @var{query-only} is non-@code{nil} then it lists only processes 746If @var{query-only} is non-@code{nil}, it only lists processes
742whose query flag is non-@code{nil}. @xref{Query Before Exit}. 747whose 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
757This function returns the process named @var{name}, or @code{nil} if 762This function returns the process named @var{name} (a string), or
758there 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
784This function returns information about how a network or serial 789This function returns information about how a network or serial
785process was set up. For a network process, when @var{key} is 790process 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
787specifies what you connected to. For a serial process, when @var{key} 792@code{(@var{port} @var{speed})} for a serial process.
788is @code{nil}, it returns @code{(@var{port} @var{speed})}. For an 793For an ordinary child process, this function always returns @code{t}.
789ordinary child process, this function always returns @code{t}.
790 794
791If @var{key} is @code{t}, the value is the complete status information 795If @var{key} is @code{t}, the value is the complete status information
792for the connection, server, or serial port; that is, the list of 796for 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
795the current status instead of what you specified. 799the current status instead of what you specified.
796 800
797For a network process: 801For 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
834This function returns the name of @var{process}. 839This 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
875x
876 @result{} #<process xx<1>>
877(process-status x)
878 @result{} exit
879@end group
880@end smallexample 879@end smallexample
881 880
882For a network connection, @code{process-status} returns one of the symbols 881For 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}
917This function returns a cons cell describing the coding systems in use 916This function returns a cons cell @code{(@var{decode} . @var{encode})},
918for decoding output from @var{process} and for encoding input to 917describing the coding systems in use for decoding output from, and
919@var{process} (@pxref{Coding Systems}). The value has this form: 918encoding 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
960specify the process to send input to, and the input data to send. The 955specify the process to send input to, and the input data to send. The
961data appears on the ``standard input'' of the subprocess. 956data 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}
965periodically amidst the other characters, to force them through. For 961periodically 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
988This function sends @var{process} the contents of @var{string} as 984This function sends @var{process} the contents of @var{string} as
989standard input. If it is @code{nil}, the current buffer's process is used. 985standard input. It returns @code{nil}. For example, to make a
990 986Shell 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...
1003introduction.texi syntax-tables.texi~
1004introduction.texi~ text.texi
1005introduction.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
1022This function makes @var{process} see an end-of-file in its 1006This function makes @var{process} see an end-of-file in its
1023input. The @acronym{EOF} comes after any text already sent to it. 1007input. The @acronym{EOF} comes after any text already sent to it.
1024
1025The function returns @var{process}. 1008The 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
1052typed @kbd{C-c}, or that some analogous thing has happened. 1035typed @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
1055kill the subprocess, but some stop or resume execution instead. Most 1038kill the subprocess, but some stop (or resume) execution instead. Most
1056signals can optionally be handled by programs; if the program handles 1039signals can optionally be handled by programs; if the program handles
1057the signal, then we can say nothing in general about its effects. 1040the 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:
1061killing a buffer sends a @code{SIGHUP} signal to all its associated 1044killing a buffer sends a @code{SIGHUP} signal to all its associated
1062processes; killing Emacs sends a @code{SIGHUP} signal to all remaining 1045processes; killing Emacs sends a @code{SIGHUP} signal to all remaining
1063processes. (@code{SIGHUP} is a signal that usually indicates that the 1046processes. (@code{SIGHUP} is a signal that usually indicates that the
1064user hung up the phone.) 1047user ``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
1106This function sends the signal @code{SIGQUIT} to the process 1089This 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.
1108character'' (usually @kbd{C-b} or @kbd{C-\}) when you are not inside 1093character'' (usually @kbd{C-b} or @kbd{C-\}) when you are not inside
1109Emacs. 1094Emacs.
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
1131This function sends a signal to process @var{process}. The argument 1116This 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,
1118or a symbol whose name is a signal.
1133 1119
1134The @var{process} argument can be a system process @acronym{ID}; that 1120The @var{process} argument can be a system process @acronym{ID} (an
1135allows you to send signals to processes that are not children of 1121integer); that allows you to send signals to processes that are not
1136Emacs. @xref{System Processes}. 1122children 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
1145its standard output stream. The output can be inserted in a buffer, 1131its standard output stream. The output can be inserted in a buffer,
1146which is called the associated buffer of the process, or a function 1132which is called the associated buffer of the process (@pxref{Process
1147called the @dfn{filter function} can be called to act on the output. If 1133Buffers}), or a function called the @dfn{filter function} can be
1148the process has no buffer and no filter function, its output is 1134called to act on the output. If the process has no buffer and no
1149discarded. 1135filter 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,
1152then stops reading output from that subprocess. Therefore, if the 1138then stops reading output from that subprocess. Therefore, if the
@@ -1154,19 +1140,20 @@ subprocess has children that are still live and still producing
1154output, Emacs won't receive that output. 1140output, 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
1157reading terminal input, in @code{sit-for} and @code{sleep-for} 1143reading terminal input (see the function @code{waiting-for-user-input-p}),
1158(@pxref{Waiting}), and in @code{accept-process-output} (@pxref{Accepting 1144in @code{sit-for} and @code{sleep-for} (@pxref{Waiting}), and in
1159Output}). This minimizes the problem of timing errors that usually 1145@code{accept-process-output} (@pxref{Accepting Output}). This
1160plague parallel programming. For example, you can safely create a 1146minimizes the problem of timing errors that usually plague parallel
1161process and only then specify its buffer or filter function; no output 1147programming. For example, you can safely create a process and only
1162can arrive before you finish, if the code in between does not call any 1148then specify its buffer or filter function; no output can arrive
1163primitive that waits. 1149before you finish, if the code in between does not call any primitive
1150that waits.
1164 1151
1165@defvar process-adaptive-read-buffering 1152@defvar process-adaptive-read-buffering
1166On some systems, when Emacs reads the output from a subprocess, the 1153On some systems, when Emacs reads the output from a subprocess, the
1167output data is read in very small blocks, potentially resulting in 1154output data is read in very small blocks, potentially resulting in
1168very poor performance. This behavior can be remedied to some extent 1155very poor performance. This behavior can be remedied to some extent
1169by setting the variable @var{process-adaptive-read-buffering} to a 1156by setting the variable @code{process-adaptive-read-buffering} to a
1170non-@code{nil} value (the default), as it will automatically delay reading 1157non-@code{nil} value (the default), as it will automatically delay reading
1171from such processes, thus allowing them to produce more output before 1158from such processes, thus allowing them to produce more output before
1172Emacs tries to read it. 1159Emacs tries to read it.
@@ -1235,9 +1222,9 @@ to insert, and updates it to point after the inserted text. That is why
1235successive batches of output are inserted consecutively. 1222successive batches of output are inserted consecutively.
1236 1223
1237Filter functions normally should use this marker in the same fashion 1224Filter functions normally should use this marker in the same fashion
1238as is done by direct insertion of output in the buffer. A good 1225as is done by direct insertion of output in the buffer. For an
1239example of a filter function that uses @code{process-mark} is found at 1226example of a filter function that uses @code{process-mark},
1240the end of the following section. 1227@pxref{Process Filter Example}.
1241 1228
1242When the user is expected to enter input in the process buffer for 1229When the user is expected to enter input in the process buffer for
1243transmission to the process, the process marker separates the new input 1230transmission 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
1287something, because process output arrives only at such times. Emacs 1274something, because process output arrives only at such times. Emacs
1288waits when reading terminal input, in @code{sit-for} and 1275waits 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
1293and a string, which is output just received from it. The function is 1281and a string, which is output just received from it. The function is
1294then free to do whatever it chooses with the output. 1282then 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,
1297the effect of typing @kbd{C-g} at command level or to quit a user 1286the effect of typing @kbd{C-g} at command level or to quit a user
1298command would be unpredictable. If you want to permit quitting inside 1287command 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
1304caught automatically, so that it doesn't stop the execution of whatever 1293caught automatically, so that it doesn't stop the execution of whatever
1305program was running when the filter function was started. However, if 1294program 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.
1307off. This makes it possible to use the Lisp debugger to debug the 1296This makes it possible to use the Lisp debugger to debug the
1308filter function. @xref{Debugger}. 1297filter 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
1311process's buffer, mimicking the actions of Emacs when there is no 1300process's buffer, mimicking the actions of Emacs when there is no
1312filter. Such filter functions need to use @code{set-buffer} in order to 1301filter. Such filter functions need to make sure that they save the
1313be sure to insert in that buffer. To avoid setting the current buffer 1302current buffer, select the correct buffer (if different) before
1314semipermanently, these filter functions must save and restore the 1303inserting output, and then restore the original buffer.
1315current buffer. They should also check whether the buffer is still 1304They should also check whether the buffer is still alive, update the
1316alive, update the process marker, and in some cases update the value 1305process marker, and in some cases update the value of point. Here is
1317of point. Here is how to do these things: 1306how 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
1337The reason to use @code{with-current-buffer}, rather than using
1338@code{save-excursion} to save and restore the current buffer, is so as
1339to 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
1343text arrives, insert the following line just before the 1327text 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
1351previously, eliminate the variable @code{moving} and call 1335previously, 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
1355expression searching or matching had to explicitly save and restore the 1340expression searching or matching had to explicitly save and restore the
1356match data. Now Emacs does this automatically for filter functions; 1341match data. Now Emacs does this automatically for filter functions;
1357they never need to do it explicitly. @xref{Match Data}. 1342they never need to do it explicitly.
1343@end ignore
1344 Note that Emacs automatically saves and restores the match data
1345while 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
1360that produces the same output twice in a row may send it as one batch of 1348that produces the same output twice in a row may send it as one batch of
1361200 characters one time, and five batches of 40 characters the next. If 1349200 characters one time, and five batches of 40 characters the next. If
1362the filter looks for certain text strings in the subprocess output, make 1350the 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}
1374if it has none. 1362if 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
1396kept 1384kept
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
1451control this behavior. 1439control this behavior.
1452 1440
1453 @strong{Warning:} Coding systems such as @code{undecided} which 1441 @strong{Warning:} Coding systems such as @code{undecided}, which
1454determine the coding system from the data do not work entirely 1442determine the coding system from the data, do not work entirely
1455reliably with asynchronous subprocess output. This is because Emacs 1443reliably with asynchronous subprocess output. This is because Emacs
1456has to process asynchronous subprocess output in batches, as it 1444has to process asynchronous subprocess output in batches, as it
1457arrives. Emacs must try to detect the proper coding system from one 1445arrives. 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
1469process's filter coding system. Emacs 1457process's filter coding system. Emacs
1470decodes the output according to the process output coding system, 1458decodes the output according to the process output coding system,
1471which usually produces a multibyte string, except for coding systems 1459which usually produces a multibyte string, except for coding systems
1472such as @code{binary} and @code{raw-text} 1460such 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
1487functions. If @var{process} is non-@code{nil} then this function does 1475functions. If @var{process} is non-@code{nil} then this function does
1488not return until some output has been received from @var{process}. 1476not return until some output has been received from @var{process}.
1489 1477
1490@c Emacs 19 feature
1491The arguments @var{seconds} and @var{millisec} let you specify timeout 1478The arguments @var{seconds} and @var{millisec} let you specify timeout
1492periods. The former specifies a period measured in seconds and the 1479periods. The former specifies a period measured in seconds and the
1493latter specifies one measured in milliseconds. The two time periods 1480latter specifies one measured in milliseconds. The two time periods
@@ -1495,10 +1482,10 @@ thus specified are added together, and @code{accept-process-output}
1495returns after that much time, whether or not there has been any 1482returns after that much time, whether or not there has been any
1496subprocess output. 1483subprocess output.
1497 1484
1498The argument @var{millisec} is semi-obsolete nowadays because 1485The argument @var{millisec} is obsolete (and should not be used),
1499@var{seconds} can be a floating point number to specify waiting a 1486because @var{seconds} can be a floating point number to specify
1500fractional number of seconds. If @var{seconds} is 0, the function 1487waiting a fractional number of seconds. If @var{seconds} is 0, the
1501accepts whatever output is pending but does not wait. 1488function accepts whatever output is pending but does not wait.
1502 1489
1503@c Emacs 22.1 feature 1490@c Emacs 22.1 feature
1504If @var{process} is a process, and the argument @var{just-this-one} is 1491If @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
1547input, or for time to elapse, or for process output). This avoids the 1535input, or for time to elapse, or for process output). This avoids the
1548timing errors that could result from running them at random places in 1536timing errors that could result from running sentinels at random places in
1549the middle of other Lisp programs. A program can wait, so that 1537the middle of other Lisp programs. A program can wait, so that
1550sentinels will run, by calling @code{sit-for} or @code{sleep-for} 1538sentinels 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
1569into a dead buffer, it will get an error. If the buffer is dead, 1557into 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
1573effect of typing @kbd{C-g} at command level or to quit a user command 1562effect of typing @kbd{C-g} at command level or to quit a user command
1574would be unpredictable. If you want to permit quitting inside a 1563would 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
1580automatically, so that it doesn't stop the execution of whatever 1569automatically, so that it doesn't stop the execution of whatever
1581programs was running when the sentinel was started. However, if 1570programs 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.
1583off. This makes it possible to use the Lisp debugger to debug the 1572This makes it possible to use the Lisp debugger to debug the
1584sentinel. @xref{Debugger}. 1573sentinel. @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.
1588For this reason it is not possible for a sentinel to specify 1577For this reason it is not possible for a sentinel to specify
1589a new sentinel. 1578a 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
1592searching or matching had to explicitly save and restore the match data. 1582searching or matching had to explicitly save and restore the match data.
1593Now Emacs does this automatically for sentinels; they never need to do 1583Now Emacs does this automatically for sentinels; they never need to do
1594it explicitly. @xref{Match Data}. 1584it explicitly.
1585@end ignore
1586 Note that Emacs automatically saves and restores the match data
1587while executing sentinels. @xref{Match Data}.
1595 1588
1596@defun set-process-sentinel process sentinel 1589@defun set-process-sentinel process sentinel
1597This function associates @var{sentinel} with @var{process}. If 1590This function associates @var{sentinel} with @var{process}. If
@@ -1599,7 +1592,7 @@ This function associates @var{sentinel} with @var{process}. If
1599The default behavior when there is no sentinel is to insert a message in 1592The default behavior when there is no sentinel is to insert a message in
1600the process's buffer when the process status changes. 1593the process's buffer when the process status changes.
1601 1594
1602Changes in process sentinel take effect immediately---if the sentinel 1595Changes in process sentinels take effect immediately---if the sentinel
1603is slated to be run but has not been called yet, and you specify a new 1596is slated to be run but has not been called yet, and you specify a new
1604sentinel, the eventual call to the sentinel will use the new one. 1597sentinel, 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
1628While a sentinel or filter function is running, this function returns 1621While a sentinel or filter function is running, this function returns
1629non-@code{nil} if Emacs was waiting for keyboard input from the user at 1622non-@code{nil} if Emacs was waiting for keyboard input from the user at
1630the time the sentinel or filter function was called, @code{nil} if it 1623the time the sentinel or filter function was called, or @code{nil} if it
1631was not. 1624was 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
1638the @code{SIGHUP} signal. Because subprocesses may be doing 1631the @code{SIGHUP} signal. Because subprocesses may be doing
1639valuable work, Emacs normally asks the user to confirm that it is ok 1632valuable work, Emacs normally asks the user to confirm that it is ok
1640to terminate them. Each process has a query flag which, if 1633to terminate them. Each process has a query flag, which, if
1641non-@code{nil}, says that Emacs should ask for confirmation before 1634non-@code{nil}, says that Emacs should ask for confirmation before
1642exiting and thus killing that process. The default for the query flag 1635exiting and thus killing that process. The default for the query flag
1643is @code{t}, meaning @emph{do} query. 1636is @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
1669subprocesses of the current Emacs session, Emacs Lisp programs can 1662subprocesses of the current Emacs session, Emacs Lisp programs can
1670also access other processes running on the same machine. We call 1663also access other processes running on the same machine. We call
1671these @dfn{system processes}, to distinguish between them and Emacs 1664these @dfn{system processes}, to distinguish them from Emacs
1672subprocesses. 1665subprocesses.
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
1688by its process ID @var{pid}. Each association in the alist is of the 1681by its process ID @var{pid}. Each association in the alist is of the
1689form @code{(@var{key} . @var{value})}, where @var{key} designates the 1682form @code{(@var{key} . @var{value})}, where @var{key} designates the
1690attribute and @var{value} is the value of that attribute. The various 1683attribute and @var{value} is the value of that attribute. The various
1691attribute @var{key}'s that this function can return are listed below. 1684attribute @var{key}s that this function can return are listed below.
1692Not all platforms support all of these attributes; if an attribute is 1685Not all platforms support all of these attributes; if an attribute is
1693not supported, its association will not appear in the returned alist. 1686not supported, its association will not appear in the returned alist.
1694Values that are numbers can be either integer or floating-point, 1687Values 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?
1852You can use a @dfn{transaction queue} to communicate with a subprocess 1847You can use a @dfn{transaction queue} to communicate with a subprocess
1853using transactions. First use @code{tq-create} to create a transaction 1848using transactions. First use @code{tq-create} to create a transaction
1854queue communicating with a specified process. Then you can call 1849queue 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
1878If the argument @var{delay-question} is non-@code{nil}, delay sending 1873If the argument @var{delay-question} is non-@code{nil}, delay sending
1879this question until the process has finished replying to any previous 1874this question until the process has finished replying to any previous
1880questions. This produces more reliable results with some processes. 1875questions. This produces more reliable results with some processes.
1876@ignore
1881 1877
1878@c Let's not mention it then.
1882The return value of @code{tq-enqueue} itself is not meaningful. 1879The 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
1900connections to other processes on the same machine or other machines. 1898connections (@pxref{Datagrams}) to other processes on the same machine
1899or other machines.
1901A network connection is handled by Lisp much like a subprocess, and is 1900A network connection is handled by Lisp much like a subprocess, and is
1902represented by a process object. However, the process you are 1901represented by a process object. However, the process you are
1903communicating with is not a child of the Emacs process, so it has no 1902communicating with is not a child of the Emacs process, has no
1904process @acronym{ID}, and you can't kill it or send it signals. All you 1903process @acronym{ID}, and you can't kill it or send it signals. All you
1905can do is send and receive data. @code{delete-process} closes the 1904can do is send and receive data. @code{delete-process} closes the
1906connection, but does not kill the program at the other end; that 1905connection, 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
1928connection, or @code{real} for a real subprocess. 1927connection, 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
1932connections. For a network server, the status is always 1931connections. 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
1934subprocess. @xref{Process Information}. 1933subprocess. @xref{Process Information}.
@@ -1938,35 +1937,48 @@ subprocess. @xref{Process Information}.
1938process, being stopped means not accepting new connections. (Up to 5 1937process, being stopped means not accepting new connections. (Up to 5
1939connection requests will be queued for when you resume the server; you 1938connection requests will be queued for when you resume the server; you
1940can increase this limit, unless it is imposed by the operating 1939can increase this limit, unless it is imposed by the operating
1941system.) For a network stream connection, being stopped means not 1940system---see the @code{:server} keyword of @code{make-network-process},
1942processing input (any arriving input waits until you resume the 1941@ref{Network Processes}.) For a network stream connection, being
1943connection). For a datagram connection, some number of packets may be 1942stopped means not processing input (any arriving input waits until you
1944queued but input may be lost. You can use the function 1943resume the connection). For a datagram connection, some number of
1944packets 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
1946server is stopped; a non-@code{nil} value means yes. 1946server 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 1952Emacs can create encrypted network connections, using either built-in
1953or 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}.
1956If your Emacs was compiled with GnuTLS support, the function
1957@code{gnutls-available-p} is defined and returns non-@code{nil}. For
1958more details, @pxref{Top,, Overview, emacs-gnutls, The Emacs-GnuTLS manual}.
1959The external support uses the @file{starttls.el} library, which
1960requires a helper utility such as @command{gnutls-cli} to be installed
1961on the system. The @code{open-network-stream} function can
1962transparently handle the details of creating encrypted connections for
1963you, using whatever support is available.
1964
1965@defun open-network-stream name buffer host service &rest parameters
1953This function opens a TCP connection, with optional encryption, and 1966This function opens a TCP connection, with optional encryption, and
1954returns a process object that represents the connection. 1967returns a process object that represents the connection.
1955 1968
1956The @var{name} argument specifies the name for the process object. It 1969The @var{name} argument specifies the name for the process object. It
1957is modified as necessary to make it unique. 1970is modified as necessary to make it unique.
1958 1971
1959The @var{buffer-or-name} argument is the buffer to associate with the 1972The @var{buffer} argument is the buffer to associate with the
1960connection. Output from the connection is inserted in the buffer, 1973connection. Output from the connection is inserted in the buffer,
1961unless you specify a filter function to handle the output. If 1974unless 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
1963associated with any buffer. 1976associated with any buffer.
1964 1977
1965The arguments @var{host} and @var{service} specify where to connect to; 1978The 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
1967a defined network service (a string) or a port number (an integer). 1980a defined network service (a string) or a port number (an integer).
1968 1981
1969@c FIXME? Is this too lengthy for the printed manual?
1970The remaining arguments @var{parameters} are keyword/argument pairs 1982The remaining arguments @var{parameters} are keyword/argument pairs
1971that are mainly relevant to encrypted connections: 1983that are mainly relevant to encrypted connections:
1972 1984
@@ -1983,14 +1995,15 @@ The type of connection. Options are:
1983An ordinary, unencrypted connection. 1995An ordinary, unencrypted connection.
1984@item tls 1996@item tls
1985@itemx ssl 1997@itemx ssl
1986A TLS (``Transport Layer Security'') connection. 1998A @acronym{TLS} (``Transport Layer Security'') connection.
1987@item nil 1999@item nil
1988@itemx network 2000@itemx network
1989Start with a plain connection, and if parameters @samp{:success} 2001Start with a plain connection, and if parameters @samp{:success}
1990and @samp{:capability-command} are supplied, try to upgrade to an encrypted 2002and @samp{:capability-command} are supplied, try to upgrade to an encrypted
1991connection via STARTTLS. If that fails, retain the unencrypted connection. 2003connection via @acronym{STARTTLS}. If that fails, retain the
2004unencrypted connection.
1992@item starttls 2005@item starttls
1993As for @code{nil}, but if STARTTLS fails drop the connection. 2006As for @code{nil}, but if @acronym{STARTTLS} fails drop the connection.
1994@item shell 2007@item shell
1995A shell connection. 2008A 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}
2011Function of one argument (the response to @var{capability-command}), 2024Function of one argument (the response to @var{capability-command}),
2012which returns either @code{nil}, or the command to activate STARTTLS 2025which returns either @code{nil}, or the command to activate @acronym{STARTTLS}
2013if supported. 2026if supported.
2014 2027
2015@item :success @var{regexp} 2028@item :success @var{regexp}
2016Regular expression matching a successful STARTTLS negotiation. 2029Regular 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}
2019If non-@code{nil}, do opportunistic STARTTLS upgrades even if Emacs 2032If non-@code{nil}, do opportunistic @acronym{STARTTLS} upgrades even if Emacs
2020doesn't have built-in TLS support. 2033doesn'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}
2023Either a list of the form @code{(@var{key-file} @var{cert-file})}, 2036Either a list of the form @code{(@var{key-file} @var{cert-file})},
2024naming the certificate key file and certificate file itself, or 2037naming 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}).
2027Only used for TLS or STARTTLS. 2040Only 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}
2030The return value of this function. If omitted or @code{nil}, return a 2043The 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
2053clients. When it accepts a client connection request, that creates a 2066listen for connection requests from clients. When it accepts a client
2054new network connection, itself a process object, with the following 2067connection request, that creates a new network connection, itself a
2055parameters: 2068process object, with the following parameters:
2056 2069
2057@itemize @bullet 2070@itemize @bullet
2058@item 2071@item
2059The connection's process name is constructed by concatenating the 2072The connection's process name is constructed by concatenating the
2060server process's @var{name} with a client identification string. The 2073server process's @var{name} with a client identification string. The
2074@c FIXME? What about IPv6? Say briefly what the difference is?
2061client identification string for an IPv4 connection looks like 2075client 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
2077address and port number. Otherwise, it is a
2063unique number in brackets, as in @samp{<@var{nnn}>}. The number 2078unique number in brackets, as in @samp{<@var{nnn}>}. The number
2064is unique for each connection in the Emacs session. 2079is 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
2080connections made to the server. 2095connections made to the server.
2081 2096
2082@item 2097@item
2083The connection's process contact info is set according to the client's 2098The connection's process contact information is set according to the client's
2084addressing information (typically an IP address and a port number). 2099addressing information (typically an IP address and a port number).
2085This information is associated with the @code{process-contact} 2100This information is associated with the @code{process-contact}
2086keywords @code{:host}, @code{:service}, @code{:remote}. 2101keywords @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
2101than streams of data. Each call to @code{process-send} sends one 2116than streams of data. Each call to @code{process-send} sends one
2102datagram packet (@pxref{Input to Processes}), and each datagram 2117datagram packet (@pxref{Input to Processes}), and each datagram
2103received results in one call to the filter function. 2118received results in one call to the filter function.
@@ -2150,7 +2165,8 @@ process object that represents it. The arguments @var{args} are a
2150list of keyword/argument pairs. Omitting a keyword is always 2165list of keyword/argument pairs. Omitting a keyword is always
2151equivalent to specifying it with value @code{nil}, except for 2166equivalent 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
2153are the meaningful keywords: 2168are the meaningful keywords (those corresponding to network options
2169are 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}
2167If @var{server-flag} is non-@code{nil}, create a server. Otherwise, 2183If @var{server-flag} is non-@code{nil}, create a server. Otherwise,
2168create a connection. For a stream type server, @var{server-flag} may 2184create a connection. For a stream type server, @var{server-flag} may
2169be an integer which then specifies the length of the queue of pending 2185be an integer, which then specifies the length of the queue of pending
2170connections to the server. The default queue length is 5. 2186connections 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
2177connecting to that address will be accepted. 2193connecting 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,
2181the port number to listen on. It should be a service name that 2197the port number to listen on. It should be a service name that
2182translates to a port number, or an integer specifying the port number 2198translates to a port number, or an integer specifying the port number
2183directly. For a server, it can also be @code{t}, which means to let 2199directly. For a server, it can also be @code{t}, which means to let
@@ -2188,18 +2204,18 @@ the system select an unused port number.
2188communication. @code{nil} means determine the proper address family 2204communication. @code{nil} means determine the proper address family
2189automatically for the given @var{host} and @var{service}. 2205automatically 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
2191ignored. @code{ipv4} and @code{ipv6} specify to use IPv4 and IPv6 2207ignored. @code{ipv4} and @code{ipv6} specify to use IPv4 and IPv6,
2192respectively. 2208respectively.
2193 2209
2194@item :local @var{local-address} 2210@item :local @var{local-address}
2195For a server process, @var{local-address} is the address to listen on. 2211For a server process, @var{local-address} is the address to listen on.
2196It overrides @var{family}, @var{host} and @var{service}, and you 2212It overrides @var{family}, @var{host} and @var{service}, so you
2197may as well not specify them. 2213might as well not specify them.
2198 2214
2199@item :remote @var{remote-address} 2215@item :remote @var{remote-address}
2200For a connection, @var{remote-address} is the address to connect to. 2216For a connection, @var{remote-address} is the address to connect to.
2201It overrides @var{family}, @var{host} and @var{service}, and you 2217It overrides @var{family}, @var{host} and @var{service}, so you
2202may as well not specify them. 2218might as well not specify them.
2203 2219
2204For a datagram server, @var{remote-address} specifies the initial 2220For a datagram server, @var{remote-address} specifies the initial
2205setting of the remote datagram address. 2221setting of the remote datagram address.
@@ -2223,7 +2239,7 @@ integers @code{[@var{a} @var{b} @var{c} @var{d} @var{e} @var{f}
2223port number @var{p}. 2239port number @var{p}.
2224 2240
2225@item 2241@item
2226A local address is represented as a string which specifies the address 2242A local address is represented as a string, which specifies the address
2227in the local address space. 2243in the local address space.
2228 2244
2229@item 2245@item
@@ -2245,8 +2261,8 @@ second argument matching @code{"open"} (if successful) or
2245has succeeded or failed. 2261has succeeded or failed.
2246 2262
2247@item :stop @var{stopped} 2263@item :stop @var{stopped}
2248Start the network connection or server in the `stopped' state if 2264If @var{stopped} is non-@code{nil}, start the network connection or
2249@var{stopped} is non-@code{nil}. 2265server in the ``stopped'' state.
2250 2266
2251@item :buffer @var{buffer} 2267@item :buffer @var{buffer}
2252Use @var{buffer} as the process buffer. 2268Use @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}
2268Initialize the process filter to @var{filter}. 2284Initialize the process filter to @var{filter}.
2269 2285
2286@item :filter-multibyte @var{multibyte}
2287If @var{multibyte} is non-@code{nil}, strings given to the process
2288filter are multibyte, otherwise they are unibyte. The default is the
2289default value of @code{enable-multibyte-characters}.
2290
2270@item :sentinel @var{sentinel} 2291@item :sentinel @var{sentinel}
2271Initialize the process sentinel to @var{sentinel}. 2292Initialize the process sentinel to @var{sentinel}.
2272 2293
@@ -2274,7 +2295,7 @@ Initialize the process sentinel to @var{sentinel}.
2274Initialize the log function of a server process to @var{log}. The log 2295Initialize the log function of a server process to @var{log}. The log
2275function is called each time the server accepts a network connection 2296function is called each time the server accepts a network connection
2276from a client. The arguments passed to the log function are 2297from 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}
2278is the server process, @var{connection} is the new process for the 2299is the server process, @var{connection} is the new process for the
2279connection, and @var{message} is a string describing what has 2300connection, and @var{message} is a string describing what has
2280happened. 2301happened.
@@ -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}
2312If @var{broadcast-flag} is non-@code{nil} for a datagram process, the 2333If @var{broadcast-flag} is non-@code{nil} for a datagram process, the
2313process will receive datagram packet sent to a broadcast address, and 2334process will receive datagram packet sent to a broadcast address, and
2314be able to send packets to a broadcast address. Ignored for a stream 2335be able to send packets to a broadcast address. This is ignored for a stream
2315connection. 2336connection.
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
2327transmission of all queued packets on the connection before it is 2348transmission of all queued packets on the connection before it is
2328deleted (see @code{delete-process}). If @var{linger-arg} is an 2349deleted (see @code{delete-process}). If @var{linger-arg} is an
2329integer, it specifies the maximum time in seconds to wait for queued 2350integer, it specifies the maximum time in seconds to wait for queued
2330packets to be sent before closing the connection. Default is 2351packets 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
2332process is deleted. 2353process 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}
2335If @var{oobinline-flag} is non-@code{nil} for a stream connection, 2357If @var{oobinline-flag} is non-@code{nil} for a stream connection,
2336receive out-of-band data in the normal data stream. Otherwise, ignore 2358receive 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}
2340Set the priority for packets sent on this connection to the integer 2362Set 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
2342specific, such as setting the TOS (type of service) field on IP 2364specific; such as setting the TOS (type of service) field on IP
2343packets sent on this connection. It may also have system dependent 2365packets sent on this connection. It may also have system dependent
2344effects, such as selecting a specific output queue on the network 2366effects, such as selecting a specific output queue on the network
2345interface. 2367interface.
@@ -2347,20 +2369,20 @@ interface.
2347@item :reuseaddr @var{reuseaddr-flag} 2369@item :reuseaddr @var{reuseaddr-flag}
2348If @var{reuseaddr-flag} is non-@code{nil} (the default) for a stream 2370If @var{reuseaddr-flag} is non-@code{nil} (the default) for a stream
2349server process, allow this server to reuse a specific port number (see 2371server 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
2351listening on that port. If @var{reuseaddr-flag} is @code{nil}, there 2373listening on that port. If @var{reuseaddr-flag} is @code{nil}, there
2352may be a period of time after the last use of that port (by any 2374may be a period of time after the last use of that port (by any
2353process on the host), where it is not possible to make a new server on 2375process on the host) where it is not possible to make a new server on
2354that port. 2376that 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
2358This function sets or modifies a network option for network process 2380This 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} 2383this function returns @code{nil} instead of signaling an error if
2362instead of signaling an error if @var{option} is not a supported 2384@var{option} is not a supported option. If the function successfully
2363option. If the function successfully completes, it returns @code{t}. 2385completes, it returns @code{t}.
2364 2386
2365The current setting of an option is available via the 2387The 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
2380The result of the first form is @code{t} if it works to specify 2402The 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}.
2382The result of the second form is @code{t} if @var{keyword} is 2404Here are some of the @var{keyword}---@var{value} pairs you can test in
2383supported by @code{make-network-process}. Here are some of the
2384@var{keyword}---@var{value} pairs you can test in
2385this way. 2405this 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
2408Here are some of the options you can test in this way. 2428The accepted @var{keyword} values are @code{:bindtodevice}, etc.
2409 2429For the complete list, @pxref{Network Options}. This form returns
2410@table @code 2430non-@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
2419That 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
2490terminal window created by @code{serial-term}, you can click on the 2500terminal window created by @code{serial-term}, you can click on the
2491mode line for configuration. 2501mode 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
2494used similar to a subprocess or network process. You can send and 2504used in a similar way to a subprocess or network process. You can send and
2495receive data and configure the serial port. A serial process object 2505receive data, and configure the serial port. A serial process object
2496has no process ID, you can't send signals to it, and the status codes 2506has no process ID, however, and you can't send signals to it, and the
2497are different from other types of processes. 2507status 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
2499the process buffer close the connection, but this does not affect the 2509the process buffer close the connection, but this does not affect the
2500device connected to the serial port. 2510device 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}
2503for a process object representing a serial port connection. 2513for 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
2508Start a terminal-emulator for a serial port in a new buffer. 2518Start 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
2510example, this could be @file{/dev/ttyS0} on Unix. On Windows, this 2520example, this could be @file{/dev/ttyS0} on Unix. On MS Windows, this
2511could be @file{COM1}, or @file{\\.\COM10} (double the backslashes in 2521could be @file{COM1}, or @file{\\.\COM10} (double the backslashes in
2512Lisp strings). 2522Lisp 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
2515is a common value. The buffer is in Term mode; see @ref{Term Mode,,, 2527is a common value. The buffer is in Term mode; see @ref{Term Mode,,,
2516emacs, The GNU Emacs Manual}, for the commands to use in that buffer. 2528emacs, 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
2521This function creates a process and a buffer. Arguments are specified 2533This function creates a process and a buffer. Arguments are specified
2522as keyword/argument pairs. Here's the list of the meaningful keywords: 2534as keyword/argument pairs. Here's the list of the meaningful
2535keywords, 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}
2526This is the name of the serial port. On Unix and GNU systems, this is 2539This is the name of the serial port. On Unix and GNU systems, this is
2527a file name such as @file{/dev/ttyS0}. On Windows, this could be 2540a 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}
2532The speed of the serial port in bits per second. This function calls 2545The 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
2547following documentation of that function for more details.
2534 2548
2535@item :name @var{name} 2549@item :name @var{name}
2536The name of the process. If @var{name} is not given, @var{port} will 2550The name of the process. If @var{name} is not given, @var{port} will
2537serve as the process name as well. 2551serve as the process name as well.
2538 2552
2539@item :buffer @var{buffer} 2553@item :buffer @var{buffer}
2540The buffer to associate with the process. The value could be either a 2554The buffer to associate with the process. The value can be either a
2541buffer or a string that names a buffer. Process output goes at the 2555buffer or a string that names a buffer. Process output goes at the
2542end of that buffer, unless you specify an output stream or filter 2556end of that buffer, unless you specify an output stream or filter
2543function to handle the output. If @var{buffer} is not given, the 2557function 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}
2548If @var{coding} is a symbol, it specifies the coding system used for 2562If @var{coding} is a symbol, it specifies the coding system used for
2549both reading and writing for this process. If @var{coding} is a cons 2563both 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 2565reading, and @var{encoding} is used for writing. If not specified,
2552to determine the coding systems from data itself. 2566the 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}
2555Initialize the process query flag to @var{query-flag}. @xref{Query 2569Initialize the process query flag to @var{query-flag}. @xref{Query
2556Before Exit}. The flags defaults to @code{nil} if unspecified. 2570Before Exit}. The flags defaults to @code{nil} if unspecified.
2557 2571
2558@item :stop @var{bool} 2572@item :stop @var{bool}
2559Start process in the @code{stopped} state if @var{bool} is 2573Start process in the ``stopped'' state if @var{bool} is
2560non-@code{nil}. In the stopped state, a serial process does not 2574non-@code{nil}. In the stopped state, a serial process does not
2561accept incoming data, but you can send outgoing data. The stopped 2575accept incoming data, but you can send outgoing data. The stopped
2562state is cleared by @code{continue-process} and set by 2576state 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}
2572Install @var{plist} as the initial plist of the process. 2586Install @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:
2600This functions configures a serial port connection. Arguments are 2613This functions configures a serial port connection. Arguments are
2601specified as keyword/argument pairs. Attributes that are not given 2614specified as keyword/argument pairs. Attributes that are not given
2602are re-initialized from the process's current configuration (available 2615are re-initialized from the process's current configuration (available
2603via the function @code{process-contact}) or set to reasonable default 2616via the function @code{process-contact}), or set to reasonable default
2604values. The following arguments are defined: 2617values. 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
2618at a few defined values between 1200 and 115200, with 9600 being the 2631at a few defined values between 1200 and 115200, with 9600 being the
2619most common value. If @var{speed} is @code{nil}, the function ignores 2632most common value. If @var{speed} is @code{nil}, the function ignores
2620all other arguments and does not configure the port. This may be 2633all other arguments and does not configure the port. This may be
2621useful for special serial ports such as Bluetooth-to-serial converters 2634useful for special serial ports such as Bluetooth-to-serial converters,
2622which can only be configured through AT commands sent through the 2635which can only be configured through @samp{AT} commands sent through the
2623connection. The value of @code{nil} for @var{speed} is valid only for 2636connection. The value of @code{nil} for @var{speed} is valid only for
2624connections that were already opened by a previous call to 2637connections 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
2646flow control. 2659flow control.
2647@end table 2660@end table
2648 2661
2649@code{serial-process-configure} is called by 2662Internally, @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
2651port. 2664serial 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,
2659usually for binary network protocols. These functions convert byte arrays 2672usually for binary network protocols. These functions convert byte arrays
2660to alists, and vice versa. The byte array can be represented as a 2673to alists, and vice versa. The byte array can be represented as a
2674@c FIXME? No multibyte?
2661unibyte string or as a vector of integers, while the alist associates 2675unibyte string or as a vector of integers, while the alist associates
2662symbols either with fixed-size objects or with recursive sub-alists. 2676symbols either with fixed-size objects or with recursive sub-alists.
2677To 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
2682specification}, a special nested list describing named and typed 2699specification}, 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
2684processed, and how to pack or unpack it. We normally keep bindat specs 2701processed, and how to pack or unpack it. We normally keep bindat specs
2685in variables whose names end in @samp{-bindat-spec}; that kind of name 2702in variables whose names end in @samp{-bindat-spec}; that kind of name
2686is automatically recognized as ``risky''. 2703is automatically recognized as ``risky''.
@@ -2729,12 +2746,12 @@ String of length @var{len}.
2729Zero-terminated string, in a fixed-size field with length @var{len}. 2746Zero-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}]
2732Vector of @var{len} elements of type @var{type}, or bytes if not 2749Vector of @var{len} elements of type @var{type}, defaulting to bytes.
2733@var{type} is specified.
2734The @var{type} is any of the simple types above, or another vector 2750The @var{type} is any of the simple types above, or another vector
2735specified as a list @code{(vec @var{len} [@var{type}])}. 2751specified as a list of the form @code{(vec @var{len} [@var{type}])}.
2736 2752
2737@item ip 2753@item ip
2754@c FIXME? IPv6?
2738Four-byte vector representing an Internet address. For example: 2755Four-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}
2762should evaluate to an integer, specifying the field length. 2779should evaluate to an integer, specifying the field length.
2763 2780
2764A field specification generally has the form @code{([@var{name}] 2781A 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
2766optional. (Don't use names that are symbols meaningful as type 2783are symbols meaningful as type specifications (above) or handler
2767specifications (above) or handler specifications (below), since that 2784specifications (below), since that would be ambiguous. @var{name} can
2768would be ambiguous.) @var{name} can be a symbol or the expression 2785be 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.
2770a 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
2773of the following: 2789of 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{}
2816Process the @var{field-specs} recursively, in order, then repeat 2832Process the @var{field-specs} recursively, in order, then repeat
2817starting from the first one, processing all the specs @var{count} 2833starting from the first one, processing all the specifications @var{count}
2818times overall. The @var{count} is given using the same formats as a 2834times overall. The @var{count} is given using the same formats as a
2819field length---if an @code{eval} form is used, it is evaluated just once. 2835field length---if an @code{eval} form is used, it is evaluated just once.
2820For correct operation, each spec in @var{field-specs} must include a name. 2836For correct operation, each specification in @var{field-specs} must
2837include a name.
2821@end table 2838@end table
2822 2839
2823For the @code{(eval @var{form})} forms used in a bindat specification, 2840For 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
2856alist representing unpacked field data. 2873alist 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?
2859This function unpacks data from the unibyte string or byte 2877This function unpacks data from the unibyte string or byte
2860array @code{bindat-raw} 2878array @code{bindat-raw}
2861according to @var{spec}. Normally this starts unpacking at the 2879according to @var{spec}. Normally, this starts unpacking at the
2862beginning of the byte array, but if @var{bindat-idx} is non-@code{nil}, it 2880beginning of the byte array, but if @var{bindat-idx} is non-@code{nil}, it
2863specifies a zero-based starting position to use instead. 2881specifies 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
2896This function returns a byte array packed according to @var{spec} from 2914This function returns a byte array packed according to @var{spec} from
2897the data in the alist @var{struct}. Normally it creates and fills a 2915the data in the alist @var{struct}. It normally creates and fills a
2898new byte array starting at the beginning. However, if @var{bindat-raw} 2916new byte array starting at the beginning. However, if @var{bindat-raw}
2899is non-@code{nil}, it specifies a pre-allocated unibyte string or vector to 2917is non-@code{nil}, it specifies a pre-allocated unibyte string or vector to
2900pack into. If @var{bindat-idx} is non-@code{nil}, it specifies the starting 2918pack 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
2908Convert the Internet address vector @var{ip} to a string in the usual 2926Convert the Internet address vector @var{ip} to a string in the usual
2909dotted notation. 2927dotted 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.
2937Optional second arg INDEX specifies the associated index 2961Optional second arg INDEX specifies the associated index
2938filename, which is by default constructed by appending 2962filename, by default \"COOKIES.dat\". Display cookie text
2939\".dat\" to COOKIES. Display cookie text in possibly 2963in buffer \"*Fortune Cookie: BASENAME*\", where BASENAME
2940new buffer \"*Fortune Cookie: BASENAME*\" where BASENAME
2941is COOKIES without the directory part." 2964is 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.
2963Optional second arg INDEX specifies the index filename, 2986Optional arg INDEX specifies the index filename, which by
2964which is by default constructed by appending \".dat\" to 2987default is \"COOKIES.dat\". Optional arg DELIM specifies the
2965COOKIES. Optional third arg DELIM specifies the unibyte 2988unibyte character that, when found on a line of its own in
2966character which, when found on a line of its own in
2967COOKIES, indicates the border between entries." 2989COOKIES, 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
3003Following is an example of defining and unpacking a complex structure. 3025The following is an example of defining and unpacking a complex
3004Consider the following C structures: 3026structure. Consider the following C structures:
3005 3027
3006@example 3028@example
3007struct header @{ 3029struct header @{
@@ -3014,14 +3036,14 @@ struct header @{
3014struct data @{ 3036struct 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
3022struct packet @{ 3044struct 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
3032The corresponding data layout specification: 3054The 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
3058A binary data representation: 3080A 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
3068The corresponding decoded structure: 3090The 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
3092Fetching data from this structure: 3114An 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 @@
12012-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
62012-04-20 Glenn Morris <rgm@gnu.org>
7
8 * Makefile.in: Replace non-portable use of $< in emacs-gnutls rules.
9
102012-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
152012-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
202012-04-20 Alan Mackenzie <acm@muc.de>
12012-04-14 Alan Mackenzie <acm@muc.de> 212012-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,
1009you can give this command a prefix argument to read about which features 1010you can give this command a prefix argument to read about which features
1010were new in older versions. 1011were 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
1021Emacs now includes a package manager. Type @kbd{M-x list-packages} to
1022get started. You can use this to download and automatically install
1023many more Lisp packages.
1024
1025@cindex lexical binding
1026@item
1027Emacs Lisp now supports lexical binding on a per-file basis. In
1028@emph{lexical binding}, variable references must be located textually
1029within the binding construct. This contrasts with @emph{dynamic
1030binding}, where programs can refer to variables defined outside their
1031local textual scope. A Lisp file can use a local variable setting of
1032@code{lexical-binding: t} to indicate that the contents should be
1033interpreted using lexical binding. See the Emacs Lisp Reference
1034Manual for more details.
1035
1036@cindex bidirectional display
1037@cindex right-to-left languages
1038@item
1039Some human languages, such as English, are written from left to right.
1040Others, such as Arabic, are written from right to left. Emacs now has
1041support for any mixture of these forms---this is ``bidirectional text''.
1042
1043@item
1044Handling of text selections has been improved, and now integrates
1045better with external clipboards.
1046
1047@cindex themes
1048@item
1049A new command @kbd{customize-themes} allows you to easily change the
1050appearance of your Emacs.
1051
1052@item
1053Emacs can be compiled with the Gtk+ 3 toolkit.
1054
1055@item
1056Support for several new external libraries can be included at compile
1057time:
1058
1059@itemize
1060
1061@item
1062``Security-Enhanced Linux'' (SELinux) is a Linux kernel feature that
1063provides more sophisticated file access controls than ordinary
1064``Unix-style'' file permissions.
1065
1066@item
1067The ImageMagick display library. This allows you to display many more
1068image format in Emacs, as well as carry out transformations such as
1069rotations.
1070
1071@item
1072The GnuTLS library for secure network communications. Emacs uses this
1073transparently for email if your mail server supports it.
1074
1075@item
1076The libxml2 library for parsing XML structures.
1077@end itemize
1078
1079@item
1080Much more flexibility in the handling of windows and buffer display.
1081
1082@end itemize
1083
1084As 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
1065new Visual Line mode for line-motion; improved completion; a new mode 1138new 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
1067mode (for editing XML documents) is included; VC has been updated for 1140mode (for editing XML documents) is included; VC has been updated for
1068newer version control systems; etc. As always, consult the @file{NEWS} 1141newer version control systems; etc.
1069file 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
3300Your first port of call should be the @kbd{M-x list-packages} command.
3301This connects to the @uref{http:///elpa.gnu.org, GNU ELPA} (``Emacs
3302Lisp Package Archive'') server and fetches the list of additional
3303packages that it offers. These are GNU packages that are available
3304for use with Emacs, but are distributed separately. Select a package
3305to get more details about the features that it offers, and then if you
3306wish, 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
3229List (ELL)}, maintained by @email{S.J.Eglen@@damtp.cam.ac.uk, Stephen Eglen}, 3309List (ELL)}, maintained by @email{S.J.Eglen@@damtp.cam.ac.uk, Stephen Eglen},
3230aims to provide one compact list with links to all of the current Emacs 3310aims to provide one compact list with links to all of the current Emacs
diff --git a/etc/CONTRIBUTE b/etc/CONTRIBUTE
index 06b9a9e45a5..aff350f9642 100644
--- a/etc/CONTRIBUTE
+++ b/etc/CONTRIBUTE
@@ -1,4 +1,4 @@
1Copyright (C) 2006-2012 Free Software Foundation, Inc. 1Copyright (C) 2006-2012 Free Software Foundation, Inc.
2See end for license conditions. 2See end for license conditions.
3 3
4 4
@@ -44,13 +44,24 @@ Ref: The "Tips" Appendix in the Emacs Lisp Reference.
44 44
45* Copyright Assignment 45* Copyright Assignment
46 46
47We can accept small changes (roughly, fewer than 15 lines) without 47The FSF (Free Software Foundation) is the copyright holder for GNU Emacs.
48legal papers. Anything more substantial requires a copyright 48The FSF is a nonprofit with a worldwide mission to promote computer
49disclaimer or assignment (the latter is preferred, especially for 49user freedom and to defend the rights of all free software users.
50larger changes). Both of these involved filling out a short form and 50For general information, see the website http://www.fsf.org/ .
51filing it with the FSF. The process is straightforward -- contact us 51
52at emacs-devel@gnu.org to obtain the relevant forms. 52Generally speaking, for non-trivial contributions to GNU Emacs we
53require that the copyright be assigned to the FSF. For the reasons
54behind this, see: http://www.gnu.org/licenses/why-assign.html .
53 55
56Copyright assignment is a simple process. If you live in the US, you
57can do it entirely electronically. We can help you get started, and
58answer any questions you may have (or point you to the people with the
59answers), at the emacs-devel@gnu.org mailing list.
60
61A copyright disclaimer is also a possibility, but we prefer an assignment.
62We can accept small changes (roughly, fewer than 15 lines) without
63an assignment. This is a cumulative limit (e.g. three separate 5 line
64patches) over all your contributions.
54 65
55* Getting the Source Code 66* Getting the Source Code
56 67
diff --git a/etc/ChangeLog b/etc/ChangeLog
index 9353b617cb2..f2cdfb83c44 100644
--- a/etc/ChangeLog
+++ b/etc/ChangeLog
@@ -1,3 +1,9 @@
12012-04-20 Glenn Morris <rgm@gnu.org>
2
3 * CONTRIBUTE: Expand a bit on copyright assignments.
4
5 * MORE.STUFF: General update. Mention list-packages.
6 Remove many old/outdated URLs.
12012-04-10 Lars Magne Ingebrigtsen <larsi@gnus.org> 72012-04-10 Lars Magne Ingebrigtsen <larsi@gnus.org>
2 8
3 * publicsuffix.txt: New file (bug#1401). 9 * publicsuffix.txt: New file (bug#1401).
diff --git a/etc/MORE.STUFF b/etc/MORE.STUFF
index 84a34d24585..06e0870e4ce 100644
--- a/etc/MORE.STUFF
+++ b/etc/MORE.STUFF
@@ -1,99 +1,87 @@
1More Neat Stuff for your Emacs 1More Neat Stuff for your Emacs
2 2
3Copyright (C) 1993, 1999, 2001-2012 Free Software Foundation, Inc. 3Copyright (C) 1993, 1999, 2001-2012 Free Software Foundation, Inc.
4See the end of the file for license conditions. 4See the end of the file for license conditions.
5 5
6This file describes GNU Emacs programs and resources that are 6The easiest way to add more features to your Emacs is to use the command
7maintained by other people. Some of these may become part of the 7M-x list-packages. This contacts the server at <URL:http://elpa.gnu.org>,
8Emacs distribution in the future. Others we unfortunately can't 8where many Emacs Lisp packages are stored. These are distributed
9distribute, even though they are free software, because we lack legal 9separately from Emacs itself for reasons of space, etc. You can browse
10papers for copyright purposes. Also included are sites where 10the resulting *Packages* buffer to see what is available, and then
11development versions of some packages distributed with Emacs may be 11Emacs can automatically download and install the packages that you
12found. 12select. See the section "Emacs Lisp Packages" in the Emacs manual
13for more details.
13 14
14You might also look at the Emacs web page 15Below we describe some GNU Emacs programs and resources that are
15<URL:http://www.gnu.org/software/emacs/emacs.html>. If you use the 16maintained by other people. Some of these may become part of the
16Windows-32 version of Emacs, see the NTEmacs sites listed in the FAQ. 17Emacs distribution, or GNU ELPA, in the future. Others we unfortunately
18can't distribute, even though they are free software, because we lack
19legal papers for copyright purposes.
17 20
18Please submit a bug report if you find that any of the addresses 21Also listed are sites where development versions of some packages
19listed here fail. 22distributed with Emacs may be found.
20 23
21* The `Emacs Lisp List' at 24It is difficult to keep this file up-to-date, and it only lists a fraction
22 <URL:http://www.damtp.cam.ac.uk/user/eglen/emacs/ell.html> has pointers 25of the Emacs modes that are available. If you are interested in
23 to sources of a large number of packages. 26a particular feature, then after checking Emacs itself and GNU ELPA,
27a web search is often the best way to find results.
24 28
25* gnu.emacs.sources 29* The gnu-emacs-sources mailing list
30 <URL:https://lists.gnu.org/mailman/listinfo/gnu-emacs-sources>
31 which is gatewayed to the gnu.emacs.sources newsgroup (although the
32 connection between the two can be unreliable) is an official
33 place where people can post or announce their extensions to Emacs.
26 34
27Packages posted to the gnu.emacs.sources newsgroup (see 35* The `Emacs Lisp List' at
28etc/MAILINGLISTS) might be archived specifically (try a web search 36 <URL:http://www.damtp.cam.ac.uk/user/sje30/emacs/ell.html> has pointers
29engine) or retrievable from general Usenet archive services. 37 to sources of a large number of packages. Unfortunately, at the time
38 of writing it seems to no longer be updating.
30 39
31* emacswiki.org 40* emacswiki.org
41 The Emacs Wiki has an area for storing elisp files
42 <URL:http://www.emacswiki.org/cgi-bin/wiki/ElispArea>.
32 43
33The Emacs Wiki has an area for storing elisp files 44* WikEmacs
34<URL:http://www.emacswiki.org/cgi-bin/wiki/ElispArea>. 45 <URL:http://wikemacs.org> is an alternative wiki for Emacs.
35
36* Emacs tutorials and manuals
37 46
38 * Emacs slides and tutorials can be found here: 47* Emacs slides and tutorials can be found here:
39 <URL:http://web.psung.name/emacs/> 48 <URL:http://web.psung.name/emacs/>
40 49
41* Maintenance versions of some packages distributed with Emacs 50* Maintenance versions of some packages distributed with Emacs
42 51
43You might find bug-fixes or enhancements in these places. 52You might find bug-fixes or enhancements in these places.
53In many cases, however, development of these packages has shifted to Emacs,
54so you will find the latest version in Emacs.
44 55
45 * Ada-mode: <URL:http://stephe-leake.org/emacs/ada-mode/emacs-ada-mode.html> 56 * Ada-mode: <URL:http://stephe-leake.org/emacs/ada-mode/emacs-ada-mode.html>
46 57
47 * Battery and Info Look: <URL:http://ralph-schleicher.de/emacs.html> 58 * Battery and Info Look: <URL:http://ralph-schleicher.de/emacs.html>
48 59
49 * BS: <URL:http://www.geekware.de/software/emacs/index.html>
50
51 * Calculator: <URL:http://www.barzilay.org/misc/calculator.el>
52
53 * CC mode: <URL:http://cc-mode.sourceforge.net/> 60 * CC mode: <URL:http://cc-mode.sourceforge.net/>
54 61
55 * CPerl: <URL:http://math.berkeley.edu/~ilya/software/emacs/> 62 * CPerl: <URL:http://math.berkeley.edu/~ilya/software/emacs/>
56 63
57 * Ediff and Viper: <URL:http://www.cs.sunysb.edu/~kifer/emacs.html> 64 * Ediff and Viper: <URL:http://www.cs.sunysb.edu/~kifer/emacs.html>
58 65
59 * Eldoc and Rlogin:
60 <URL:http://www.splode.com/~friedman/software/emacs-lisp/>
61
62 * ERC: <URL:http://savannah.gnu.org/projects/erc/> 66 * ERC: <URL:http://savannah.gnu.org/projects/erc/>
63 67
64 * Etags: <URL:http://fly.isti.cnr.it/software/>
65
66 * Gnus: <URL:http://www.gnus.org/> 68 * Gnus: <URL:http://www.gnus.org/>
67 69
68 * Ispell: <URL:http://www.kdstevens.com/stevens/ispell-page.html>
69
70 * MH-E: <URL:http://mh-e.sourceforge.net/> 70 * MH-E: <URL:http://mh-e.sourceforge.net/>
71 71
72 * nXML: <URL:http://www.thaiopensource.com/nxml-mode/> 72 * nXML: <URL:http://www.thaiopensource.com/nxml-mode/>
73 73
74 * Org mode: <URL:http://orgmode.org/> 74 * Org mode: <URL:http://orgmode.org/>
75 75
76 * PS mode: <URL:http://odur.let.rug.nl/%7Ekleiweg/postscript/>
77
78 * PS-print: <URL:http://www.emacswiki.org/cgi-bin/wiki/PsPrintPackage>
79
80 * Python: <URL:http://www.loveshack.ukfsn.org/emacs/>
81
82 * QuickURL: <URL:http://www.davep.org/emacs/>
83
84 * RefTeX: <URL:http://www.gnu.org/software/auctex/reftex.html> 76 * RefTeX: <URL:http://www.gnu.org/software/auctex/reftex.html>
85 77
86 * Remember: <URL:https://gna.org/p/remember-el> 78 * Remember: <URL:https://gna.org/p/remember-el>
87 79
88 * Speedbar, Checkdoc etc: <URL:http://cedet.sourceforge.net/> 80 * CEDET: <URL:http://cedet.sourceforge.net/>
89
90 * SQL: <URL:http://www.emacswiki.org/cgi-bin/wiki/sql.el>
91 81
92 * Tramp: Remote file access via rsh/ssh 82 * Tramp: Remote file access via rsh/ssh
93 <URL:http://savannah.gnu.org/projects/tramp/> 83 <URL:http://savannah.gnu.org/projects/tramp/>
94 84
95 * Webjump: <URL:http://www.neilvandyke.org/webjump>
96
97* Auxiliary files 85* Auxiliary files
98 86
99 * (Tex)info files for use with Info-look that don't come from GNU 87 * (Tex)info files for use with Info-look that don't come from GNU
@@ -114,18 +102,16 @@ Emacs for various reasons, sometimes because their authors haven't made
114a copyright assignment to the FSF. Some of them may be integrated in 102a copyright assignment to the FSF. Some of them may be integrated in
115the future. 103the future.
116 104
117You might like to check whether they are packaged for your system. 105Your operating system distribution may include several of these as optional
118Several are for Debian GNU/Linux in particular. 106packages that you can install.
119 107
120 * AUCTeX: <URL:http://www.gnu.org/software/auctex/> 108 * AUCTeX: <URL:http://www.gnu.org/software/auctex/>
121 An extensible package that supports writing and formatting TeX 109 An extensible package that supports writing and formatting TeX
122 files (including AMS-TeX, LaTeX, Texinfo, ConTeXt, and docTeX). 110 files (including AMS-TeX, LaTeX, Texinfo, ConTeXt, and docTeX).
111 Available from GNU ELPA.
123 112
124 * BBDB: personal Info Rolodex integrated with mail/news: 113 * BBDB: personal Info Rolodex integrated with mail/news:
125 <URL:http://bbdb.sourceforge.net/> 114 <URL:http://savannah.nongnu.org/projects/bbdb>
126 [You might want to set the coding system of your .bbdb file to
127 emacs-mule, say by adding `("\\.bbdb\\'" . emacs-mule)' to
128 `file-coding-system-alist' for non-ASCII characters.]
129 115
130 * Boxquote: <URL:http://www.davep.org/emacs/> 116 * Boxquote: <URL:http://www.davep.org/emacs/>
131 117
@@ -143,13 +129,6 @@ Several are for Debian GNU/Linux in particular.
143 * Ee: categorizing information manager: 129 * Ee: categorizing information manager:
144 <URL:http://www.jurta.org/en/emacs/ee/> 130 <URL:http://www.jurta.org/en/emacs/ee/>
145 131
146 * EFS: enhanced version of ange-ftp:
147 <URL:http://www-pu.informatik.uni-tuebingen.de/users/sperber/software/efs/>
148
149 * Elib library: <URL:http://www.gnu.org/software/elib/elib.html>
150 From GNU distribution mirrors. (Much of this functionality is now
151 in Emacs.)
152
153 * EMacro: <URL:http://emacro.sourceforge.net/> 132 * EMacro: <URL:http://emacro.sourceforge.net/>
154 EMacro is a portable configuration file that configures itself. 133 EMacro is a portable configuration file that configures itself.
155 134
@@ -168,33 +147,19 @@ Several are for Debian GNU/Linux in particular.
168 * Emacs Wiki Mode: <URL:http://mwolson.org/projects/EmacsWikiMode.html> 147 * Emacs Wiki Mode: <URL:http://mwolson.org/projects/EmacsWikiMode.html>
169 A wiki-like publishing tool and personal information manager 148 A wiki-like publishing tool and personal information manager
170 149
171 * Gnuserv:
172 <URL:http://www.hpl.hp.com/personal/ange/gnuserv/home.html>
173 Alternative emacsclient/emacsserver. Also available from this Web
174 page: eiffel-mode.el.
175
176 * Go in a buffer: Go Text Protocol client: 150 * Go in a buffer: Go Text Protocol client:
177 <URL:http://www.gnuvola.org/software/personal-elisp/dist/lisp/diversions/gnugo.el> 151 <URL:http://www.gnuvola.org/software/personal-elisp/dist/lisp/diversions/gnugo.el>
178 A modified version is also bundled with GNU Go: 152 A modified version is also bundled with GNU Go:
179 <URL:http://www.gnu.org/software/gnugo/gnugo.html> 153 <URL:http://www.gnu.org/software/gnugo/gnugo.html>
180 154
181 * hm--html-menus:
182 <URL:ftp://sunsite.unc.edu/pub/Linux/apps/editors/emacs/>
183 HTML-specific editing. Can work with PSGML.
184
185 * Hyperbole: 155 * Hyperbole:
186 <URL:http://directory.fsf.org/hyperbole.html> 156 <URL:http://directory.fsf.org/wiki/Hyperbole>
187 Hyperbole is an open, efficient, programmable information 157 Hyperbole is an open, efficient, programmable information
188 management and hypertext system. 158 management and hypertext system.
189 159
190 * JDEE: <URL:http://jdee.sourceforge.net/> 160 * JDEE: <URL:http://jdee.sourceforge.net/>
191 Provides a Java development environment for Emacs. 161 Provides a Java development environment for Emacs.
192 162
193 * Mailcrypt:
194 <URL:http://mailcrypt.sourceforge.net/>
195 PGP and GPG support. PGP isn't free software, but GPG, the GNU
196 Privacy Guard, is a free replacement <URL:http://www.gnupg.org/>.
197
198 * Mew: <URL:http://www.mew.org/> 163 * Mew: <URL:http://www.mew.org/>
199 A MIME mail reader for Emacs/XEmacs. 164 A MIME mail reader for Emacs/XEmacs.
200 165
@@ -208,9 +173,6 @@ Several are for Debian GNU/Linux in particular.
208 * Preview LaTeX: embed preview LaTeX images in source buffer. 173 * Preview LaTeX: embed preview LaTeX images in source buffer.
209 <URL:http://www.gnu.org/software/auctex/preview-latex.html> 174 <URL:http://www.gnu.org/software/auctex/preview-latex.html>
210 175
211 * PSGML: <URL:http://www.lysator.liu.se/projects/about_psgml.html>
212 DTD-aware serious SGML/XML editing.
213
214 * Quack: <URL:http://www.neilvandyke.org/quack/> 176 * Quack: <URL:http://www.neilvandyke.org/quack/>
215 Quack enhances Emacs support for Scheme. 177 Quack enhances Emacs support for Scheme.
216 178
@@ -227,26 +189,17 @@ Several are for Debian GNU/Linux in particular.
227 * Tamago: Chinese/Japanese/Korean input method 189 * Tamago: Chinese/Japanese/Korean input method
228 <URL:http://www.m17n.org/tamago/index.en.html> 190 <URL:http://www.m17n.org/tamago/index.en.html>
229 Emacs Lisp package to provide input methods for CJK characters. 191 Emacs Lisp package to provide input methods for CJK characters.
230 It can use these background conversion servers:
231 FreeWnn (jserver, cserver, tserver),
232 Wnn6,
233 SJ3 Ver.2
234 192
235 * Tiny Tools: <URL:http://freshmeat.net/projects/emacs-tiny-tools> 193 * Tiny Tools: <URL:https://savannah.nongnu.org/projects/emacs-tiny-tools>
236 194
237 * VM (View Mail): Alternative mail reader 195 * VM (View Mail): Alternative mail reader
238 <URL:http://launchpad.net/vm> 196 <URL:http://launchpad.net/vm>
239 Previously hosted at: <URL:http://www.nongnu.org/viewmail/> 197 Previously hosted at: <URL:http://www.nongnu.org/viewmail/>
240 There are VM newsgroups: <URL:news:gnu.emacs.vm.info>, and
241 <URL:news:gnu.emacs.vm.bug>.
242 198
243 * W3: <URL:http://savannah.gnu.org/projects/w3/> 199 * W3 Web browser: <URL:http://savannah.gnu.org/projects/w3/>
244 Web browser. There's a W3 mail list/newsgroup
245 <URL:http://savannah.gnu.org/mail/?group=w3>.
246 200
247 * Wanderlust: <URL:http://www.gohome.org/wl/> 201 * Wanderlust: <URL:http://www.gohome.org/wl/>
248 Yet Another Message Interface on Emacsen. Wanderlust is a mail/news 202 Wanderlust is a mail/news reader for Emacs.
249 reader supporting IMAP4rev1 for emacsen.
250 203
251 * WhizzyTex: <URL:http://cristal.inria.fr/whizzytex/> 204 * WhizzyTex: <URL:http://cristal.inria.fr/whizzytex/>
252 WhizzyTeX provides a minor mode for Emacs or XEmacs, a (bash) 205 WhizzyTeX provides a minor mode for Emacs or XEmacs, a (bash)
diff --git a/lib-src/ChangeLog b/lib-src/ChangeLog
index 106b2c8faca..c76303d8fa2 100644
--- a/lib-src/ChangeLog
+++ b/lib-src/ChangeLog
@@ -1,3 +1,8 @@
12012-04-20 Chong Yidong <cyd@gnu.org>
2
3 * emacsclient.c (decode_options): Move -t -n corner case handling
4 into server.el (Bug#11102).
5
12012-04-18 Paul Eggert <eggert@cs.ucla.edu> 62012-04-18 Paul Eggert <eggert@cs.ucla.edu>
2 7
3 configure: new option --enable-gcc-warnings (Bug#11207) 8 configure: new option --enable-gcc-warnings (Bug#11207)
diff --git a/lib-src/emacsclient.c b/lib-src/emacsclient.c
index 05fd0f3515e..48b4384d487 100644
--- a/lib-src/emacsclient.c
+++ b/lib-src/emacsclient.c
@@ -638,32 +638,23 @@ decode_options (int argc, char **argv)
638 if (display && strlen (display) == 0) 638 if (display && strlen (display) == 0)
639 display = NULL; 639 display = NULL;
640 640
641#ifdef WINDOWSNT
642 /* Emacs on Windows does not support GUI and console frames in the same
643 instance. So, it makes sense to treat the -t and -c options as
644 equivalent, and open a new frame regardless of whether the running
645 instance is GUI or console. Ideally, we would only set tty = 1 when
646 the instance is running in a console, but alas we don't know that.
647 The simplest workaround is to always ask for a tty frame, and let
648 server.el check whether it makes sense. */
649 if (tty || !current_frame)
650 {
651 display = (const char *) ttyname (0); /* Arg is ignored. */
652 current_frame = 0;
653 tty = 1;
654 }
655#endif
656
657 /* If no display is available, new frames are tty frames. */ 641 /* If no display is available, new frames are tty frames. */
658 if (!current_frame && !display) 642 if (!current_frame && !display)
659 tty = 1; 643 tty = 1;
660 644
661 /* --no-wait implies --current-frame on ttys when there are file
662 arguments or expressions given. */
663 if (nowait && tty && argc - optind > 0)
664 current_frame = 1;
665
666#ifdef WINDOWSNT 645#ifdef WINDOWSNT
646 /* Emacs on Windows does not support graphical and text terminal
647 frames in the same instance. So, treat the -t and -c options as
648 equivalent, and open a new frame on the server's terminal.
649 Ideally, we would only set tty = 1 when the serve is running in a
650 console, but alas we don't know that. As a workaround, always
651 ask for a tty frame, and let server.el figure it out. */
652 if (!current_frame)
653 {
654 display = NULL;
655 tty = 1;
656 }
657
667 if (alternate_editor && alternate_editor[0] == '\0') 658 if (alternate_editor && alternate_editor[0] == '\0')
668 { 659 {
669 message (TRUE, "--alternate-editor argument or ALTERNATE_EDITOR variable cannot be\n\ 660 message (TRUE, "--alternate-editor argument or ALTERNATE_EDITOR variable cannot be\n\
diff --git a/lisp/ChangeLog b/lisp/ChangeLog
index 42f99ec9c9e..c9cece95445 100644
--- a/lisp/ChangeLog
+++ b/lisp/ChangeLog
@@ -1,3 +1,77 @@
12012-04-20 Dan Nicolaescu <dann@gnu.org>
2
3 * battery.el (battery-echo-area-format): Display remaining time
4 for sysfs backend too (Bug#11269).
5 (battery-linux-sysfs): Fix conditional for the charge.
6
72012-04-20 Chong Yidong <cyd@gnu.org>
8
9 * progmodes/gdb-mi.el (gdb): Revert previous change.
10 (gdb-inferior-io--init-proc): New function.
11 (gdb-init-1): Use it.
12 (gdb-inferior-io-sentinel): New sentinel for the gdb-inferior pty,
13 responsible for allocating a new pty and hooking it to gdb when
14 the old pty gets an EIO due to process exit.
15 (gdb-delchar-or-quit): New command. Bind it in gdb-mi buffers.
16 (gdb-tooltip-print): Don't use obsolete tooltip-use-echo-area.
17 (gdb-inferior-io--maybe-delete-pty): Move into gdb-reset.
18
192012-04-20 Eli Zaretskii <eliz@gnu.org>
20
21 * window.el (window-min-size, window-sizable, window-min-delta)
22 (window-max-delta, window--resizable, window-resizable)
23 (window-total-size, window-full-height-p, window-full-width-p)
24 (window-in-direction, window--resize-mini-window, window-resize)
25 (window--resize-child-windows-normal)
26 (window--resize-child-windows, window--resize-siblings)
27 (window--resize-this-window, adjust-window-trailing-edge)
28 (enlarge-window, shrink-window): Doc fixes.
29
302012-04-20 Chong Yidong <cyd@gnu.org>
31
32 * progmodes/gdb-mi.el (gdb-inferior-io--maybe-delete-pty): New
33 function to call delete-process on the gdb-inferior buffer's pty.
34 (gdb-reset): Use it, instead of relying on kill-buffer to kill the
35 pty process (Bug#11273).
36 (gdb-update): New arg to suppress talking to the gdb process.
37 (gdb-done-or-error): Use it.
38 (gdb-stopped-functions): Rename from gdb-stopped-hooks.
39 (gdb): Call gdb-inferior-io--maybe-delete-pty as a workaround for
40 sentinel not being called.
41
42 * comint.el (make-comint-in-buffer, comint-exec): Doc fix.
43
44 * progmodes/grep.el (grep, rgrep): Doc fix (Bug#11268).
45
462012-04-20 Glenn Morris <rgm@gnu.org>
47
48 * net/network-stream.el (open-network-stream): Doc fix.
49
502012-04-20 Chong Yidong <cyd@gnu.org>
51
52 * emacs-lisp/tabulated-list.el (tabulated-list-print): Fix typos.
53
542012-04-20 Alan Mackenzie <acm@muc.de>
55
56 Ensure searching for keywords is case sensitive.
57
58 * progmodes/cc-cmds.el (c-electric-brace, c-electric-lt-gt)
59 (c-electric-paren, c-beginning-of-defun, c-end-of-defun)
60 (c-defun-name, c-mark-function, c-cpp-define-name)
61 (c-comment-indent, c-scan-conditionals, c-indent-defun)
62 (c-context-line-break): Bind case-fold-search to nil.
63
64 * progmodes/cc-mode.el (c-font-lock-fontify-region): Bind
65 case-fold-search to nil.
66
672012-04-20 Chong Yidong <cyd@gnu.org>
68
69 * mail/sendmail.el (mail-bury): Call return action with the right
70 Rmail buffer (Bug#11242).
71
72 * server.el (server-process-filter): Handle corner case where both
73 tty and nowait options are present (Bug#11102).
74
12012-04-20 Eli Zaretskii <eliz@gnu.org> 752012-04-20 Eli Zaretskii <eliz@gnu.org>
2 76
3 * version.el (emacs-bzr-version, emacs-bzr-get-version): Doc fixes. 77 * version.el (emacs-bzr-version, emacs-bzr-get-version): Doc fixes.
diff --git a/lisp/battery.el b/lisp/battery.el
index 78898534a47..dcfe07121b3 100644
--- a/lisp/battery.el
+++ b/lisp/battery.el
@@ -78,7 +78,7 @@ introduced by a `%' character in a control string."
78 (cond ((eq battery-status-function 'battery-linux-proc-acpi) 78 (cond ((eq battery-status-function 'battery-linux-proc-acpi)
79 "Power %L, battery %B at %r (%p%% load, remaining time %t)") 79 "Power %L, battery %B at %r (%p%% load, remaining time %t)")
80 ((eq battery-status-function 'battery-linux-sysfs) 80 ((eq battery-status-function 'battery-linux-sysfs)
81 "Power %L, battery %B (%p%% load)") 81 "Power %L, battery %B (%p%% load, remaining time %t)")
82 ((eq battery-status-function 'battery-pmset) 82 ((eq battery-status-function 'battery-pmset)
83 "%L power, battery %B (%p%% load, remaining time %t)") 83 "%L power, battery %B (%p%% load, remaining time %t)")
84 (battery-status-function 84 (battery-status-function
@@ -509,7 +509,7 @@ The following %-sequences are provided:
509 "N/A")) 509 "N/A"))
510 (cons ?d (or temperature "N/A")) 510 (cons ?d (or temperature "N/A"))
511 (cons ?B (or charging-state "N/A")) 511 (cons ?B (or charging-state "N/A"))
512 (cons ?p (cond ((> charge-full 0) 512 (cons ?p (cond ((and (> charge-full 0) (> charge-now 0))
513 (format "%.1f" 513 (format "%.1f"
514 (/ (* 100 charge-now) charge-full))) 514 (/ (* 100 charge-now) charge-full)))
515 ((> energy-full 0) 515 ((> energy-full 0)
diff --git a/lisp/comint.el b/lisp/comint.el
index 68fedeb88a9..10981675971 100644
--- a/lisp/comint.el
+++ b/lisp/comint.el
@@ -699,16 +699,21 @@ BUFFER can be either a buffer or the name of one."
699(defun make-comint-in-buffer (name buffer program &optional startfile &rest switches) 699(defun make-comint-in-buffer (name buffer program &optional startfile &rest switches)
700 "Make a Comint process NAME in BUFFER, running PROGRAM. 700 "Make a Comint process NAME in BUFFER, running PROGRAM.
701If BUFFER is nil, it defaults to NAME surrounded by `*'s. 701If BUFFER is nil, it defaults to NAME surrounded by `*'s.
702PROGRAM should be either a string denoting an executable program to create 702If there is a running process in BUFFER, it is not restarted.
703via `start-file-process', or a cons pair of the form (HOST . SERVICE) denoting 703
704a TCP connection to be opened via `open-network-stream'. If there is already 704PROGRAM should be one of the following:
705a running process in that buffer, it is not restarted. Optional fourth arg 705- a string, denoting an executable program to create via
706STARTFILE is the name of a file, whose contents are sent to the 706 `start-file-process'
707process as its initial input. 707- a cons pair of the form (HOST . SERVICE), denoting a TCP
708 connection to be opened via `open-network-stream'
709- nil, denoting a newly-allocated pty.
710
711Optional fourth arg STARTFILE is the name of a file, whose
712contents are sent to the process as its initial input.
708 713
709If PROGRAM is a string, any more args are arguments to PROGRAM. 714If PROGRAM is a string, any more args are arguments to PROGRAM.
710 715
711Returns the (possibly newly created) process buffer." 716Return the (possibly newly created) process buffer."
712 (or (fboundp 'start-file-process) 717 (or (fboundp 'start-file-process)
713 (error "Multi-processing is not supported for this system")) 718 (error "Multi-processing is not supported for this system"))
714 (setq buffer (get-buffer-create (or buffer (concat "*" name "*")))) 719 (setq buffer (get-buffer-create (or buffer (concat "*" name "*"))))
@@ -752,9 +757,18 @@ See `make-comint' and `comint-exec'."
752(defun comint-exec (buffer name command startfile switches) 757(defun comint-exec (buffer name command startfile switches)
753 "Start up a process named NAME in buffer BUFFER for Comint modes. 758 "Start up a process named NAME in buffer BUFFER for Comint modes.
754Runs the given COMMAND with SWITCHES, and initial input from STARTFILE. 759Runs the given COMMAND with SWITCHES, and initial input from STARTFILE.
755Blasts any old process running in the buffer. Doesn't set the buffer mode. 760
756You can use this to cheaply run a series of processes in the same Comint 761COMMAND should be one of the following:
757buffer. The hook `comint-exec-hook' is run after each exec." 762- a string, denoting an executable program to create via
763 `start-file-process'
764- a cons pair of the form (HOST . SERVICE), denoting a TCP
765 connection to be opened via `open-network-stream'
766- nil, denoting a newly-allocated pty.
767
768This function blasts any old process running in the buffer, and
769does not set the buffer mode. You can use this to cheaply run a
770series of processes in the same Comint buffer. The hook
771`comint-exec-hook' is run after each exec."
758 (with-current-buffer buffer 772 (with-current-buffer buffer
759 (let ((proc (get-buffer-process buffer))) ; Blast any old process. 773 (let ((proc (get-buffer-process buffer))) ; Blast any old process.
760 (if proc (delete-process proc))) 774 (if proc (delete-process proc)))
diff --git a/lisp/emacs-lisp/tabulated-list.el b/lisp/emacs-lisp/tabulated-list.el
index f17b12da6a0..9439fba2b86 100644
--- a/lisp/emacs-lisp/tabulated-list.el
+++ b/lisp/emacs-lisp/tabulated-list.el
@@ -215,7 +215,7 @@ buffer and inserts the entries with `tabulated-list-printer'.
215Optional argument REMEMBER-POS, if non-nil, means to move point 215Optional argument REMEMBER-POS, if non-nil, means to move point
216to the entry with the same ID element as the current line." 216to the entry with the same ID element as the current line."
217 (let ((inhibit-read-only t) 217 (let ((inhibit-read-only t)
218 (entries (if (functionp 'tabulated-list-entries) 218 (entries (if (functionp tabulated-list-entries)
219 (funcall tabulated-list-entries) 219 (funcall tabulated-list-entries)
220 tabulated-list-entries)) 220 tabulated-list-entries))
221 entry-id saved-pt saved-col) 221 entry-id saved-pt saved-col)
@@ -246,7 +246,7 @@ to the entry with the same ID element as the current line."
246 (setq entries (sort entries sorter)) 246 (setq entries (sort entries sorter))
247 (if (cdr tabulated-list-sort-key) 247 (if (cdr tabulated-list-sort-key)
248 (setq entries (nreverse entries))) 248 (setq entries (nreverse entries)))
249 (unless (functionp 'tabulated-list-entries) 249 (unless (functionp tabulated-list-entries)
250 (setq tabulated-list-entries entries))))) 250 (setq tabulated-list-entries entries)))))
251 ;; Print the resulting list. 251 ;; Print the resulting list.
252 (dolist (elt entries) 252 (dolist (elt entries)
diff --git a/lisp/net/network-stream.el b/lisp/net/network-stream.el
index 7a3d47ef1d1..81d05eabc5a 100644
--- a/lisp/net/network-stream.el
+++ b/lisp/net/network-stream.el
@@ -125,9 +125,8 @@ values:
125 certificate. This parameter will only be used when doing TLS 125 certificate. This parameter will only be used when doing TLS
126 or STARTTLS connections. 126 or STARTTLS connections.
127 127
128If :use-starttls-if-possible is non-nil, do opportunistic 128:use-starttls-if-possible is a boolean that says to do opportunistic
129STARTTLS upgrades even if Emacs doesn't have built-in TLS 129STARTTLS upgrades even if Emacs doesn't have built-in TLS functionality.
130functionality.
131 130
132:nowait is a boolean that says the connection should be made 131:nowait is a boolean that says the connection should be made
133 asynchronously, if possible." 132 asynchronously, if possible."
diff --git a/lisp/progmodes/cc-cmds.el b/lisp/progmodes/cc-cmds.el
index 55ab6c9981c..9cf20ccb516 100644
--- a/lisp/progmodes/cc-cmds.el
+++ b/lisp/progmodes/cc-cmds.el
@@ -679,7 +679,7 @@ settings of `c-cleanup-list' are done."
679 ;; We want to inhibit blinking the paren since this would be 679 ;; We want to inhibit blinking the paren since this would be
680 ;; most disruptive. We'll blink it ourselves later on. 680 ;; most disruptive. We'll blink it ourselves later on.
681 (old-blink-paren blink-paren-function) 681 (old-blink-paren blink-paren-function)
682 blink-paren-function) 682 blink-paren-function case-fold-search)
683 683
684 (c-save-buffer-state () 684 (c-save-buffer-state ()
685 (setq safepos (c-safe-position (point) (c-parse-state)) 685 (setq safepos (c-safe-position (point) (c-parse-state))
@@ -1086,7 +1086,7 @@ numeric argument is supplied, or the point is inside a literal."
1086 1086
1087 (interactive "*P") 1087 (interactive "*P")
1088 (let ((c-echo-syntactic-information-p nil) 1088 (let ((c-echo-syntactic-information-p nil)
1089 final-pos close-paren-inserted found-delim) 1089 final-pos close-paren-inserted found-delim case-fold-search)
1090 1090
1091 (self-insert-command (prefix-numeric-value arg)) 1091 (self-insert-command (prefix-numeric-value arg))
1092 (setq final-pos (point)) 1092 (setq final-pos (point))
@@ -1172,7 +1172,8 @@ newline cleanups are done if appropriate; see the variable `c-cleanup-list'."
1172 (interactive "*P") 1172 (interactive "*P")
1173 (let ((literal (c-save-buffer-state () (c-in-literal))) 1173 (let ((literal (c-save-buffer-state () (c-in-literal)))
1174 ;; shut this up 1174 ;; shut this up
1175 (c-echo-syntactic-information-p nil)) 1175 (c-echo-syntactic-information-p nil)
1176 case-fold-search)
1176 (self-insert-command (prefix-numeric-value arg)) 1177 (self-insert-command (prefix-numeric-value arg))
1177 1178
1178 (if (and (not arg) (not literal)) 1179 (if (and (not arg) (not literal))
@@ -1585,7 +1586,7 @@ defun."
1585 ; structure with other users of c-state-cache. 1586 ; structure with other users of c-state-cache.
1586 (orig-point-min (point-min)) (orig-point-max (point-max)) 1587 (orig-point-min (point-min)) (orig-point-max (point-max))
1587 lim ; Position of { which has been widened to. 1588 lim ; Position of { which has been widened to.
1588 where pos) 1589 where pos case-fold-search)
1589 1590
1590 (save-restriction 1591 (save-restriction
1591 (if (eq c-defun-tactic 'go-outward) 1592 (if (eq c-defun-tactic 'go-outward)
@@ -1709,7 +1710,8 @@ the open-parenthesis that starts a defun; see `beginning-of-defun'."
1709 ; structure with other users of c-state-cache. 1710 ; structure with other users of c-state-cache.
1710 (orig-point-min (point-min)) (orig-point-max (point-max)) 1711 (orig-point-min (point-min)) (orig-point-max (point-max))
1711 lim 1712 lim
1712 where pos) 1713 where pos case-fold-search)
1714
1713 (save-restriction 1715 (save-restriction
1714 (if (eq c-defun-tactic 'go-outward) 1716 (if (eq c-defun-tactic 'go-outward)
1715 (setq lim (c-widen-to-enclosing-decl-scope ; e.g. class, namespace 1717 (setq lim (c-widen-to-enclosing-decl-scope ; e.g. class, namespace
@@ -1769,8 +1771,8 @@ with a brace block."
1769 (interactive) 1771 (interactive)
1770 (c-save-buffer-state 1772 (c-save-buffer-state
1771 (beginning-of-defun-function end-of-defun-function 1773 (beginning-of-defun-function end-of-defun-function
1772 where pos name-end) 1774 where pos name-end case-fold-search)
1773 1775
1774 (save-restriction 1776 (save-restriction
1775 (widen) 1777 (widen)
1776 (save-excursion 1778 (save-excursion
@@ -1969,7 +1971,7 @@ As opposed to \\[c-beginning-of-defun] and \\[c-end-of-defun], this
1969function does not require the declaration to contain a brace block." 1971function does not require the declaration to contain a brace block."
1970 (interactive) 1972 (interactive)
1971 1973
1972 (let (decl-limits) 1974 (let (decl-limits case-fold-search)
1973 (c-save-buffer-state nil 1975 (c-save-buffer-state nil
1974 ;; We try to be line oriented, unless there are several 1976 ;; We try to be line oriented, unless there are several
1975 ;; declarations on the same line. 1977 ;; declarations on the same line.
@@ -2001,11 +2003,12 @@ function does not require the declaration to contain a brace block."
2001(defun c-cpp-define-name () 2003(defun c-cpp-define-name ()
2002 "Return the name of the current CPP macro, or NIL if we're not in one." 2004 "Return the name of the current CPP macro, or NIL if we're not in one."
2003 (interactive) 2005 (interactive)
2004 (save-excursion 2006 (let (case-fold-search)
2005 (and c-opt-cpp-macro-define-start 2007 (save-excursion
2006 (c-beginning-of-macro) 2008 (and c-opt-cpp-macro-define-start
2007 (looking-at c-opt-cpp-macro-define-start) 2009 (c-beginning-of-macro)
2008 (match-string-no-properties 1)))) 2010 (looking-at c-opt-cpp-macro-define-start)
2011 (match-string-no-properties 1)))))
2009 2012
2010 2013
2011;; Movement by statements. 2014;; Movement by statements.
@@ -2888,7 +2891,8 @@ See `c-indent-comment-alist' for a description."
2888 (eq (match-end 0) eot)) 2891 (eq (match-end 0) eot))
2889 'cpp-end-block) 2892 'cpp-end-block)
2890 (t 2893 (t
2891 'other)))) 2894 'other)))
2895 case-fold-search)
2892 (if (and (memq line-type '(anchored-comment empty-line)) 2896 (if (and (memq line-type '(anchored-comment empty-line))
2893 c-indent-comments-syntactically-p) 2897 c-indent-comments-syntactically-p)
2894 (let ((c-syntactic-context (c-guess-basic-syntax))) 2898 (let ((c-syntactic-context (c-guess-basic-syntax)))
@@ -3024,7 +3028,7 @@ are treated as conditional clause limits. Normally they are ignored."
3024 (let* ((forward (> count 0)) 3028 (let* ((forward (> count 0))
3025 (increment (if forward -1 1)) 3029 (increment (if forward -1 1))
3026 (search-function (if forward 're-search-forward 're-search-backward)) 3030 (search-function (if forward 're-search-forward 're-search-backward))
3027 new) 3031 new case-fold-search)
3028 (unless (integerp target-depth) 3032 (unless (integerp target-depth)
3029 (setq target-depth (if target-depth -1 0))) 3033 (setq target-depth (if target-depth -1 0)))
3030 (save-excursion 3034 (save-excursion
@@ -3226,7 +3230,7 @@ balanced expression is found."
3226In the macro case this also has the effect of realigning any line 3230In the macro case this also has the effect of realigning any line
3227continuation backslashes, unless `c-auto-align-backslashes' is nil." 3231continuation backslashes, unless `c-auto-align-backslashes' is nil."
3228 (interactive "*") 3232 (interactive "*")
3229 (let ((here (point-marker)) decl-limits) 3233 (let ((here (point-marker)) decl-limits case-fold-search)
3230 (unwind-protect 3234 (unwind-protect
3231 (progn 3235 (progn
3232 (c-save-buffer-state nil 3236 (c-save-buffer-state nil
@@ -4638,7 +4642,8 @@ inside a preprocessor directive."
4638 4642
4639 (interactive "*") 4643 (interactive "*")
4640 (let* (c-lit-limits c-lit-type 4644 (let* (c-lit-limits c-lit-type
4641 (c-macro-start c-macro-start)) 4645 (c-macro-start c-macro-start)
4646 case-fold-search)
4642 4647
4643 (c-save-buffer-state () 4648 (c-save-buffer-state ()
4644 (setq c-lit-limits (c-literal-limits nil nil t) 4649 (setq c-lit-limits (c-literal-limits nil nil t)
diff --git a/lisp/progmodes/cc-mode.el b/lisp/progmodes/cc-mode.el
index 7c018feefbb..ff18f56bbe8 100644
--- a/lisp/progmodes/cc-mode.el
+++ b/lisp/progmodes/cc-mode.el
@@ -1170,10 +1170,10 @@ Note that the style variables are always made local to the buffer."
1170 ;; 1170 ;;
1171 ;; 1171 ;;
1172 ;; void myfunc(T* p) {} 1172 ;; void myfunc(T* p) {}
1173 ;; 1173 ;;
1174 ;; Type a space in the first blank line, and the fontification of the next 1174 ;; Type a space in the first blank line, and the fontification of the next
1175 ;; line was fouled up by context fontification. 1175 ;; line was fouled up by context fontification.
1176 (let ((new-beg beg) (new-end end) new-region) 1176 (let ((new-beg beg) (new-end end) new-region case-fold-search)
1177 (if c-in-after-change-fontification 1177 (if c-in-after-change-fontification
1178 (setq c-in-after-change-fontification nil) 1178 (setq c-in-after-change-fontification nil)
1179 (save-restriction 1179 (save-restriction
diff --git a/lisp/progmodes/gdb-mi.el b/lisp/progmodes/gdb-mi.el
index 497d2440cfd..1be74ff544b 100644
--- a/lisp/progmodes/gdb-mi.el
+++ b/lisp/progmodes/gdb-mi.el
@@ -375,9 +375,8 @@ Emacs always switches to the thread which caused the stop."
375 :version "23.2" 375 :version "23.2"
376 :link '(info-link "(gdb)GDB/MI Async Records")) 376 :link '(info-link "(gdb)GDB/MI Async Records"))
377 377
378(defcustom gdb-stopped-hooks nil 378(defcustom gdb-stopped-functions nil
379 "This variable holds a list of functions to be called whenever 379 "List of functions called whenever GDB stops.
380GDB stops.
381 380
382Each function takes one argument, a parsed MI response, which 381Each function takes one argument, a parsed MI response, which
383contains fields of corresponding MI *stopped async record: 382contains fields of corresponding MI *stopped async record:
@@ -818,6 +817,8 @@ detailed description of this mode.
818 nil 'local) 817 nil 'local)
819 (local-set-key "\C-i" 'completion-at-point) 818 (local-set-key "\C-i" 'completion-at-point)
820 819
820 (local-set-key [remap comint-delchar-or-maybe-eof] 'gdb-delchar-or-quit)
821
821 (setq gdb-first-prompt t) 822 (setq gdb-first-prompt t)
822 (setq gud-running nil) 823 (setq gud-running nil)
823 824
@@ -859,15 +860,8 @@ detailed description of this mode.
859 860
860 (gdb-get-buffer-create 'gdb-inferior-io) 861 (gdb-get-buffer-create 'gdb-inferior-io)
861 (gdb-clear-inferior-io) 862 (gdb-clear-inferior-io)
862 (set-process-filter (get-process "gdb-inferior") 'gdb-inferior-filter) 863 (gdb-inferior-io--init-proc (get-process "gdb-inferior"))
863 (gdb-input 864
864 ;; Needs GDB 6.4 onwards
865 (concat "-inferior-tty-set "
866 (or
867 ;; The process can run on a remote host.
868 (process-get (get-process "gdb-inferior") 'remote-tty)
869 (process-tty-name (get-process "gdb-inferior"))))
870 'ignore)
871 (if (eq window-system 'w32) 865 (if (eq window-system 'w32)
872 (gdb-input "-gdb-set new-console off" 'ignore)) 866 (gdb-input "-gdb-set new-console off" 'ignore))
873 (gdb-input "-gdb-set height 0" 'ignore) 867 (gdb-input "-gdb-set height 0" 'ignore)
@@ -905,6 +899,25 @@ detailed description of this mode.
905 (setq gdb-non-stop nil) 899 (setq gdb-non-stop nil)
906 (gdb-input "-gdb-set non-stop 0" 'ignore))) 900 (gdb-input "-gdb-set non-stop 0" 'ignore)))
907 901
902(defun gdb-delchar-or-quit (arg)
903 "Delete ARG characters or send a quit command to GDB.
904Send a quit only if point is at the end of the buffer, there is
905no input, and GDB is waiting for input."
906 (interactive "p")
907 (unless (and (eq (current-buffer) gud-comint-buffer)
908 (eq gud-minor-mode 'gdbmi))
909 (error "Not in a GDB-MI buffer"))
910 (let ((proc (get-buffer-process gud-comint-buffer)))
911 (if (and (eobp) proc (process-live-p proc)
912 (not gud-running)
913 (= (point) (marker-position (process-mark proc))))
914 ;; Sending an EOF does not work with GDB-MI; submit an
915 ;; explicit quit command.
916 (progn
917 (insert "quit")
918 (comint-send-input t t))
919 (delete-char arg))))
920
908(defvar gdb-define-alist nil "Alist of #define directives for GUD tooltips.") 921(defvar gdb-define-alist nil "Alist of #define directives for GUD tooltips.")
909 922
910(defun gdb-create-define-alist () 923(defun gdb-create-define-alist ()
@@ -929,7 +942,6 @@ detailed description of this mode.
929 (push (cons name define) gdb-define-alist)))) 942 (push (cons name define) gdb-define-alist))))
930 943
931(declare-function tooltip-show "tooltip" (text &optional use-echo-area)) 944(declare-function tooltip-show "tooltip" (text &optional use-echo-area))
932(defvar tooltip-use-echo-area)
933 945
934(defun gdb-tooltip-print (expr) 946(defun gdb-tooltip-print (expr)
935 (with-current-buffer (gdb-get-buffer 'gdb-partial-output-buffer) 947 (with-current-buffer (gdb-get-buffer 'gdb-partial-output-buffer)
@@ -937,7 +949,7 @@ detailed description of this mode.
937 (if (re-search-forward ".*value=\\(\".*\"\\)" nil t) 949 (if (re-search-forward ".*value=\\(\".*\"\\)" nil t)
938 (tooltip-show 950 (tooltip-show
939 (concat expr " = " (read (match-string 1))) 951 (concat expr " = " (read (match-string 1)))
940 (or gud-tooltip-echo-area tooltip-use-echo-area 952 (or gud-tooltip-echo-area
941 (not (display-graphic-p))))))) 953 (not (display-graphic-p)))))))
942 954
943;; If expr is a macro for a function don't print because of possible dangerous 955;; If expr is a macro for a function don't print because of possible dangerous
@@ -1510,6 +1522,31 @@ DOC is an optional documentation string."
1510 (gdb-display-buffer 1522 (gdb-display-buffer
1511 (gdb-get-buffer-create 'gdb-inferior-io) t)) 1523 (gdb-get-buffer-create 'gdb-inferior-io) t))
1512 1524
1525(defun gdb-inferior-io--init-proc (proc)
1526 ;; Set up inferior I/O. Needs GDB 6.4 onwards.
1527 (set-process-filter proc 'gdb-inferior-filter)
1528 (set-process-sentinel proc 'gdb-inferior-io-sentinel)
1529 (gdb-input
1530 (concat "-inferior-tty-set "
1531 ;; The process can run on a remote host.
1532 (or (process-get proc 'remote-tty)
1533 (process-tty-name proc)))
1534 'ignore))
1535
1536(defun gdb-inferior-io-sentinel (proc str)
1537 (when (eq (process-status proc) 'failed)
1538 ;; When the debugged process exits, Emacs gets an EIO error on
1539 ;; read from the pty, and stops listening to it. If the gdb
1540 ;; process is still running, remove the pty, make a new one, and
1541 ;; pass it to gdb.
1542 (let ((gdb-proc (get-buffer-process gud-comint-buffer))
1543 (io-buffer (process-buffer proc)))
1544 (when (and gdb-proc (process-live-p gdb-proc)
1545 (buffer-live-p io-buffer))
1546 ;; `comint-exec' deletes the original process as a side effect.
1547 (comint-exec io-buffer "gdb-inferior" nil nil nil)
1548 (gdb-inferior-io--init-proc (get-buffer-process io-buffer))))))
1549
1513(defconst gdb-frame-parameters 1550(defconst gdb-frame-parameters
1514 '((height . 14) (width . 80) 1551 '((height . 14) (width . 80)
1515 (unsplittable . t) 1552 (unsplittable . t)
@@ -1746,24 +1783,27 @@ If `gdb-thread-number' is nil, just wrap NAME in asterisks."
1746 (setq gdb-output-sink 'user) 1783 (setq gdb-output-sink 'user)
1747 (setq gdb-pending-triggers nil)) 1784 (setq gdb-pending-triggers nil))
1748 1785
1749(defun gdb-update () 1786(defun gdb-update (&optional no-proc)
1750 "Update buffers showing status of debug session." 1787 "Update buffers showing status of debug session.
1788If NO-PROC is non-nil, do not try to contact the GDB process."
1751 (when gdb-first-prompt 1789 (when gdb-first-prompt
1752 (gdb-force-mode-line-update 1790 (gdb-force-mode-line-update
1753 (propertize "initializing..." 'face font-lock-variable-name-face)) 1791 (propertize "initializing..." 'face font-lock-variable-name-face))
1754 (gdb-init-1) 1792 (gdb-init-1)
1755 (setq gdb-first-prompt nil)) 1793 (setq gdb-first-prompt nil))
1756 1794
1757 (gdb-get-main-selected-frame) 1795 (unless no-proc
1796 (gdb-get-main-selected-frame))
1797
1758 ;; We may need to update gdb-threads-list so we can use 1798 ;; We may need to update gdb-threads-list so we can use
1759 (gdb-get-buffer-create 'gdb-threads-buffer) 1799 (gdb-get-buffer-create 'gdb-threads-buffer)
1760 ;; gdb-break-list is maintained in breakpoints handler 1800 ;; gdb-break-list is maintained in breakpoints handler
1761 (gdb-get-buffer-create 'gdb-breakpoints-buffer) 1801 (gdb-get-buffer-create 'gdb-breakpoints-buffer)
1762 1802
1763 (gdb-emit-signal gdb-buf-publisher 'update) 1803 (unless no-proc
1804 (gdb-emit-signal gdb-buf-publisher 'update))
1764 1805
1765 (gdb-get-changed-registers) 1806 (gdb-get-changed-registers)
1766
1767 (when (and (boundp 'speedbar-frame) (frame-live-p speedbar-frame)) 1807 (when (and (boundp 'speedbar-frame) (frame-live-p speedbar-frame))
1768 (dolist (var gdb-var-list) 1808 (dolist (var gdb-var-list)
1769 (setcar (nthcdr 5 var) nil)) 1809 (setcar (nthcdr 5 var) nil))
@@ -2045,7 +2085,7 @@ current thread and update GDB buffers."
2045 ;; In all-stop this updates gud-running properly as well. 2085 ;; In all-stop this updates gud-running properly as well.
2046 (gdb-update) 2086 (gdb-update)
2047 (setq gdb-first-done-or-error nil)) 2087 (setq gdb-first-done-or-error nil))
2048 (run-hook-with-args 'gdb-stopped-hooks result))) 2088 (run-hook-with-args 'gdb-stopped-functions result)))
2049 2089
2050;; Remove the trimmings from log stream containing debugging messages 2090;; Remove the trimmings from log stream containing debugging messages
2051;; being produced by GDB's internals, use warning face and send to GUD 2091;; being produced by GDB's internals, use warning face and send to GUD
@@ -2085,23 +2125,28 @@ current thread and update GDB buffers."
2085 (setq gdb-output-sink 'emacs)) 2125 (setq gdb-output-sink 'emacs))
2086 2126
2087 (gdb-clear-partial-output) 2127 (gdb-clear-partial-output)
2088 (when gdb-first-done-or-error
2089 (unless (or token-number gud-running)
2090 (setq gdb-filter-output (concat gdb-filter-output gdb-prompt-name)))
2091 (gdb-update)
2092 (setq gdb-first-done-or-error nil))
2093 2128
2094 (setq gdb-filter-output 2129 ;; The process may already be dead (e.g. C-d at the gdb prompt).
2095 (gdb-concat-output gdb-filter-output output-field)) 2130 (let* ((proc (get-buffer-process gud-comint-buffer))
2131 (no-proc (or (null proc)
2132 (memq (process-status proc) '(exit signal)))))
2096 2133
2097 (if token-number 2134 (when gdb-first-done-or-error
2098 (progn 2135 (unless (or token-number gud-running no-proc)
2099 (with-current-buffer 2136 (setq gdb-filter-output (concat gdb-filter-output gdb-prompt-name)))
2100 (gdb-get-buffer-create 'gdb-partial-output-buffer) 2137 (gdb-update no-proc)
2101 (funcall 2138 (setq gdb-first-done-or-error nil))
2102 (cdr (assoc (string-to-number token-number) gdb-handler-alist)))) 2139
2103 (setq gdb-handler-alist 2140 (setq gdb-filter-output
2104 (assq-delete-all token-number gdb-handler-alist))))) 2141 (gdb-concat-output gdb-filter-output output-field))
2142
2143 (when token-number
2144 (with-current-buffer
2145 (gdb-get-buffer-create 'gdb-partial-output-buffer)
2146 (funcall
2147 (cdr (assoc (string-to-number token-number) gdb-handler-alist))))
2148 (setq gdb-handler-alist
2149 (assq-delete-all token-number gdb-handler-alist)))))
2105 2150
2106(defun gdb-concat-output (so-far new) 2151(defun gdb-concat-output (so-far new)
2107 (cond 2152 (cond
@@ -4105,9 +4150,15 @@ This arrangement depends on the value of `gdb-many-windows'."
4105 (gud-find-file gdb-main-file))) 4150 (gud-find-file gdb-main-file)))
4106 (setq gdb-source-window win))))) 4151 (setq gdb-source-window win)))))
4107 4152
4153;; Called from `gud-sentinel' in gud.el:
4108(defun gdb-reset () 4154(defun gdb-reset ()
4109 "Exit a debugging session cleanly. 4155 "Exit a debugging session cleanly.
4110Kills the gdb buffers, and resets variables and the source buffers." 4156Kills the gdb buffers, and resets variables and the source buffers."
4157 ;; The gdb-inferior buffer has a pty hooked up to the main gdb
4158 ;; process. This pty must be deleted explicitly.
4159 (let ((pty (get-process "gdb-inferior")))
4160 (if pty (delete-process pty)))
4161 ;; Find gdb-mi buffers and kill them.
4111 (dolist (buffer (buffer-list)) 4162 (dolist (buffer (buffer-list))
4112 (unless (eq buffer gud-comint-buffer) 4163 (unless (eq buffer gud-comint-buffer)
4113 (with-current-buffer buffer 4164 (with-current-buffer buffer
diff --git a/lisp/progmodes/grep.el b/lisp/progmodes/grep.el
index 569e864a1c6..a6ae42f86b1 100644
--- a/lisp/progmodes/grep.el
+++ b/lisp/progmodes/grep.el
@@ -728,9 +728,9 @@ This function is called from `compilation-filter-hook'."
728(defun grep (command-args) 728(defun grep (command-args)
729 "Run grep, with user-specified args, and collect output in a buffer. 729 "Run grep, with user-specified args, and collect output in a buffer.
730While grep runs asynchronously, you can use \\[next-error] (M-x next-error), 730While grep runs asynchronously, you can use \\[next-error] (M-x next-error),
731or \\<grep-mode-map>\\[compile-goto-error] in the grep \ 731or \\<grep-mode-map>\\[compile-goto-error] in the *grep* \
732output buffer, to go to the lines where grep 732buffer, to go to the lines where grep found
733found matches. 733matches. To kill the grep job before it finishes, type \\[kill-compilation].
734 734
735For doing a recursive `grep', see the `rgrep' command. For running 735For doing a recursive `grep', see the `rgrep' command. For running
736`grep' in a specific directory, see `lgrep'. 736`grep' in a specific directory, see `lgrep'.
@@ -957,10 +957,11 @@ With \\[universal-argument] prefix, you can edit the constructed shell command l
957before it is executed. 957before it is executed.
958With two \\[universal-argument] prefixes, directly edit and run `grep-find-command'. 958With two \\[universal-argument] prefixes, directly edit and run `grep-find-command'.
959 959
960Collect output in a buffer. While find runs asynchronously, you 960Collect output in a buffer. While the recursive grep is running,
961can use \\[next-error] (M-x next-error), or \\<grep-mode-map>\\[compile-goto-error] \ 961you can use \\[next-error] (M-x next-error), or \\<grep-mode-map>\\[compile-goto-error] \
962in the grep output buffer, 962in the grep output buffer,
963to go to the lines where grep found matches. 963to visit the lines where matches were found. To kill the job
964before it finishes, type \\[kill-compilation].
964 965
965This command shares argument histories with \\[lgrep] and \\[grep-find]. 966This command shares argument histories with \\[lgrep] and \\[grep-find].
966 967
diff --git a/lisp/server.el b/lisp/server.el
index c82a639eadf..123fea3743a 100644
--- a/lisp/server.el
+++ b/lisp/server.el
@@ -1174,6 +1174,13 @@ The following commands are accepted by the client:
1174 ;; Unknown command. 1174 ;; Unknown command.
1175 (arg (error "Unknown command: %s" arg)))) 1175 (arg (error "Unknown command: %s" arg))))
1176 1176
1177 ;; If both -no-wait and -tty are given with file or sexp
1178 ;; arguments, use an existing frame.
1179 (and nowait
1180 (not (eq tty-name 'window-system))
1181 (or files commands)
1182 (setq use-current-frame t))
1183
1177 (setq frame 1184 (setq frame
1178 (cond 1185 (cond
1179 ((and use-current-frame 1186 ((and use-current-frame
diff --git a/lisp/subr.el b/lisp/subr.el
index ff93cd22210..8e296aa7422 100644
--- a/lisp/subr.el
+++ b/lisp/subr.el
@@ -1888,8 +1888,7 @@ Used from `delayed-warnings-hook' (which see)."
1888 (push warning collapsed))) 1888 (push warning collapsed)))
1889 (setq delayed-warnings-list (nreverse collapsed)))) 1889 (setq delayed-warnings-list (nreverse collapsed))))
1890 1890
1891;; At present this is only really useful for Emacs internals. 1891;; At present this is only used for Emacs internals.
1892;; Document in the lispref if it becomes generally useful.
1893;; Ref http://lists.gnu.org/archive/html/emacs-devel/2012-02/msg00085.html 1892;; Ref http://lists.gnu.org/archive/html/emacs-devel/2012-02/msg00085.html
1894(defvar delayed-warnings-hook '(collapse-delayed-warnings 1893(defvar delayed-warnings-hook '(collapse-delayed-warnings
1895 display-delayed-warnings) 1894 display-delayed-warnings)
@@ -2308,6 +2307,8 @@ is nil and `use-dialog-box' is non-nil."
2308 (discard-input)))) 2307 (discard-input))))
2309 (let ((ret (eq answer 'act))) 2308 (let ((ret (eq answer 'act)))
2310 (unless noninteractive 2309 (unless noninteractive
2310 ;; FIXME this prints one too many spaces, since prompt
2311 ;; already ends in a space. Eg "... (y or n) y".
2311 (message "%s %s" prompt (if ret "y" "n"))) 2312 (message "%s %s" prompt (if ret "y" "n")))
2312 ret))) 2313 ret)))
2313 2314
diff --git a/lisp/window.el b/lisp/window.el
index 934b6067d08..c148f5ee01f 100644
--- a/lisp/window.el
+++ b/lisp/window.el
@@ -514,17 +514,19 @@ window).")
514 (if (window-valid-p ignore) (eq window ignore) ignore)) 514 (if (window-valid-p ignore) (eq window ignore) ignore))
515 515
516(defun window-min-size (&optional window horizontal ignore) 516(defun window-min-size (&optional window horizontal ignore)
517 "Return the minimum number of lines of WINDOW. 517 "Return the minimum size of WINDOW.
518WINDOW can be an arbitrary window and defaults to the selected 518WINDOW can be an arbitrary window and defaults to the selected
519one. Optional argument HORIZONTAL non-nil means return the 519one. Optional argument HORIZONTAL non-nil means return the
520minimum number of columns of WINDOW. 520minimum number of columns of WINDOW; otherwise return the minimum
521number of WINDOW's lines.
521 522
522Optional argument IGNORE non-nil means ignore any restrictions 523Optional argument IGNORE, if non-nil, means ignore restrictions
523imposed by fixed size windows, `window-min-height' or 524imposed by fixed size windows, `window-min-height' or
524`window-min-width' settings. IGNORE equal `safe' means live 525`window-min-width' settings. If IGNORE equals `safe', live
525windows may get as small as `window-safe-min-height' lines and 526windows may get as small as `window-safe-min-height' lines and
526`window-safe-min-width' columns. IGNORE a window means ignore 527`window-safe-min-width' columns. If IGNORE is a window, ignore
527restrictions for that window only." 528restrictions for that window only. Any other non-nil value
529means ignore all of the above restrictions for all windows."
528 (window--min-size-1 530 (window--min-size-1
529 (window-normalize-window window) horizontal ignore)) 531 (window-normalize-window window) horizontal ignore))
530 532
@@ -614,12 +616,13 @@ columns. If WINDOW cannot be shrunk by -DELTA lines or columns,
614return the minimum value in the range DELTA..0 by which WINDOW 616return the minimum value in the range DELTA..0 by which WINDOW
615can be shrunk. 617can be shrunk.
616 618
617Optional argument IGNORE non-nil means ignore any restrictions 619Optional argument IGNORE non-nil means ignore restrictions
618imposed by fixed size windows, `window-min-height' or 620imposed by fixed size windows, `window-min-height' or
619`window-min-width' settings. IGNORE equal `safe' means live 621`window-min-width' settings. If IGNORE equals `safe', live
620windows may get as small as `window-safe-min-height' lines and 622windows may get as small as `window-safe-min-height' lines and
621`window-safe-min-width' columns. IGNORE any window means ignore 623`window-safe-min-width' columns. If IGNORE is a window, ignore
622restrictions for that window only." 624restrictions for that window only. Any other non-nil value means
625ignore all of the above restrictions for all windows."
623 (setq window (window-normalize-window window)) 626 (setq window (window-normalize-window window))
624 (cond 627 (cond
625 ((< delta 0) 628 ((< delta 0)
@@ -734,20 +737,21 @@ window. Return zero if WINDOW cannot be shrunk.
734Optional argument HORIZONTAL non-nil means return number of 737Optional argument HORIZONTAL non-nil means return number of
735columns by which WINDOW can be shrunk. 738columns by which WINDOW can be shrunk.
736 739
737Optional argument IGNORE non-nil means ignore any restrictions 740Optional argument IGNORE non-nil means ignore restrictions
738imposed by fixed size windows, `window-min-height' or 741imposed by fixed size windows, `window-min-height' or
739`window-min-width' settings. IGNORE a window means ignore 742`window-min-width' settings. If IGNORE is a window, ignore
740restrictions for that window only. IGNORE equal `safe' means 743restrictions for that window only. If IGNORE equals `safe',
741live windows may get as small as `window-safe-min-height' lines 744live windows may get as small as `window-safe-min-height' lines
742and `window-safe-min-width' columns. 745and `window-safe-min-width' columns. Any other non-nil value
746means ignore all of the above restrictions for all windows.
743 747
744Optional argument TRAIL `before' means only windows to the left 748Optional argument TRAIL restricts the windows that can be enlarged.
745of or above WINDOW can be enlarged. Optional argument TRAIL 749If its value is `before', only windows to the left of or above WINDOW
746`after' means only windows to the right of or below WINDOW can be 750can be enlarged. If it is `after', only windows to the right of or
747enlarged. 751below WINDOW can be enlarged.
748 752
749Optional argument NOUP non-nil means don't go up in the window 753Optional argument NOUP non-nil means don't go up in the window
750tree but try to enlarge windows within WINDOW's combination only. 754tree, but try to enlarge windows within WINDOW's combination only.
751 755
752Optional argument NODOWN non-nil means don't check whether WINDOW 756Optional argument NODOWN non-nil means don't check whether WINDOW
753itself (and its child windows) can be shrunk; check only whether 757itself (and its child windows) can be shrunk; check only whether
@@ -808,24 +812,25 @@ at least one other window can be enlarged appropriately."
808 (window--max-delta-1 parent delta horizontal ignore trail)))))) 812 (window--max-delta-1 parent delta horizontal ignore trail))))))
809 813
810(defun window-max-delta (&optional window horizontal ignore trail noup nodown) 814(defun window-max-delta (&optional window horizontal ignore trail noup nodown)
811 "Return maximum number of lines WINDOW by which WINDOW can be enlarged. 815 "Return maximum number of lines by which WINDOW can be enlarged.
812WINDOW can be an arbitrary window and defaults to the selected 816WINDOW can be an arbitrary window and defaults to the selected
813window. The return value is zero if WINDOW cannot be enlarged. 817window. The return value is zero if WINDOW cannot be enlarged.
814 818
815Optional argument HORIZONTAL non-nil means return maximum number 819Optional argument HORIZONTAL non-nil means return maximum number
816of columns by which WINDOW can be enlarged. 820of columns by which WINDOW can be enlarged.
817 821
818Optional argument IGNORE non-nil means ignore any restrictions 822Optional argument IGNORE non-nil means ignore restrictions
819imposed by fixed size windows, `window-min-height' or 823imposed by fixed size windows, `window-min-height' or
820`window-min-width' settings. IGNORE a window means ignore 824`window-min-width' settings. If IGNORE is a window, ignore
821restrictions for that window only. IGNORE equal `safe' means 825restrictions for that window only. If IGNORE equals `safe',
822live windows may get as small as `window-safe-min-height' lines 826live windows may get as small as `window-safe-min-height' lines
823and `window-safe-min-width' columns. 827and `window-safe-min-width' columns. Any other non-nil value means
828ignore all of the above restrictions for all windows.
824 829
825Optional argument TRAIL `before' means only windows to the left 830Optional argument TRAIL restricts the windows that can be enlarged.
826of or below WINDOW can be shrunk. Optional argument TRAIL 831If its value is `before', only windows to the left of or above WINDOW
827`after' means only windows to the right of or above WINDOW can be 832can be enlarged. If it is `after', only windows to the right of or
828shrunk. 833below WINDOW can be enlarged.
829 834
830Optional argument NOUP non-nil means don't go up in the window 835Optional argument NOUP non-nil means don't go up in the window
831tree but try to obtain the entire space from windows within 836tree but try to obtain the entire space from windows within
@@ -860,12 +865,13 @@ columns. If WINDOW cannot be shrunk by -DELTA lines or columns,
860return the minimum value in the range DELTA..0 that can be used 865return the minimum value in the range DELTA..0 that can be used
861for shrinking WINDOW. 866for shrinking WINDOW.
862 867
863Optional argument IGNORE non-nil means ignore any restrictions 868Optional argument IGNORE non-nil means ignore restrictions
864imposed by fixed size windows, `window-min-height' or 869imposed by fixed size windows, `window-min-height' or
865`window-min-width' settings. IGNORE a window means ignore 870`window-min-width' settings. If IGNORE is a window, ignore
866restrictions for that window only. IGNORE equal `safe' means 871restrictions for that window only. If IGNORE equals `safe',
867live windows may get as small as `window-safe-min-height' lines 872live windows may get as small as `window-safe-min-height' lines
868and `window-safe-min-width' columns. 873and `window-safe-min-width' columns. Any other non-nil value
874means ignore all of the above restrictions for all windows.
869 875
870Optional argument TRAIL `before' means only windows to the left 876Optional argument TRAIL `before' means only windows to the left
871of or below WINDOW can be shrunk. Optional argument TRAIL 877of or below WINDOW can be shrunk. Optional argument TRAIL
@@ -916,17 +922,18 @@ columns. If WINDOW cannot be shrunk by -DELTA lines or columns,
916return the minimum value in the range DELTA..0 that can be used 922return the minimum value in the range DELTA..0 that can be used
917for shrinking WINDOW. 923for shrinking WINDOW.
918 924
919Optional argument IGNORE non-nil means ignore any restrictions 925Optional argument IGNORE non-nil means ignore restrictions
920imposed by fixed size windows, `window-min-height' or 926imposed by fixed size windows, `window-min-height' or
921`window-min-width' settings. IGNORE a window means ignore 927`window-min-width' settings. If IGNORE is a window, ignore
922restrictions for that window only. IGNORE equal `safe' means 928restrictions for that window only. If IGNORE equals `safe',
923live windows may get as small as `window-safe-min-height' lines 929live windows may get as small as `window-safe-min-height' lines
924and `window-safe-min-width' columns." 930and `window-safe-min-width' columns. Any other non-nil value
931means ignore all of the above restrictions for all windows."
925 (setq window (window-normalize-window window)) 932 (setq window (window-normalize-window window))
926 (window--resizable window delta horizontal ignore)) 933 (window--resizable window delta horizontal ignore))
927 934
928(defun window-total-size (&optional window horizontal) 935(defun window-total-size (&optional window horizontal)
929 "Return the total height or width of window WINDOW. 936 "Return the total height or width of WINDOW.
930If WINDOW is omitted or nil, it defaults to the selected window. 937If WINDOW is omitted or nil, it defaults to the selected window.
931 938
932If HORIZONTAL is omitted or nil, return the total height of 939If HORIZONTAL is omitted or nil, return the total height of
@@ -941,7 +948,7 @@ the total width, in columns, like `window-total-width'."
941 948
942;; See discussion in bug#4543. 949;; See discussion in bug#4543.
943(defun window-full-height-p (&optional window) 950(defun window-full-height-p (&optional window)
944 "Return t if WINDOW is as high as the containing frame. 951 "Return t if WINDOW is as high as its containing frame.
945More precisely, return t if and only if the total height of 952More precisely, return t if and only if the total height of
946WINDOW equals the total height of the root window of WINDOW's 953WINDOW equals the total height of the root window of WINDOW's
947frame. WINDOW can be any window and defaults to the selected 954frame. WINDOW can be any window and defaults to the selected
@@ -951,7 +958,7 @@ one."
951 (window-total-size (frame-root-window window)))) 958 (window-total-size (frame-root-window window))))
952 959
953(defun window-full-width-p (&optional window) 960(defun window-full-width-p (&optional window)
954 "Return t if WINDOW is as wide as the containing frame. 961 "Return t if WINDOW is as wide as its containing frame.
955More precisely, return t if and only if the total width of WINDOW 962More precisely, return t if and only if the total width of WINDOW
956equals the total width of the root window of WINDOW's frame. 963equals the total width of the root window of WINDOW's frame.
957WINDOW can be any window and defaults to the selected one." 964WINDOW can be any window and defaults to the selected one."
@@ -1115,7 +1122,7 @@ SIDE can be any of the symbols `left', `top', `right' or
1115 "Return window in DIRECTION as seen from WINDOW. 1122 "Return window in DIRECTION as seen from WINDOW.
1116DIRECTION must be one of `above', `below', `left' or `right'. 1123DIRECTION must be one of `above', `below', `left' or `right'.
1117WINDOW must be a live window and defaults to the selected one. 1124WINDOW must be a live window and defaults to the selected one.
1118IGNORE, when non-nil means a window can be returned even if its 1125IGNORE non-nil means a window can be returned even if its
1119`no-other-window' parameter is non-nil." 1126`no-other-window' parameter is non-nil."
1120 (setq window (window-normalize-window window t)) 1127 (setq window (window-normalize-window window t))
1121 (unless (memq direction '(above below left right)) 1128 (unless (memq direction '(above below left right))
@@ -1420,7 +1427,7 @@ windows."
1420(defun window--resize-mini-window (window delta) 1427(defun window--resize-mini-window (window delta)
1421 "Resize minibuffer window WINDOW by DELTA lines. 1428 "Resize minibuffer window WINDOW by DELTA lines.
1422If WINDOW cannot be resized by DELTA lines make it as large (or 1429If WINDOW cannot be resized by DELTA lines make it as large (or
1423as small) as possible but don't signal an error." 1430as small) as possible, but don't signal an error."
1424 (when (window-minibuffer-p window) 1431 (when (window-minibuffer-p window)
1425 (let* ((frame (window-frame window)) 1432 (let* ((frame (window-frame window))
1426 (root (frame-root-window frame)) 1433 (root (frame-root-window frame))
@@ -1461,12 +1468,13 @@ horizontally by DELTA columns. In this case a positive DELTA
1461means enlarge WINDOW by DELTA columns. DELTA negative means 1468means enlarge WINDOW by DELTA columns. DELTA negative means
1462WINDOW shall be shrunk by -DELTA columns. 1469WINDOW shall be shrunk by -DELTA columns.
1463 1470
1464Optional argument IGNORE non-nil means ignore any restrictions 1471Optional argument IGNORE non-nil means ignore restrictions
1465imposed by fixed size windows, `window-min-height' or 1472imposed by fixed size windows, `window-min-height' or
1466`window-min-width' settings. IGNORE any window means ignore 1473`window-min-width' settings. If IGNORE is a window, ignore
1467restrictions for that window only. IGNORE equal `safe' means 1474restrictions for that window only. If IGNORE equals `safe',
1468live windows may get as small as `window-safe-min-height' lines 1475live windows may get as small as `window-safe-min-height' lines
1469and `window-safe-min-width' columns. 1476and `window-safe-min-width' columns. Any other non-nil value
1477means ignore all of the above restrictions for all windows.
1470 1478
1471This function resizes other windows proportionally and never 1479This function resizes other windows proportionally and never
1472deletes any windows. If you want to move only the low (right) 1480deletes any windows. If you want to move only the low (right)
@@ -1516,9 +1524,9 @@ HORIZONTAL non-nil means set the new normal width of these
1516windows. WINDOW specifies a child window of PARENT that has been 1524windows. WINDOW specifies a child window of PARENT that has been
1517resized by THIS-DELTA lines (columns). 1525resized by THIS-DELTA lines (columns).
1518 1526
1519Optional argument TRAIL either 'before or 'after means set values 1527Optional argument TRAIL either `before' or `after' means set values
1520for windows before or after WINDOW only. Optional argument 1528only for windows before or after WINDOW. Optional argument
1521OTHER-DELTA a number specifies that this many lines (columns) 1529OTHER-DELTA, a number, specifies that this many lines (columns)
1522have been obtained from (or returned to) an ancestor window of 1530have been obtained from (or returned to) an ancestor window of
1523PARENT in order to resize WINDOW." 1531PARENT in order to resize WINDOW."
1524 (let* ((delta-normal 1532 (let* ((delta-normal
@@ -1618,12 +1626,13 @@ be a horizontally combined internal window.
1618WINDOW, if specified, must denote a child window of PARENT that 1626WINDOW, if specified, must denote a child window of PARENT that
1619is resized by DELTA lines. 1627is resized by DELTA lines.
1620 1628
1621Optional argument IGNORE non-nil means ignore any restrictions 1629Optional argument IGNORE non-nil means ignore restrictions
1622imposed by fixed size windows, `window-min-height' or 1630imposed by fixed size windows, `window-min-height' or
1623`window-min-width' settings. IGNORE equal `safe' means live 1631`window-min-width' settings. If IGNORE equals `safe', live
1624windows may get as small as `window-safe-min-height' lines and 1632windows may get as small as `window-safe-min-height' lines and
1625`window-safe-min-width' columns. IGNORE any window means ignore 1633`window-safe-min-width' columns. If IGNORE is a window, ignore
1626restrictions for that window only. 1634restrictions for that window only. Any other non-nil value means
1635ignore all of the above restrictions for all windows.
1627 1636
1628Optional arguments TRAIL and EDGE, when non-nil, restrict the set 1637Optional arguments TRAIL and EDGE, when non-nil, restrict the set
1629of windows that shall be resized. If TRAIL equals `before', 1638of windows that shall be resized. If TRAIL equals `before',
@@ -1790,12 +1799,13 @@ Optional argument HORIZONTAL non-nil means resize other windows
1790when WINDOW is resized horizontally by DELTA columns. WINDOW 1799when WINDOW is resized horizontally by DELTA columns. WINDOW
1791itself is not resized by this function. 1800itself is not resized by this function.
1792 1801
1793Optional argument IGNORE non-nil means ignore any restrictions 1802Optional argument IGNORE non-nil means ignore restrictions
1794imposed by fixed size windows, `window-min-height' or 1803imposed by fixed size windows, `window-min-height' or
1795`window-min-width' settings. IGNORE equal `safe' means live 1804`window-min-width' settings. If IGNORE equals `safe', live
1796windows may get as small as `window-safe-min-height' lines and 1805windows may get as small as `window-safe-min-height' lines and
1797`window-safe-min-width' columns. IGNORE any window means ignore 1806`window-safe-min-width' columns. If IGNORE is a window, ignore
1798restrictions for that window only. 1807restrictions for that window only. Any other non-nil value means
1808ignore all of the above restrictions for all windows.
1799 1809
1800Optional arguments TRAIL and EDGE, when non-nil, refine the set 1810Optional arguments TRAIL and EDGE, when non-nil, refine the set
1801of windows that shall be resized. If TRAIL equals `before', 1811of windows that shall be resized. If TRAIL equals `before',
@@ -1891,12 +1901,13 @@ preferably only resize windows adjacent to EDGE."
1891Optional argument HORIZONTAL non-nil means resize WINDOW 1901Optional argument HORIZONTAL non-nil means resize WINDOW
1892horizontally by DELTA columns. 1902horizontally by DELTA columns.
1893 1903
1894Optional argument IGNORE non-nil means ignore any restrictions 1904Optional argument IGNORE non-nil means ignore restrictions
1895imposed by fixed size windows, `window-min-height' or 1905imposed by fixed size windows, `window-min-height' or
1896`window-min-width' settings. IGNORE equal `safe' means live 1906`window-min-width' settings. If IGNORE equals `safe', live
1897windows may get as small as `window-safe-min-height' lines and 1907windows may get as small as `window-safe-min-height' lines and
1898`window-safe-min-width' columns. IGNORE any window means ignore 1908`window-safe-min-width' columns. If IGNORE is a window, ignore
1899restrictions for that window only. 1909restrictions for that window only. Any other non-nil value
1910means ignore all of the above restrictions for all windows.
1900 1911
1901Optional argument ADD non-nil means add DELTA to the new total 1912Optional argument ADD non-nil means add DELTA to the new total
1902size of WINDOW. 1913size of WINDOW.
@@ -1986,7 +1997,7 @@ any windows."
1986Optional argument HORIZONTAL non-nil means move WINDOW's right 1997Optional argument HORIZONTAL non-nil means move WINDOW's right
1987edge by DELTA columns. WINDOW defaults to the selected window. 1998edge by DELTA columns. WINDOW defaults to the selected window.
1988 1999
1989If DELTA is greater zero, then move the edge downwards or to the 2000If DELTA is greater than zero, move the edge downwards or to the
1990right. If DELTA is less than zero, move the edge upwards or to 2001right. If DELTA is less than zero, move the edge upwards or to
1991the left. If the edge can't be moved by DELTA lines or columns, 2002the left. If the edge can't be moved by DELTA lines or columns,
1992move it as far as possible in the desired direction." 2003move it as far as possible in the desired direction."
@@ -2091,7 +2102,7 @@ move it as far as possible in the desired direction."
2091 (error "Failed adjusting window %s" window))))))) 2102 (error "Failed adjusting window %s" window)))))))
2092 2103
2093(defun enlarge-window (delta &optional horizontal) 2104(defun enlarge-window (delta &optional horizontal)
2094 "Make selected window DELTA lines taller. 2105 "Make the selected window DELTA lines taller.
2095Interactively, if no argument is given, make the selected window 2106Interactively, if no argument is given, make the selected window
2096one line taller. If optional argument HORIZONTAL is non-nil, 2107one line taller. If optional argument HORIZONTAL is non-nil,
2097make selected window wider by DELTA columns. If DELTA is 2108make selected window wider by DELTA columns. If DELTA is
@@ -2112,7 +2123,7 @@ Return nil."
2112 horizontal)))) 2123 horizontal))))
2113 2124
2114(defun shrink-window (delta &optional horizontal) 2125(defun shrink-window (delta &optional horizontal)
2115 "Make selected window DELTA lines smaller. 2126 "Make the selected window DELTA lines smaller.
2116Interactively, if no argument is given, make the selected window 2127Interactively, if no argument is given, make the selected window
2117one line smaller. If optional argument HORIZONTAL is non-nil, 2128one line smaller. If optional argument HORIZONTAL is non-nil,
2118make selected window narrower by DELTA columns. If DELTA is 2129make selected window narrower by DELTA columns. If DELTA is
diff --git a/src/ChangeLog b/src/ChangeLog
index ae91f04635b..fa6c47bf955 100644
--- a/src/ChangeLog
+++ b/src/ChangeLog
@@ -1,3 +1,30 @@
12012-04-20 Chong Yidong <cyd@gnu.org>
2
3 * process.c (wait_reading_process_output): If EIO occurs on a pty,
4 set the status to "failed" and ensure that sentinel is run.
5
62012-04-20 Glenn Morris <rgm@gnu.org>
7
8 * process.c (Fset_process_inherit_coding_system_flag)
9 (Fset_process_query_on_exit_flag): Doc fix (mention return value).
10 (Fmake_network_process, Fmake_serial_process): Doc fix.
11
122012-04-20 Eli Zaretskii <eliz@gnu.org>
13
14 * xdisp.c (string_buffer_position_lim): Limit starting position to
15 BEGV.
16 (set_cursor_from_row): If called for a mode-line or header-line
17 row, return zero immediately.
18 (try_cursor_movement): If inside continuation line, don't back up
19 farther than the first row after the header line, if any. Don't
20 consider the header-line row as "partially visible", even if
21 MATRIX_ROW_PARTIALLY_VISIBLE_P returns non-zero. (Bug#11261)
22
232012-04-20 Atsuo Ohki <ohki@gssm.otsuka.tsukuba.ac.jp> (tiny change)
24
25 * lread.c (lisp_file_lexically_bound_p): Fix hang at ";-*-\n" (bug#11238).
26
272012-04-20 Teodor Zlatanov <tzz@lifelogs.com>
12012-04-18 Paul Eggert <eggert@cs.ucla.edu> 282012-04-18 Paul Eggert <eggert@cs.ucla.edu>
2 29
3 configure: new option --enable-gcc-warnings (Bug#11207) 30 configure: new option --enable-gcc-warnings (Bug#11207)
diff --git a/src/process.c b/src/process.c
index 2609a9cc250..cf6d40052a7 100644
--- a/src/process.c
+++ b/src/process.c
@@ -1077,7 +1077,9 @@ is more appropriate for saving the process buffer.
1077 1077
1078Binding the variable `inherit-process-coding-system' to non-nil before 1078Binding the variable `inherit-process-coding-system' to non-nil before
1079starting the process is an alternative way of setting the inherit flag 1079starting the process is an alternative way of setting the inherit flag
1080for the process which will run. */) 1080for the process which will run.
1081
1082This function returns FLAG. */)
1081 (register Lisp_Object process, Lisp_Object flag) 1083 (register Lisp_Object process, Lisp_Object flag)
1082{ 1084{
1083 CHECK_PROCESS (process); 1085 CHECK_PROCESS (process);
@@ -1090,7 +1092,8 @@ DEFUN ("set-process-query-on-exit-flag",
1090 2, 2, 0, 1092 2, 2, 0,
1091 doc: /* Specify if query is needed for PROCESS when Emacs is exited. 1093 doc: /* Specify if query is needed for PROCESS when Emacs is exited.
1092If the second argument FLAG is non-nil, Emacs will query the user before 1094If the second argument FLAG is non-nil, Emacs will query the user before
1093exiting or killing a buffer if PROCESS is running. */) 1095exiting or killing a buffer if PROCESS is running. This function
1096returns FLAG. */)
1094 (register Lisp_Object process, Lisp_Object flag) 1097 (register Lisp_Object process, Lisp_Object flag)
1095{ 1098{
1096 CHECK_PROCESS (process); 1099 CHECK_PROCESS (process);
@@ -2532,7 +2535,7 @@ could be "COM1", or "\\\\.\\COM10" for ports higher than COM9 (double
2532the backslashes in strings). 2535the backslashes in strings).
2533 2536
2534:speed SPEED -- (mandatory) is handled by `serial-process-configure', 2537:speed SPEED -- (mandatory) is handled by `serial-process-configure',
2535which is called by `make-serial-process'. 2538which this function calls.
2536 2539
2537:name NAME -- NAME is the name of the process. If NAME is not given, 2540:name NAME -- NAME is the name of the process. If NAME is not given,
2538the value of PORT is used. 2541the value of PORT is used.
@@ -2561,13 +2564,12 @@ but you can send outgoing data. The stopped state is cleared by
2561 2564
2562:plist PLIST -- Install PLIST as the initial plist of the process. 2565:plist PLIST -- Install PLIST as the initial plist of the process.
2563 2566
2564:speed
2565:bytesize 2567:bytesize
2566:parity 2568:parity
2567:stopbits 2569:stopbits
2568:flowcontrol 2570:flowcontrol
2569-- These arguments are handled by `serial-process-configure', which is 2571-- This function calls `serial-process-configure' to handle these
2570called by `make-serial-process'. 2572arguments.
2571 2573
2572The original argument list, possibly modified by later configuration, 2574The original argument list, possibly modified by later configuration,
2573is available via the function `process-contact'. 2575is available via the function `process-contact'.
@@ -2801,7 +2803,7 @@ The stopped state is cleared by `continue-process' and set by
2801:filter-multibyte BOOL -- If BOOL is non-nil, strings given to the 2803:filter-multibyte BOOL -- If BOOL is non-nil, strings given to the
2802process filter are multibyte, otherwise they are unibyte. 2804process filter are multibyte, otherwise they are unibyte.
2803If this keyword is not specified, the strings are multibyte if 2805If this keyword is not specified, the strings are multibyte if
2804`default-enable-multibyte-characters' is non-nil. 2806the default value of `enable-multibyte-characters' is non-nil.
2805 2807
2806:sentinel SENTINEL -- Install SENTINEL as the process sentinel. 2808:sentinel SENTINEL -- Install SENTINEL as the process sentinel.
2807 2809
@@ -4898,16 +4900,23 @@ wait_reading_process_output (int time_limit, int microsecs, int read_kbd,
4898 It can't hurt. */ 4900 It can't hurt. */
4899 else if (nread == -1 && errno == EIO) 4901 else if (nread == -1 && errno == EIO)
4900 { 4902 {
4901 /* Don't do anything if only a pty, with no associated 4903 struct Lisp_Process *p = XPROCESS (proc);
4902 process (bug#10933). */ 4904
4903 if (XPROCESS (proc)->pid != -2) { 4905 /* Clear the descriptor now, so we only raise the
4904 /* Clear the descriptor now, so we only raise the signal 4906 signal once. */
4905 once. */ 4907 FD_CLR (channel, &input_wait_mask);
4906 FD_CLR (channel, &input_wait_mask); 4908 FD_CLR (channel, &non_keyboard_wait_mask);
4907 FD_CLR (channel, &non_keyboard_wait_mask); 4909
4908 4910 if (p->pid == -2)
4909 kill (getpid (), SIGCHLD); 4911 {
4910 } 4912 /* If the EIO occurs on a pty, sigchld_handler's
4913 wait3() will not find the process object to
4914 delete. Do it here. */
4915 p->tick = ++process_tick;
4916 p->status = Qfailed;
4917 }
4918 else
4919 kill (getpid (), SIGCHLD);
4911 } 4920 }
4912#endif /* HAVE_PTYS */ 4921#endif /* HAVE_PTYS */
4913 /* If we can detect process termination, don't consider the 4922 /* If we can detect process termination, don't consider the
diff --git a/src/xdisp.c b/src/xdisp.c
index ea964f4dadc..3cbd4b172f4 100644
--- a/src/xdisp.c
+++ b/src/xdisp.c
@@ -4979,7 +4979,7 @@ string_buffer_position_lim (Lisp_Object string,
4979 Lisp_Object limit, prop, pos; 4979 Lisp_Object limit, prop, pos;
4980 int found = 0; 4980 int found = 0;
4981 4981
4982 pos = make_number (from); 4982 pos = make_number (max (from, BEGV));
4983 4983
4984 if (!back_p) /* looking forward */ 4984 if (!back_p) /* looking forward */
4985 { 4985 {
@@ -13690,6 +13690,13 @@ set_cursor_from_row (struct window *w, struct glyph_row *row,
13690 comes from a text property, not from an overlay. */ 13690 comes from a text property, not from an overlay. */
13691 int string_from_text_prop = 0; 13691 int string_from_text_prop = 0;
13692 13692
13693 /* Don't even try doing anything if called for a mode-line or
13694 header-line row, since the rest of the code isn't prepared to
13695 deal with such calamities. */
13696 xassert (!row->mode_line_p);
13697 if (row->mode_line_p)
13698 return 0;
13699
13693 /* Skip over glyphs not having an object at the start and the end of 13700 /* Skip over glyphs not having an object at the start and the end of
13694 the row. These are special glyphs like truncation marks on 13701 the row. These are special glyphs like truncation marks on
13695 terminal frames. */ 13702 terminal frames. */
@@ -14910,6 +14917,8 @@ try_cursor_movement (Lisp_Object window, struct text_pos startp, int *scroll_ste
14910 else if (rc != CURSOR_MOVEMENT_SUCCESS 14917 else if (rc != CURSOR_MOVEMENT_SUCCESS
14911 && !NILP (BVAR (XBUFFER (w->buffer), bidi_display_reordering))) 14918 && !NILP (BVAR (XBUFFER (w->buffer), bidi_display_reordering)))
14912 { 14919 {
14920 struct glyph_row *row1;
14921
14913 /* If rows are bidi-reordered and point moved, back up 14922 /* If rows are bidi-reordered and point moved, back up
14914 until we find a row that does not belong to a 14923 until we find a row that does not belong to a
14915 continuation line. This is because we must consider 14924 continuation line. This is because we must consider
@@ -14920,24 +14929,28 @@ try_cursor_movement (Lisp_Object window, struct text_pos startp, int *scroll_ste
14920 /* FIXME: Revisit this when glyph ``spilling'' in 14929 /* FIXME: Revisit this when glyph ``spilling'' in
14921 continuation lines' rows is implemented for 14930 continuation lines' rows is implemented for
14922 bidi-reordered rows. */ 14931 bidi-reordered rows. */
14923 while (MATRIX_ROW_CONTINUATION_LINE_P (row)) 14932 for (row1 = MATRIX_FIRST_TEXT_ROW (w->current_matrix);
14933 MATRIX_ROW_CONTINUATION_LINE_P (row);
14934 --row)
14924 { 14935 {
14925 /* If we hit the beginning of the displayed portion 14936 /* If we hit the beginning of the displayed portion
14926 without finding the first row of a continued 14937 without finding the first row of a continued
14927 line, give up. */ 14938 line, give up. */
14928 if (row <= w->current_matrix->rows) 14939 if (row <= row1)
14929 { 14940 {
14930 rc = CURSOR_MOVEMENT_MUST_SCROLL; 14941 rc = CURSOR_MOVEMENT_MUST_SCROLL;
14931 break; 14942 break;
14932 } 14943 }
14933 xassert (row->enabled_p); 14944 xassert (row->enabled_p);
14934 --row;
14935 } 14945 }
14936 } 14946 }
14937 if (must_scroll) 14947 if (must_scroll)
14938 ; 14948 ;
14939 else if (rc != CURSOR_MOVEMENT_SUCCESS 14949 else if (rc != CURSOR_MOVEMENT_SUCCESS
14940 && MATRIX_ROW_PARTIALLY_VISIBLE_P (w, row) 14950 && MATRIX_ROW_PARTIALLY_VISIBLE_P (w, row)
14951 /* Make sure this isn't a header line by any chance, since
14952 then MATRIX_ROW_PARTIALLY_VISIBLE_P might yield non-zero. */
14953 && !row->mode_line_p
14941 && make_cursor_line_fully_visible_p) 14954 && make_cursor_line_fully_visible_p)
14942 { 14955 {
14943 if (PT == MATRIX_ROW_END_CHARPOS (row) 14956 if (PT == MATRIX_ROW_END_CHARPOS (row)