aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorPaul Eggert2016-09-26 13:32:28 -0700
committerPaul Eggert2016-09-26 13:32:28 -0700
commitdcd90f60eb8952d119d97efcef9564ec96def054 (patch)
tree2d3a5bbac64d7fbd94f3af0774218911a522e61f
parentc44ecb77ab33f0a0559c3e5da42fb486d6b014dd (diff)
parent0ffc9cef49b0fceb3c5e904837ea5675fe4306ac (diff)
downloademacs-dcd90f60eb8952d119d97efcef9564ec96def054.tar.gz
emacs-dcd90f60eb8952d119d97efcef9564ec96def054.zip
Merge from origin/emacs-25
0ffc9ce Update admin/authors.el 0ad7410 Update Antinews in ELisp manual ea0f750 Fix comments on window height macros 0bbdeed Fix 'url-http-create-request' when cookies are used 0045998 Fix cross reference in frames.texi 1392894 ; * etc/DEBUG: Minor copyedits. 304a5c8 ; * etc/DEBUG: Improve documentation of getting control to GDB. 56bf7d7 Fix regexp-opt documentation (bug #17862) 803ad6f ; Fix documentation of seq-subseq ed4530d * lisp/emacs-lisp/gv.el (gv-ref): Fix example of PLACE in doc... 88ea396 ; Spelling fixes 17197d0 Fix tags-query-replace docstring 80a7f8b Clarify documentation of precision in format specs 88a5052 Improve and clarify documentation of subprocesses 89eb09f * etc/PROBLEMS: Mention gnutls-cli 3.5.3 (Bug#24247). # Conflicts: # etc/PROBLEMS # src/process.c
-rw-r--r--admin/authors.el2
-rw-r--r--doc/lispref/anti.texi162
-rw-r--r--doc/lispref/elisp.texi2
-rw-r--r--doc/lispref/frames.texi3
-rw-r--r--doc/lispref/processes.texi649
-rw-r--r--doc/lispref/searching.texi52
-rw-r--r--doc/lispref/strings.texi5
-rw-r--r--etc/DEBUG75
-rw-r--r--etc/PROBLEMS19
-rw-r--r--lisp/calendar/calendar.el6
-rw-r--r--lisp/emacs-lisp/gv.el2
-rw-r--r--lisp/emacs-lisp/regexp-opt.el46
-rw-r--r--lisp/emacs-lisp/seq.el2
-rw-r--r--lisp/progmodes/etags.el2
-rw-r--r--lisp/url/url-http.el7
-rw-r--r--src/process.c26
-rw-r--r--src/window.h4
17 files changed, 619 insertions, 445 deletions
diff --git a/admin/authors.el b/admin/authors.el
index 3e9e005e222..198a8e4d260 100644
--- a/admin/authors.el
+++ b/admin/authors.el
@@ -621,6 +621,8 @@ Changes to files in this list are not listed.")
621 ;; windowsnt.h to ms-w32.h. 621 ;; windowsnt.h to ms-w32.h.
622 ("Geoff Voelker" :wrote "w32-fns.el" "w32.c" "w32.h" "w32heap.c" 622 ("Geoff Voelker" :wrote "w32-fns.el" "w32.c" "w32.h" "w32heap.c"
623 "w32heap.h" "w32inevt.c" "w32proc.c" "w32term.c" "ms-w32.h") 623 "w32heap.h" "w32inevt.c" "w32proc.c" "w32term.c" "ms-w32.h")
624 ("Bob Weiner" :changed "dframe.el" "etags.c" "info.el" "quail.el"
625 "rmail.el" "rmailsum.el" "speedbar.el")
624 ("Morten Welinder" :wrote "dosfns.c" "[many MS-DOS files]" "msdos.h") 626 ("Morten Welinder" :wrote "dosfns.c" "[many MS-DOS files]" "msdos.h")
625 ("Eli Zaretskii" :wrote "bidi.c" "[bidirectional display in xdisp.c]" 627 ("Eli Zaretskii" :wrote "bidi.c" "[bidirectional display in xdisp.c]"
626 "[tty menus in term.c]") 628 "[tty menus in term.c]")
diff --git a/doc/lispref/anti.texi b/doc/lispref/anti.texi
index 4b084014994..17d765de142 100644
--- a/doc/lispref/anti.texi
+++ b/doc/lispref/anti.texi
@@ -6,132 +6,110 @@
6@c This node must have no pointers. 6@c This node must have no pointers.
7 7
8@node Antinews 8@node Antinews
9@appendix Emacs 23 Antinews 9@appendix Emacs 24 Antinews
10@c Update the elisp.texi Antinews menu entry with the above version number. 10@c Update the elisp.texi Antinews menu entry with the above version number.
11 11
12For those users who live backwards in time, here is information about 12For those users who live backwards in time, here is information about
13downgrading to Emacs version 23.4. We hope you will enjoy the greater 13downgrading to Emacs version 24.5. We hope you will enjoy the greater
14simplicity that results from the absence of many Emacs @value{EMACSVER} 14simplicity that results from the absence of many Emacs @value{EMACSVER}
15features. 15features.
16 16
17@section Old Lisp Features in Emacs 23 17@section Old Lisp Features in Emacs 24
18 18
19@itemize @bullet 19@itemize @bullet
20@item 20@item
21Support for lexical scoping has been removed; all variables are 21The requirement that @code{setq} and @code{setf} must be called with
22dynamically scoped. The @code{lexical-binding} variable has been 22an even number of arguments has been removed. You can now call them
23removed, and so has the @var{lexical} argument to @code{eval}. The 23with an odd number of arguments, and Emacs will helpfully supply a
24@code{defvar} and @code{defconst} forms no longer mark variables as 24@code{nil} for the missing one. Simplicity rules!
25dynamic, since all variables are dynamic.
26
27Having only dynamic binding follows the spirit of Emacs extensibility,
28for it allows any Emacs code to access any defined variable with a
29minimum of fuss. But @xref{Dynamic Binding Tips}, for tips to avoid
30making your programs hard to understand.
31 25
32@item 26@item
33Calling a minor mode function from Lisp with a @code{nil} or omitted argument 27@kbd{M-x shell} and @kbd{M-x compile} set the @env{EMACS} environment
34does not enable the minor mode unconditionally; instead, it toggles 28variable, as they should, to indicate that the subprocess is run by
35the minor mode---which is the straightforward thing to do, since that 29Emacs. This is so packages that took years to learn how to work
36is the behavior when invoked interactively. One downside is that it 30around that setting could continue using their code to that effect.
37is more troublesome to enable minor modes from hooks; you have to do
38something like
39
40@example
41(add-hook 'foo-hook (lambda () (bar-mode 1)))
42@end example
43
44@noindent
45or define @code{turn-on-bar-mode} and call that from the hook.
46 31
47@item 32@item
48The @code{prog-mode} dummy major mode has been removed. Instead of 33The @code{save-excursion} form saves and restores the mark, as
49using it as a crutch to meet programming mode conventions, you should 34expected. No more need for the new @code{save-mark-and-excursion},
50explicitly ensure that your mode follows those conventions. 35which has been deleted.
51@xref{Major Mode Conventions}.
52 36
53@item 37@item
54Emacs no longer supports bidirectional display and editing. Since 38We have removed the @code{text-quoting-style} variable and the
55there is no need to worry about the insertion of right-to-left text 39associated functionality that translates quote characters in messages
56messing up how lines and paragraphs are displayed, the function 40displayed to the user and in help buffers. Emacs now shows exactly
57@code{bidi-string-mark-left-to-right} has been removed; so have many 41the same quote characters as you wrote in your code! Likewise,
58other functions and variables related to bidirectional display. 42@code{substitute-command-keys} leaves the quote characters alone. As
59Unicode directionality characters like @code{U+200E} LEFT-TO-RIGHT 43you move back in time, Unicode support becomes less and less
60MARK have no special effect on display. 44important, so no need to display those fancy new quotes the Unicode
45Standard invented.
61 46
62@item 47@item
63Emacs windows now have most of their internal state hidden from Lisp. 48Regular expressions have been simplified by removing support for
64Internal windows are no longer visible to Lisp; functions such as 49Unicode character properties in regexp classes. As result,
65@code{window-parent}, window parameters related to window arrangement, 50@code{[:alpha:]} and @code{[:alnum:]} will match any character with a
66and window-local buffer lists have all been removed. Functions for 51word syntax, and @code{[:graph:]} and @code{[:print:]} will match any
67resizing windows can delete windows if they become too small. 52multibyte character, including surrogates and unassigned codepoints.
68 53Once again, this is in line with diminishing importance of Unicode as
69The action-function feature for controlling buffer display has 54you move back in time.
70been removed, including @code{display-buffer-overriding-action} and
71related variables, as well as the @var{action} argument to
72@code{display-buffer} and other functions. The way to
73programmatically control how Emacs chooses a window to display a
74buffer is to bind the right combination of @code{pop-up-frames} and
75other variables.
76 55
77@item 56@item
78The standard completion interface has been simplified, eliminating the 57Evaluating @samp{(/ @var{n})} will now yield @var{n}. We have
79@code{completion-extra-properties} variable, the @code{metadata} 58realized that interpreting that as in Common Lisp was a bad mistake
80action flag for completion functions, and the concept of 59that needed to be corrected.
81completion categories. Lisp programmers may now find the choice
82of methods for tuning completion less bewildering, but if a package
83finds the streamlined interface insufficient for its needs, it must
84implement its own specialized completion feature.
85 60
86@item 61@item
87@code{copy-directory} now behaves the same whether or not the 62The @code{pcase} form was significantly simplified by removing the
88destination is an existing directory: if the destination exists, the 63UPatterns @code{quote} and @code{app}. To further simplify this
89@emph{contents} of the first directory are copied into it (with 64facility, we've removed @code{pcase-defmacro}, since we found no need
90subdirectories handled recursively), rather than copying the first 65for letting Lisp programs define new UPatterns.
91directory into a subdirectory.
92 66
93@item 67@item
94The @var{trash} arguments for @code{delete-file} and 68We've removed the text properties @code{cursor-intangible} and
95@code{delete-directory} have been removed. The variable 69@code{cursor-sensor-functions}, replacing them by the much simpler
96@code{delete-by-moving-to-trash} must now be used with care; whenever 70@code{intangible}, @code{point-entered}, and @code{point-left}
97it is non-@code{nil}, all calls to @code{delete-file} or 71properties. The latter are implemented on a much lower level, and
98@code{delete-directory} use the trash. 72therefore are better integrated with user expectations. For similar
73reasons, @code{cursor-intangible-mode} and @code{cursor-sensor-mode}
74were removed; use the hook variable @code{inhibit-point-motion-hooks}
75which is no longer obsolete.
99 76
100@item 77@item
101Because Emacs no longer supports SELinux file contexts, the 78Process creation and management functions were significantly improved
102@var{preserve-selinux-context} argument to @code{copy-file} has been 79and simplified by removing @code{make-process} and the @code{pipe}
103removed. The return value of @code{backup-buffer} no longer has an 80connection type. Redirecting @code{stderr} of a subprocess should be
104entry for the SELinux file context. 81done with shell facilities, not by Emacs.
105 82
106@item 83@item
107For mouse click input events in the text area, the Y pixel coordinate 84We decided that shutting up informative messages is bad for user
108in the @var{position} list (@pxref{Click Events}) now counts from the 85interaction, so we've removed the @code{inhibit-message} variable
109top of the header line, if there is one, rather than the top of the 86which could be used to that effect.
110text area.
111 87
112@item 88@item
113Bindings in menu keymaps (@pxref{Format of Keymaps}) now sometimes get 89Support for generators and for finalizers has been removed, as we
114an additional @var{cache} entry in their definitions, like this: 90found no real need for these facilities.
115 91
116@example 92@item
117(@var{type} @var{item-name} @var{cache} . @var{binding}) 93Due to excessive complexity and the diminishing need for Unicode
118@end example 94support, the functions @code{string-collate-lessp} and
119 95@code{string-collate-equalp} were removed. Their locale-independent
120@noindent 96counterparts @code{string-lessp} and @code{string-equal} are so much
121The @var{cache} entry is used internally by Emacs to record equivalent 97more simple and yield predictable results that we don't see any
122keyboard key sequences for invoking the same command; Lisp programs 98situation where the locale-dependent collation could be useful in
123should never use it. 99Emacs. As result, the @file{ls-lisp.el} package sorts files in a
124@c Not really NEWS-worthy then... 100locale-independent manner.
125 101
126@item 102@item
127The @code{gnutls} library has been removed, and the function 103In preparation for removal in some past version of Emacs of the
128@code{open-network-stream} correspondingly simplified. 104bidirectional editing support, we started by deleting two functions
129Lisp programs that want an encrypted network connection must now call 105@code{bidi-find-overridden-directionality} and
130external utilities such as @command{starttls} or @command{gnutls-cli}. 106@code{buffer-substring-with-bidi-context}.
131 107
132@item 108@item
133Tool bars can no longer display separators, which frees up several 109Time conversion functions, such as @code{current-time-string}, no
134pixels of space on each graphical frame. 110longer accept an optional @var{zone} argument. If you need to change
111the current time zone (why?), do that explicitly with
112@code{set-time-zone-rule}.
135 113
136@item 114@item
137As part of the ongoing quest for simplicity, many other functions and 115As part of the ongoing quest for simplicity, many other functions and
diff --git a/doc/lispref/elisp.texi b/doc/lispref/elisp.texi
index a3bff0b07ac..3297e5308ae 100644
--- a/doc/lispref/elisp.texi
+++ b/doc/lispref/elisp.texi
@@ -228,7 +228,7 @@ To view this manual in other formats, click
228 228
229Appendices 229Appendices
230 230
231* Antinews:: Info for users downgrading to Emacs 23. 231* Antinews:: Info for users downgrading to Emacs 24.
232* GNU Free Documentation License:: The license for this documentation. 232* GNU Free Documentation License:: The license for this documentation.
233* GPL:: Conditions for copying and changing GNU Emacs. 233* GPL:: Conditions for copying and changing GNU Emacs.
234* Tips:: Advice and coding conventions for Emacs Lisp. 234* Tips:: Advice and coding conventions for Emacs Lisp.
diff --git a/doc/lispref/frames.texi b/doc/lispref/frames.texi
index 53406d114af..7736438126c 100644
--- a/doc/lispref/frames.texi
+++ b/doc/lispref/frames.texi
@@ -1992,8 +1992,7 @@ Window Ordering}.
1992 1992
1993Normally, each frame has its own minibuffer window at the bottom, which 1993Normally, each frame has its own minibuffer window at the bottom, which
1994is used whenever that frame is selected. If the frame has a minibuffer, 1994is used whenever that frame is selected. If the frame has a minibuffer,
1995you can get it with @code{minibuffer-window} (@pxref{Definition of 1995you can get it with @code{minibuffer-window} (@pxref{Minibuffer Windows}).
1996minibuffer-window}).
1997 1996
1998@cindex frame without a minibuffer 1997@cindex frame without a minibuffer
1999@cindex surrogate minibuffer frame 1998@cindex surrogate minibuffer frame
diff --git a/doc/lispref/processes.texi b/doc/lispref/processes.texi
index e54cf301d4e..f9d5096dbea 100644
--- a/doc/lispref/processes.texi
+++ b/doc/lispref/processes.texi
@@ -27,9 +27,18 @@ with the subprocess or to control it. For example, you can send
27signals, obtain status information, receive output from the process, or 27signals, obtain status information, receive output from the process, or
28send input to it. 28send input to it.
29 29
30 In addition to processes that run programs, Lisp programs can open
31connections of several types to devices or processes running on the
32same machine or on other machines. The supported connection types
33are: TCP and UDP network connections, serial port connections, and
34pipe connections. Each such connection is also represented by a
35process object.
36
30@defun processp object 37@defun processp object
31This function returns @code{t} if @var{object} represents an Emacs 38This function returns @code{t} if @var{object} represents an Emacs
32subprocess, @code{nil} otherwise. 39process object, @code{nil} otherwise. The process object can
40represent a subprocess running a program or a connection of any
41supported type.
33@end defun 42@end defun
34 43
35 In addition to subprocesses of the current Emacs session, you can 44 In addition to subprocesses of the current Emacs session, you can
@@ -67,7 +76,7 @@ Processes}.
67@cindex process creation 76@cindex process creation
68 77
69 There are three primitives that create a new subprocess in which to run 78 There are three primitives that create a new subprocess in which to run
70a program. One of them, @code{start-process}, creates an asynchronous 79a program. One of them, @code{make-process}, creates an asynchronous
71process and returns a process object (@pxref{Asynchronous Processes}). 80process and returns a process object (@pxref{Asynchronous Processes}).
72The other two, @code{call-process} and @code{call-process-region}, 81The other two, @code{call-process} and @code{call-process-region},
73create a synchronous process and do not return a process object 82create a synchronous process and do not return a process object
@@ -82,15 +91,14 @@ fashion, their common arguments are described here.
82@cindex execute program 91@cindex execute program
83@cindex @env{PATH} environment variable 92@cindex @env{PATH} environment variable
84@cindex @env{HOME} environment variable 93@cindex @env{HOME} environment variable
85 In all cases, the function's @var{program} argument specifies the 94 In all cases, the functions specify the program to be run. An error
86program to be run. An error is signaled if the file is not found or 95is signaled if the file is not found or cannot be executed. If the
87cannot be executed. If the file name is relative, the variable 96file name is relative, the variable @code{exec-path} contains a list
88@code{exec-path} contains a list of directories to search. Emacs 97of directories to search. Emacs initializes @code{exec-path} when it
89initializes @code{exec-path} when it starts up, based on the value of 98starts up, based on the value of the environment variable @env{PATH}.
90the environment variable @env{PATH}. The standard file name 99The standard file name constructs, @samp{~}, @samp{.}, and @samp{..},
91constructs, @samp{~}, @samp{.}, and @samp{..}, are interpreted as 100are interpreted as usual in @code{exec-path}, but environment variable
92usual in @code{exec-path}, but environment variable substitutions 101substitutions (@samp{$HOME}, etc.)@: are not recognized; use
93(@samp{$HOME}, etc.)@: are not recognized; use
94@code{substitute-in-file-name} to perform them (@pxref{File Name 102@code{substitute-in-file-name} to perform them (@pxref{File Name
95Expansion}). @code{nil} in this list refers to 103Expansion}). @code{nil} in this list refers to
96@code{default-directory}. 104@code{default-directory}.
@@ -106,27 +114,36 @@ system-dependent.
106@end defopt 114@end defopt
107 115
108 @strong{Please note:} The argument @var{program} contains only the 116 @strong{Please note:} The argument @var{program} contains only the
109name of the program; it may not contain any command-line arguments. You 117name of the program file; it may not contain any command-line
110must use a separate argument, @var{args}, to provide those, as 118arguments. You must use a separate argument, @var{args}, to provide
111described below. 119those, as described below.
112 120
113 Each of the subprocess-creating functions has a @var{buffer-or-name} 121 Each of the subprocess-creating functions has a @var{buffer-or-name}
114argument that specifies where the standard output from the program will 122argument that specifies where the output from the program will go. It
115go. It should be a buffer or a buffer name; if it is a buffer name, 123should be a buffer or a buffer name; if it is a buffer name, that will
116that will create the buffer if it does not already exist. It can also 124create the buffer if it does not already exist. It can also be
117be @code{nil}, which says to discard the output, unless a custom filter function 125@code{nil}, which says to discard the output, unless a custom filter
118handles it. (@xref{Filter Functions}, and @ref{Read and Print}.) 126function handles it. (@xref{Filter Functions}, and @ref{Read and
119Normally, you should avoid having multiple processes send output to the 127Print}.) Normally, you should avoid having multiple processes send
120same buffer because their output would be intermixed randomly. 128output to the same buffer because their output would be intermixed
121For synchronous processes, you can send the output to a file instead 129randomly. For synchronous processes, you can send the output to a
122of a buffer. 130file instead of a buffer (and the corresponding argument is therefore
131more appropriately called @var{destination}). By default, both
132standard output and standard error streams go to the same destination,
133but all the 3 primitives allow optionally to direct the standard error
134stream to a different destination.
123 135
124@cindex program arguments 136@cindex program arguments
125 All three of the subprocess-creating functions have a @code{&rest} 137 All three of the subprocess-creating functions allow to specify
126argument, @var{args}. The @var{args} must all be strings, and they are 138command-line arguments for the process to run. For @code{call-process}
127supplied to @var{program} as separate command line arguments. Wildcard 139and @code{call-process-region}, these come in the form of a
128characters and other shell constructs have no special meanings in these 140@code{&rest} argument, @var{args}. For @code{make-process}, both the
129strings, since the strings are passed directly to the specified program. 141program to run and its command-line arguments are specified as a list
142of strings. The command-line arguments must all be strings, and they
143are supplied to the program as separate argument strings. Wildcard
144characters and other shell constructs have no special meanings in
145these strings, since the strings are passed directly to the specified
146program.
130 147
131@cindex environment variables, subprocesses 148@cindex environment variables, subprocesses
132 The subprocess inherits its environment from Emacs, but you can 149 The subprocess inherits its environment from Emacs, but you can
@@ -147,6 +164,7 @@ The value of this variable is a list of directories to search for
147programs to run in subprocesses. Each element is either the name of a 164programs to run in subprocesses. Each element is either the name of a
148directory (i.e., a string), or @code{nil}, which stands for the default 165directory (i.e., a string), or @code{nil}, which stands for the default
149directory (which is the value of @code{default-directory}). 166directory (which is the value of @code{default-directory}).
167@xref{Locating Files, executable-find}, for the details of this search.
150@cindex program directories 168@cindex program directories
151 169
152The value of @code{exec-path} is used by @code{call-process} and 170The value of @code{exec-path} is used by @code{call-process} and
@@ -210,11 +228,11 @@ a shell command:
210 The following two functions are useful for combining a list of 228 The following two functions are useful for combining a list of
211individual command-line argument strings into a single string, and 229individual command-line argument strings into a single string, and
212taking a string apart into a list of individual command-line 230taking a string apart into a list of individual command-line
213arguments. These functions are mainly intended for 231arguments. These functions are mainly intended for converting user
214converting user input in the minibuffer, a Lisp string, into a list of 232input in the minibuffer, a Lisp string, into a list of string
215string arguments to be passed to @code{call-process} or 233arguments to be passed to @code{make-process}, @code{call-process} or
216@code{start-process}, or for converting such lists of arguments into 234@code{start-process}, or for converting such lists of arguments into a
217a single Lisp string to be presented in the minibuffer or echo area. 235single Lisp string to be presented in the minibuffer or echo area.
218Note that if a shell is involved (e.g., if using 236Note that if a shell is involved (e.g., if using
219@code{call-process-shell-command}), arguments should still be 237@code{call-process-shell-command}), arguments should still be
220protected by @code{shell-quote-argument}; 238protected by @code{shell-quote-argument};
@@ -331,7 +349,7 @@ string specifies a file name to redirect error output into.
331You can't directly specify a buffer to put the error output in; that is 349You can't directly specify a buffer to put the error output in; that is
332too difficult to implement. But you can achieve this result by sending 350too difficult to implement. But you can achieve this result by sending
333the error output to a temporary file and then inserting the file into a 351the error output to a temporary file and then inserting the file into a
334buffer. 352buffer when the subprocess finishes.
335@end table 353@end table
336 354
337If @var{display} is non-@code{nil}, then @code{call-process} redisplays 355If @var{display} is non-@code{nil}, then @code{call-process} redisplays
@@ -346,13 +364,15 @@ results become visible on the screen only when Emacs redisplays that
346buffer in the normal course of events. 364buffer in the normal course of events.
347 365
348The remaining arguments, @var{args}, are strings that specify command 366The remaining arguments, @var{args}, are strings that specify command
349line arguments for the program. 367line arguments for the program. Each string is passed to
368@var{program} as a separate argument.
350 369
351The value returned by @code{call-process} (unless you told it not to 370The value returned by @code{call-process} (unless you told it not to
352wait) indicates the reason for process termination. A number gives the 371wait) indicates the reason for process termination. A number gives the
353exit status of the subprocess; 0 means success, and any other value 372exit status of the subprocess; 0 means success, and any other value
354means failure. If the process terminated with a signal, 373means failure. If the process terminated with a signal,
355@code{call-process} returns a string describing the signal. 374@code{call-process} returns a string describing the signal. If you
375told @code{call-process} not to wait, it returns @code{nil}.
356 376
357In the examples below, the buffer @samp{foo} is current. 377In the examples below, the buffer @samp{foo} is current.
358 378
@@ -507,10 +527,10 @@ inputinput@point{}
507 527
508@defun call-process-shell-command command &optional infile destination display 528@defun call-process-shell-command command &optional infile destination display
509This function executes the shell command @var{command} synchronously. 529This function executes the shell command @var{command} synchronously.
510The arguments are handled as in @code{call-process}. An old calling 530The other arguments are handled as in @code{call-process}. An old
511convention allowed passing any number of additional arguments after 531calling convention allowed passing any number of additional arguments
512@var{display}, which were concatenated to @var{command}; this is still 532after @var{display}, which were concatenated to @var{command}; this is
513supported, but strongly discouraged. 533still supported, but strongly discouraged.
514@end defun 534@end defun
515 535
516@defun process-file-shell-command command &optional infile destination display 536@defun process-file-shell-command command &optional infile destination display
@@ -571,33 +591,169 @@ from the process only while waiting for input or for a time delay.
571@cindex pipe 591@cindex pipe
572 An asynchronous process is controlled either via a @dfn{pty} 592 An asynchronous process is controlled either via a @dfn{pty}
573(pseudo-terminal) or a @dfn{pipe}. The choice of pty or pipe is made 593(pseudo-terminal) or a @dfn{pipe}. The choice of pty or pipe is made
574when creating the process, based on the value of the variable 594when creating the process, by default based on the value of the
575@code{process-connection-type} (see below). Ptys are usually 595variable @code{process-connection-type} (see below). If available,
576preferable for processes visible to the user, as in Shell mode, 596ptys are usually preferable for processes visible to the user, as in
577because they allow for job control (@kbd{C-c}, @kbd{C-z}, etc.)@: 597Shell mode, because they allow for job control (@kbd{C-c}, @kbd{C-z},
578between the process and its children, whereas pipes do not. For 598etc.)@: between the process and its children, and because interactive
579subprocesses used for internal purposes by programs, it is often 599programs treat ptys as terminal devices, whereas pipes don't support
580better to use a pipe, because they are more efficient, and because 600these features. However, for subprocesses used by Lisp programs for
581they are immune to stray character injections that ptys introduce for 601internal purposes, it is often better to use a pipe, because pipes are
582large (around 500 byte) messages. Also, the total number of ptys is 602more efficient, and because they are immune to stray character
583limited on many systems and it is good not to waste them. 603injections that ptys introduce for large (around 500 byte) messages.
604Also, the total number of ptys is limited on many systems and it is
605good not to waste them.
606
607@defun make-process &rest args
608This function is the basic low-level primitive for starting
609asynchronous subprocesses. It returns a process object representing
610the subprocess. Compared to the more high-level @code{start-process},
611described below, it takes keyword arguments, is more flexible, and
612allows to specify process filters and sentinels in a single call.
613
614The arguments @var{args} are a list of keyword/argument pairs.
615Omitting a keyword is always equivalent to specifying it with value
616@code{nil}. Here are the meaningful keywords:
617
618@table @asis
619@item :name @var{name}
620Use the string @var{name} as the process name; if a process with this
621name already exists, then @var{name} is modified (by appending
622@samp{<1>}, etc.)@: to be unique.
623
624@item :buffer @var{buffer}
625Use @var{buffer} as the process buffer. If the value is @code{nil},
626the subprocess is not associated with any buffer.
627
628@item :command @var{command}
629Use @var{command} as the command line of the process. The value
630should be a list starting with the program's executable file name,
631followed by strings to give to the program as its arguments. If
632the first element of the list is @code{nil}, Emacs opens a new
633pseudoterminal (pty) and associates its input and output with
634@var{buffer}, without actually running any program; the rest of the
635list elements are ignored in that case.
636
637@item :coding @var{coding}
638If @var{coding} is a symbol, it specifies the coding system to be
639used for both reading and writing of data from and to the
640connection. If @var{coding} is a cons cell
641@w{@code{(@var{decoding} . @var{encoding})}}, then @var{decoding}
642will be used for reading and @var{encoding} for writing. The coding
643system used for encoding the data written to the program is also used
644for encoding the command-line arguments (but not the program itself,
645whose file name is encoded as any other file name; @pxref{Encoding and
646I/O, file-name-coding-system}).
647
648If @var{coding} is @code{nil}, the default rules for finding the
649coding system will apply. @xref{Default Coding Systems}.
650
651@item :connection-type @var{TYPE}
652Initialize the type of device used to communicate with the subprocess.
653Possible values are @code{pty} to use a pty, @code{pipe} to use a
654pipe, or @code{nil} to use the default derived from the value of the
655@code{process-connection-type} variable. This parameter and the value
656of @code{process-connection-type} are ignored if a non-@code{nil}
657value is specified for the @code{:stderr} parameter; in that case, the
658type will always be @code{pipe}.
659
660@item :noquery @var{query-flag}
661Initialize the process query flag to @var{query-flag}.
662@xref{Query Before Exit}.
663
664@item :stop @var{stopped}
665If @var{stopped} is non-@code{nil}, start the process in the
666stopped state.
667
668@item :filter @var{filter}
669Initialize the process filter to @var{filter}. If not specified, a
670default filter will be provided, which can be overridden later.
671@xref{Filter Functions}.
672
673@item :sentinel @var{sentinel}
674Initialize the process sentinel to @var{sentinel}. If not specified,
675a default sentinel will be used, which can be overridden later.
676@xref{Sentinels}.
677
678@item :stderr @var{stderr}
679Associate @var{stderr} with the standard error of the process. A
680non-@code{nil} value should be either a buffer or a pipe process
681created with @code{make-pipe-process}, described below.
682@end table
683
684The original argument list, modified with the actual connection
685information, is available via the @code{process-contact} function.
686@end defun
687
688@defun make-pipe-process &rest args
689This function creates a bidirectional pipe which can be attached to a
690child process. This is useful with the @code{:stderr} keyword of
691@code{make-process}. The function returns a process object.
692
693The arguments @var{args} are a list of keyword/argument pairs.
694Omitting a keyword is always equivalent to specifying it with value
695@code{nil}.
696
697Here are the meaningful keywords:
698
699@table @asis
700@item :name @var{name}
701Use the string @var{name} as the process name. As with
702@code{make-process}, it is modified if necessary to make it unique.
703
704@item :buffer @var{buffer}
705Use @var{buffer} as the process buffer.
706
707@item :coding @var{coding}
708If @var{coding} is a symbol, it specifies the coding system to be
709used for both reading and writing of data from and to the
710connection. If @var{coding} is a cons cell
711@w{@code{(@var{decoding} . @var{encoding})}}, then @var{decoding}
712will be used for reading and @var{encoding} for writing.
713
714If @var{coding} is @code{nil}, the default rules for finding the
715coding system will apply. @xref{Default Coding Systems}.
716
717@item :noquery @var{query-flag}
718Initialize the process query flag to @var{query-flag}.
719@xref{Query Before Exit}.
720
721@item :stop @var{stopped}
722If @var{stopped} is non-@code{nil}, start the process in the
723stopped state.
724
725@item :filter @var{filter}
726Initialize the process filter to @var{filter}. If not specified, a
727default filter will be provided, which can be changed later.
728@xref{Filter Functions}.
729
730@item :sentinel @var{sentinel}
731Initialize the process sentinel to @var{sentinel}. If not specified,
732a default sentinel will be used, which can be changed later.
733@xref{Sentinels}.
734@end table
735
736The original argument list, modified with the actual connection
737information, is available via the @code{process-contact} function.
738@end defun
584 739
585@defun start-process name buffer-or-name program &rest args 740@defun start-process name buffer-or-name program &rest args
586This function creates a new asynchronous subprocess and starts the 741This function is a higher-level wrapper around @code{make-process},
587program @var{program} running in it. It returns a process object that 742exposing an interface that is similar to @code{call-process}. It
588stands for the new subprocess in Lisp. The argument @var{name} 743creates a new asynchronous subprocess and starts the specified
589specifies the name for the process object; if a process with this name 744@var{program} running in it. It returns a process object that stands
590already exists, then @var{name} is modified (by appending @samp{<1>}, 745for the new subprocess in Lisp. The argument @var{name} specifies the
591etc.)@: to be unique. The buffer @var{buffer-or-name} is the buffer to 746name for the process object; as with @code{make-process}, it is
592associate with the process. 747modified if necessary to make it unique. The buffer
748@var{buffer-or-name} is the buffer to associate with the process.
593 749
594If @var{program} is @code{nil}, Emacs opens a new pseudoterminal (pty) 750If @var{program} is @code{nil}, Emacs opens a new pseudoterminal (pty)
595and associates its input and output with @var{buffer-or-name}, without 751and associates its input and output with @var{buffer-or-name}, without
596creating a subprocess. In that case, the remaining arguments 752creating a subprocess. In that case, the remaining arguments
597@var{args} are ignored. 753@var{args} are ignored.
598 754
599The remaining arguments, @var{args}, are strings that specify command 755The rest of @var{args} are strings that specify command line arguments
600line arguments for the subprocess. 756for the subprocess.
601 757
602In the example below, the first process is started and runs (rather, 758In the example below, the first process is started and runs (rather,
603sleeps) for 100 seconds (the output buffer @samp{foo} is created 759sleeps) for 100 seconds (the output buffer @samp{foo} is created
@@ -639,14 +795,14 @@ subprocess running @var{program} in it, and returns its process
639object. 795object.
640 796
641The difference from @code{start-process} is that this function may 797The difference from @code{start-process} is that this function may
642invoked a file handler based on the value of @code{default-directory}. 798invoke a file handler based on the value of @code{default-directory}.
643This handler ought to run @var{program}, perhaps on the local host, 799This handler ought to run @var{program}, perhaps on the local host,
644perhaps on a remote host that corresponds to @code{default-directory}. 800perhaps on a remote host that corresponds to @code{default-directory}.
645In the latter case, the local part of @code{default-directory} becomes 801In the latter case, the local part of @code{default-directory} becomes
646the working directory of the process. 802the working directory of the process.
647 803
648This function does not try to invoke file name handlers for 804This function does not try to invoke file name handlers for
649@var{program} or for the @var{program-args}. 805@var{program} or for the rest of @var{args}.
650 806
651Depending on the implementation of the file handler, it might not be 807Depending on the implementation of the file handler, it might not be
652possible to apply @code{process-filter} or @code{process-sentinel} to 808possible to apply @code{process-filter} or @code{process-sentinel} to
@@ -660,19 +816,20 @@ this function does nothing and returns @code{nil}.
660@end defun 816@end defun
661 817
662@defun start-process-shell-command name buffer-or-name command 818@defun start-process-shell-command name buffer-or-name command
663This function is like @code{start-process}, except that it uses a shell 819This function is like @code{start-process}, except that it uses a
664to execute the specified command. The argument @var{command} is a shell 820shell to execute the specified @var{command}. The argument
665command name. The variable @code{shell-file-name} specifies which shell to 821@var{command} is a shell command string. The variable
666use. 822@code{shell-file-name} specifies which shell to use.
667 823
668The point of running a program through the shell, rather than directly 824The point of running a program through the shell, rather than directly
669with @code{start-process}, is so that you can employ shell features such 825with @code{make-process} or @code{start-process}, is so that you can
670as wildcards in the arguments. It follows that if you include any 826employ shell features such as wildcards in the arguments. It follows
671arbitrary user-specified arguments in the command, you should quote them 827that if you include any arbitrary user-specified arguments in the
672with @code{shell-quote-argument} first, so that any special shell 828command, you should quote them with @code{shell-quote-argument} first,
673characters do @emph{not} have their special shell meanings. @xref{Shell 829so that any special shell characters do @emph{not} have their special
674Arguments}. Of course, when executing commands based on user input 830shell meanings. @xref{Shell Arguments}. Of course, when executing
675you should also consider the security implications. 831commands based on user input you should also consider the security
832implications.
676@end defun 833@end defun
677 834
678@defun start-file-process-shell-command name buffer-or-name command 835@defun start-file-process-shell-command name buffer-or-name command
@@ -687,9 +844,14 @@ asynchronous subprocesses. If it is non-@code{nil}, then ptys are
687used, when available. Otherwise, pipes are used. 844used, when available. Otherwise, pipes are used.
688 845
689The value of @code{process-connection-type} takes effect when 846The value of @code{process-connection-type} takes effect when
690@code{start-process} is called. So you can specify how to communicate 847@code{make-process} or @code{start-process} is called. So you can
691with one subprocess by binding the variable around the call to 848specify how to communicate with one subprocess by binding the variable
692@code{start-process}. 849around the call to these functions.
850
851Note that the value of this variable is ignored when
852@code{make-process} is called with a non-@code{nil} value of the
853@code{:stderr} parameter; in that case, Emacs will communicate with
854the process using pipes.
693 855
694@smallexample 856@smallexample
695@group 857@group
@@ -703,117 +865,6 @@ use the function @code{process-tty-name} (@pxref{Process
703Information}). 865Information}).
704@end defvar 866@end defvar
705 867
706@defun make-process &rest args
707This function is like @code{start-process}, but takes keyword arguments.
708
709The arguments @var{args} are a list of keyword/argument pairs.
710Omitting a keyword is always equivalent to specifying it with value
711@code{nil}. Here are the meaningful keywords:
712
713@table @asis
714@item :name @var{name}
715Use the string @var{name} as the process name. It is modified if
716necessary to make it unique.
717
718@item :buffer @var{buffer}
719Use @var{buffer} as the process buffer.
720
721@item :command @var{command}
722Use @var{command} as the command line of the process. @var{command}
723is a list starting with the program's executable file name, followed
724by strings to give to program as arguments.
725
726@item :coding @var{coding}
727If @var{coding} is a symbol, it specifies the coding system to be
728used for both reading and writing of data from and to the
729connection. If @var{coding} is a cons cell
730@w{@code{(@var{decoding} . @var{encoding})}}, then @var{decoding}
731will be used for reading and @var{encoding} for writing.
732
733If @var{coding} is @code{nil}, the default rules for finding the
734coding system will apply. @xref{Default Coding Systems}.
735
736@item :connection-type @var{TYPE}
737Initialize the type of device used to communicate with the subprocess.
738Possible values are @code{pty} to use a pty, @code{pipe} to use a
739pipe, or @code{nil} to use the default derived from the value of
740the @code{process-connection-type} variable.
741
742@item :noquery @var{query-flag}
743Initialize the process query flag to @var{query-flag}.
744@xref{Query Before Exit}.
745
746@item :stop @var{stopped}
747If @var{stopped} is non-@code{nil}, start the process in the
748stopped state.
749
750@item :filter @var{filter}
751Initialize the process filter to @var{filter}. If not specified, a
752default filter will be provided. @xref{Filter Functions}.
753
754@item :sentinel @var{sentinel}
755Initialize the process sentinel to @var{sentinel}. If not specified,
756a default sentinel will be used. @xref{Sentinels}.
757
758@item :stderr @var{stderr}
759Associate @var{stderr} with the standard error of the process.
760@var{stderr} is either a buffer or a pipe process created with
761@code{make-pipe-process}.
762@end table
763
764The original argument list, modified with the actual connection
765information, is available via the @code{process-contact} function.
766@end defun
767
768@defun make-pipe-process &rest args
769This function creates a bidirectional pipe which can be attached to a
770child process (currently only useful with the @code{:stderr} keyword
771of @code{make-process}).
772
773The arguments @var{args} are a list of keyword/argument pairs.
774Omitting a keyword is always equivalent to specifying it with value
775@code{nil}, except for @code{:coding}.
776Here are the meaningful keywords:
777
778@table @asis
779@item :name @var{name}
780Use the string @var{name} as the process name. It is modified if
781necessary to make it unique.
782
783@item :buffer @var{buffer}
784Use @var{buffer} as the process buffer.
785
786@item :coding @var{coding}
787If @var{coding} is a symbol, it specifies the coding system to be
788used for both reading and writing of data from and to the
789connection. If @var{coding} is a cons cell
790@w{@code{(@var{decoding} . @var{encoding})}}, then @var{decoding}
791will be used for reading and @var{encoding} for writing.
792
793If @var{coding} is @code{nil}, the default rules for finding the
794coding system will apply. @xref{Default Coding Systems}.
795
796@item :noquery @var{query-flag}
797Initialize the process query flag to @var{query-flag}.
798@xref{Query Before Exit}.
799
800@item :stop @var{stopped}
801If @var{stopped} is non-@code{nil}, start the process in the
802stopped state.
803
804@item :filter @var{filter}
805Initialize the process filter to @var{filter}. If not specified, a
806default filter will be provided. @xref{Filter Functions}.
807
808@item :sentinel @var{sentinel}
809Initialize the process sentinel to @var{sentinel}. If not specified,
810a default sentinel will be used. @xref{Sentinels}.
811@end table
812
813The original argument list, modified with the actual connection
814information, is available via the @code{process-contact} function.
815@end defun
816
817@node Deleting Processes 868@node Deleting Processes
818@section Deleting Processes 869@section Deleting Processes
819@cindex deleting processes 870@cindex deleting processes
@@ -843,14 +894,19 @@ they exit.
843 894
844@defun delete-process process 895@defun delete-process process
845This function deletes a process, killing it with a @code{SIGKILL} 896This function deletes a process, killing it with a @code{SIGKILL}
846signal. The argument may be a process, the name of a process, a 897signal if the process was running a program. The argument may be a
847buffer, or the name of a buffer. (A buffer or buffer-name stands for 898process, the name of a process, a buffer, or the name of a buffer. (A
848the process that @code{get-buffer-process} returns.) Calling 899buffer or buffer-name stands for the process that
849@code{delete-process} on a running process terminates it, updates the 900@code{get-buffer-process} returns.) Calling @code{delete-process} on
850process status, and runs the sentinel immediately. If the 901a running process terminates it, updates the process status, and runs
851process has already terminated, calling @code{delete-process} has no 902the sentinel immediately. If the process has already terminated,
852effect on its status, or on the running of its sentinel (which will 903calling @code{delete-process} has no effect on its status, or on the
853happen sooner or later). 904running of its sentinel (which will happen sooner or later).
905
906If the process object represents a network, serial, or pipe
907connection, its status changes to @code{closed}; otherwise, it changes
908to @code{signal}, unless the process already exited. @xref{Process
909Information, process-status}.
854 910
855@smallexample 911@smallexample
856@group 912@group
@@ -892,7 +948,8 @@ This function returns a list of all processes that have not been deleted.
892 948
893@defun get-process name 949@defun get-process name
894This function returns the process named @var{name} (a string), or 950This function returns the process named @var{name} (a string), or
895@code{nil} if there is none. 951@code{nil} if there is none. The argument @var{name} can also be a
952process object, in which case it is returned.
896 953
897@smallexample 954@smallexample
898@group 955@group
@@ -906,7 +963,9 @@ This function returns the process named @var{name} (a string), or
906This function returns the command that was executed to start 963This function returns the command that was executed to start
907@var{process}. This is a list of strings, the first string being the 964@var{process}. This is a list of strings, the first string being the
908program executed and the rest of the strings being the arguments that 965program executed and the rest of the strings being the arguments that
909were given to the program. 966were given to the program. For a network, serial, or pipe connection,
967this is either @code{nil}, which means the process is running or
968@code{t} (process is stopped).
910 969
911@smallexample 970@smallexample
912@group 971@group
@@ -917,18 +976,19 @@ were given to the program.
917@end defun 976@end defun
918 977
919@defun process-contact process &optional key 978@defun process-contact process &optional key
920 979This function returns information about how a network, a serial, or a
921This function returns information about how a network or serial 980pipe connection was set up. When @var{key} is @code{nil}, it returns
922process was set up. When @var{key} is @code{nil}, it returns 981@code{(@var{hostname} @var{service})} for a network connection,
923@code{(@var{hostname} @var{service})} for a network process, and 982@code{(@var{port} @var{speed})} for a serial connection, and @code{t}
924@code{(@var{port} @var{speed})} for a serial process. 983for a pipe connection. For an ordinary child process, this function
925For an ordinary child process, this function always returns @code{t}. 984always returns @code{t} when called with a @code{nil} @var{key}.
926 985
927If @var{key} is @code{t}, the value is the complete status information 986If @var{key} is @code{t}, the value is the complete status information
928for the connection, server, or serial port; that is, the list of 987for the connection, server, serial port, or pipe; that is, the list of
929keywords and values specified in @code{make-network-process} or 988keywords and values specified in @code{make-network-process},
930@code{make-serial-process}, except that some of the values represent 989@code{make-serial-process}, or @code{make-pipe-process}, except that
931the current status instead of what you specified. 990some of the values represent the current status instead of what you
991specified.
932 992
933For a network process, the values include (see 993For a network process, the values include (see
934@code{make-network-process} for a complete list): 994@code{make-network-process} for a complete list):
@@ -953,8 +1013,9 @@ this value is the actual port number.
953@code{:local} and @code{:remote} are included even if they were not 1013@code{:local} and @code{:remote} are included even if they were not
954specified explicitly in @code{make-network-process}. 1014specified explicitly in @code{make-network-process}.
955 1015
956For a serial process, see @code{make-serial-process} and 1016For a serial connection, see @code{make-serial-process} and
957@code{serial-process-configure} for a list of keys. 1017@code{serial-process-configure} for the list of keys. For a pipe
1018connection, see @code{make-pipe-process} for the list of keys.
958 1019
959If @var{key} is a keyword, the function returns the value corresponding 1020If @var{key} is a keyword, the function returns the value corresponding
960to that keyword. 1021to that keyword.
@@ -962,10 +1023,12 @@ to that keyword.
962 1023
963@defun process-id process 1024@defun process-id process
964This function returns the @acronym{PID} of @var{process}. This is an 1025This function returns the @acronym{PID} of @var{process}. This is an
965integer that distinguishes the process @var{process} from all other 1026integral number that distinguishes the process @var{process} from all
966processes running on the same computer at the current time. The 1027other processes running on the same computer at the current time. The
967@acronym{PID} of a process is chosen by the operating system kernel when the 1028@acronym{PID} of a process is chosen by the operating system kernel
968process is started and remains constant as long as the process exists. 1029when the process is started and remains constant as long as the
1030process exists. For network, serial, and pipe connections, this
1031function returns @code{nil}.
969@end defun 1032@end defun
970 1033
971@defun process-name process 1034@defun process-name process
@@ -989,11 +1052,11 @@ for a process that has exited.
989@item signal 1052@item signal
990for a process that has received a fatal signal. 1053for a process that has received a fatal signal.
991@item open 1054@item open
992for a network connection that is open. 1055for a network, serial, or pipe connection that is open.
993@item closed 1056@item closed
994for a network connection that is closed. Once a connection 1057for a network, serial, or pipe connection that is closed. Once a
995is closed, you cannot reopen it, though you might be able to open 1058connection is closed, you cannot reopen it, though you might be able
996a new connection to the same place. 1059to open a new connection to the same place.
997@item connect 1060@item connect
998for a non-blocking connection that is waiting to complete. 1061for a non-blocking connection that is waiting to complete.
999@item failed 1062@item failed
@@ -1011,9 +1074,11 @@ if @var{process-name} is not the name of an existing process.
1011@end group 1074@end group
1012@end smallexample 1075@end smallexample
1013 1076
1014For a network connection, @code{process-status} returns one of the symbols 1077For a network, serial, or pipe connection, @code{process-status}
1015@code{open} or @code{closed}. The latter means that the other side 1078returns one of the symbols @code{open}, @code{stop}, or @code{closed}.
1016closed the connection, or Emacs did @code{delete-process}. 1079The latter means that the other side closed the connection, or Emacs
1080did @code{delete-process}. The value @code{stop} means that
1081@code{stop-process} was called on the connection.
1017@end defun 1082@end defun
1018 1083
1019@defun process-live-p process 1084@defun process-live-p process
@@ -1024,24 +1089,29 @@ process is considered alive if its status is @code{run}, @code{open},
1024 1089
1025@defun process-type process 1090@defun process-type process
1026This function returns the symbol @code{network} for a network 1091This function returns the symbol @code{network} for a network
1027connection or server, @code{serial} for a serial port connection, or 1092connection or server, @code{serial} for a serial port connection,
1028@code{real} for a real subprocess. 1093@code{pipe} for a pipe connection, or @code{real} for a subprocess
1094created for running a program.
1029@end defun 1095@end defun
1030 1096
1031@defun process-exit-status process 1097@defun process-exit-status process
1032This function returns the exit status of @var{process} or the signal 1098This function returns the exit status of @var{process} or the signal
1033number that killed it. (Use the result of @code{process-status} to 1099number that killed it. (Use the result of @code{process-status} to
1034determine which of those it is.) If @var{process} has not yet 1100determine which of those it is.) If @var{process} has not yet
1035terminated, the value is 0. 1101terminated, the value is 0. For network, serial, and pipe connections
1102that are already closed, the value is either 0 or 256, depending on
1103whether the connection was closed normally or abnormally.
1036@end defun 1104@end defun
1037 1105
1038@defun process-tty-name process 1106@defun process-tty-name process
1039This function returns the terminal name that @var{process} is using for 1107This function returns the terminal name that @var{process} is using for
1040its communication with Emacs---or @code{nil} if it is using pipes 1108its communication with Emacs---or @code{nil} if it is using pipes
1041instead of a terminal (see @code{process-connection-type} in 1109instead of a pty (see @code{process-connection-type} in
1042@ref{Asynchronous Processes}). If @var{process} represents a program 1110@ref{Asynchronous Processes}). If @var{process} represents a program
1043running on a remote host, the terminal name used by that program on 1111running on a remote host, the terminal name used by that program on
1044the remote host is provided as process property @code{remote-tty}. 1112the remote host is provided as process property @code{remote-tty}. If
1113@var{process} represents a network, serial, or pipe connection, the
1114value is @code{nil}.
1045@end defun 1115@end defun
1046 1116
1047@defun process-coding-system process 1117@defun process-coding-system process
@@ -1085,8 +1155,10 @@ This function sets the process plist of @var{process} to @var{plist}.
1085 1155
1086 Asynchronous subprocesses receive input when it is sent to them by 1156 Asynchronous subprocesses receive input when it is sent to them by
1087Emacs, which is done with the functions in this section. You must 1157Emacs, which is done with the functions in this section. You must
1088specify the process to send input to, and the input data to send. The 1158specify the process to send input to, and the input data to send. If
1089data appears on the standard input of the subprocess. 1159the subprocess runs a program, the data appears on the standard input
1160of that program; for connections, the data is sent to the connected
1161device or program.
1090 1162
1091@c FIXME which? 1163@c FIXME which?
1092 Some operating systems have limited space for buffered input in a 1164 Some operating systems have limited space for buffered input in a
@@ -1149,12 +1221,14 @@ The function returns @var{process}.
1149@end defun 1221@end defun
1150 1222
1151@defun process-running-child-p &optional process 1223@defun process-running-child-p &optional process
1152This function will tell you whether a @var{process} has given control 1224This function will tell you whether a @var{process}, which must not be
1153of its terminal to its own child process. If this is true, the 1225a connection but a real subprocess, has given control of its terminal
1154function returns the numeric ID of the foreground process group of 1226to a child process of its own. If this is true, the function returns
1155@var{process}; it returns @code{nil} if Emacs can be certain that this 1227the numeric ID of the foreground process group of @var{process}; it
1156is not so. The value is @code{t} if Emacs cannot tell whether this is 1228returns @code{nil} if Emacs can be certain that this is not so. The
1157true. 1229value is @code{t} if Emacs cannot tell whether this is true. This
1230function signals an error if @var{process} is a network, serial, or
1231pipe connection, or is the subprocess is not active.
1158@end defun 1232@end defun
1159 1233
1160@node Signals to Processes 1234@node Signals to Processes
@@ -1187,17 +1261,22 @@ user ``hung up the phone'', i.e., disconnected.)
1187 The argument @var{process} must be either a process, a process 1261 The argument @var{process} must be either a process, a process
1188name, a buffer, a buffer name, or @code{nil}. A buffer or buffer name 1262name, a buffer, a buffer name, or @code{nil}. A buffer or buffer name
1189stands for a process through @code{get-buffer-process}. @code{nil} 1263stands for a process through @code{get-buffer-process}. @code{nil}
1190stands for the process associated with the current buffer. An error 1264stands for the process associated with the current buffer. Except
1191is signaled if @var{process} does not identify a process. 1265with @code{stop-process} and @code{continue-process}, an error is
1266signaled if @var{process} does not identify an active process, or if
1267it represents a network, serial, or pipe connection.
1192 1268
1193 The argument @var{current-group} is a flag that makes a difference 1269 The argument @var{current-group} is a flag that makes a difference
1194when you are running a job-control shell as an Emacs subprocess. If it 1270when you are running a job-control shell as an Emacs subprocess. If it
1195is non-@code{nil}, then the signal is sent to the current process-group 1271is non-@code{nil}, then the signal is sent to the current process-group
1196of the terminal that Emacs uses to communicate with the subprocess. If 1272of the terminal that Emacs uses to communicate with the subprocess. If
1197the process is a job-control shell, this means the shell's current 1273the process is a job-control shell, this means the shell's current
1198subjob. If it is @code{nil}, the signal is sent to the process group of 1274subjob. If @var{current-group} is @code{nil}, the signal is
1199the immediate subprocess of Emacs. If the subprocess is a job-control 1275sent to the process group of the immediate subprocess of Emacs. If
1200shell, this is the shell itself. 1276the subprocess is a job-control shell, this is the shell itself. If
1277@var{current-group} is @code{lambda}, the signal is sent to the
1278process-group that owns the terminal, but only if it is not the shell
1279itself.
1201 1280
1202 The flag @var{current-group} has no effect when a pipe is used to 1281 The flag @var{current-group} has no effect when a pipe is used to
1203communicate with the subprocess, because the operating system does not 1282communicate with the subprocess, because the operating system does not
@@ -1228,21 +1307,29 @@ Emacs.
1228@end defun 1307@end defun
1229 1308
1230@defun stop-process &optional process current-group 1309@defun stop-process &optional process current-group
1231This function stops the process @var{process} by sending the 1310This function stops the specified @var{process}. If it is a real
1232signal @code{SIGTSTP}. Use @code{continue-process} to resume its 1311subprocess running a program, it sends the signal @code{SIGTSTP} to
1312that subprocess. If @var{process} represents a network, serial, or
1313pipe connection, this function inhibits handling of the incoming data
1314from the connection; for a network server, this means not accepting
1315new connections. Use @code{continue-process} to resume normal
1233execution. 1316execution.
1234 1317
1235Outside of Emacs, on systems with job control, the stop character 1318Outside of Emacs, on systems with job control, the stop character
1236(usually @kbd{C-z}) normally sends this signal. When 1319(usually @kbd{C-z}) normally sends the @code{SIGTSTP} signal to a
1237@var{current-group} is non-@code{nil}, you can think of this function as 1320subprocess. When @var{current-group} is non-@code{nil}, you can think
1238typing @kbd{C-z} on the terminal Emacs uses to communicate with the 1321of this function as typing @kbd{C-z} on the terminal Emacs uses to
1239subprocess. 1322communicate with the subprocess.
1240@end defun 1323@end defun
1241 1324
1242@defun continue-process &optional process current-group 1325@defun continue-process &optional process current-group
1243This function resumes execution of the process @var{process} by sending 1326This function resumes execution of the process @var{process}. If it
1244it the signal @code{SIGCONT}. This presumes that @var{process} was 1327is a real subprocess running a program, it sends the signal
1245stopped previously. 1328@code{SIGCONT} to that subprocess; this presumes that @var{process}
1329was stopped previously. If @var{process} represents a network,
1330serial, or pipe connection, this function resumes handling of the
1331incoming data from the connection. For serial connections, data that
1332arrived during the time the process was stopped might be lost.
1246@end defun 1333@end defun
1247 1334
1248@deffn Command signal-process process signal 1335@deffn Command signal-process process signal
@@ -1260,12 +1347,28 @@ children of Emacs. @xref{System Processes}.
1260@cindex process output 1347@cindex process output
1261@cindex output from processes 1348@cindex output from processes
1262 1349
1263 The output that a subprocess writes to its standard output stream 1350 The output that an asynchronous subprocess writes to its standard
1264is passed to a function called the @dfn{filter function}. The default 1351output stream is passed to a function called the @dfn{filter
1265filter function simply inserts the output into a buffer, which is 1352function}. The default filter function simply inserts the output into
1266called the associated buffer of the process (@pxref{Process 1353a buffer, which is called the associated buffer of the process
1267Buffers}). If the process has no buffer then the default filter 1354(@pxref{Process Buffers}). If the process has no buffer then the
1268discards the output. 1355default filter discards the output.
1356
1357 If the subprocess writes to its standard error stream, by default
1358the error output is also passed to the process filter function. If
1359Emacs uses a pseudo-TTY (pty) for communication with the subprocess,
1360then it is impossible to separate the standard output and standard
1361error streams of the subprocess, because a pseudo-TTY has only one
1362output channel. In that case, if you want to keep the output to those
1363streams separate, you should redirect one of them to a file---for
1364example, by using an appropriate shell command via
1365@code{start-process-shell-command} or a similar function.
1366
1367 Alternatively, you could use the @code{:stderr} parameter with a
1368non-@code{nil} value in a call to @code{make-process}
1369(@pxref{Asynchronous Processes, make-process}) to make the destination
1370of the error output separate from the standard output; in that case,
1371Emacs will use pipes for communicating with the subprocess.
1269 1372
1270 When a subprocess terminates, Emacs reads any pending output, 1373 When a subprocess terminates, Emacs reads any pending output,
1271then stops reading output from that subprocess. Therefore, if the 1374then stops reading output from that subprocess. Therefore, if the
@@ -1292,13 +1395,6 @@ from such processes, thus allowing them to produce more output before
1292Emacs tries to read it. 1395Emacs tries to read it.
1293@end defvar 1396@end defvar
1294 1397
1295 It is impossible to separate the standard output and standard error
1296streams of the subprocess, because Emacs normally spawns the subprocess
1297inside a pseudo-TTY, and a pseudo-TTY has only one output channel. If
1298you want to keep the output to those streams separate, you should
1299redirect one of them to a file---for example, by using an appropriate
1300shell command.
1301
1302@menu 1398@menu
1303* Process Buffers:: By default, output is put in a buffer. 1399* Process Buffers:: By default, output is put in a buffer.
1304* Filter Functions:: Filter functions accept output from the process. 1400* Filter Functions:: Filter functions accept output from the process.
@@ -1333,7 +1429,7 @@ Before Exit}). This confirmation is done by the function
1333@code{kill-buffer-query-functions} (@pxref{Killing Buffers}). 1429@code{kill-buffer-query-functions} (@pxref{Killing Buffers}).
1334 1430
1335@defun process-buffer process 1431@defun process-buffer process
1336This function returns the associated buffer of the process 1432This function returns the associated buffer of the specified
1337@var{process}. 1433@var{process}.
1338 1434
1339@smallexample 1435@smallexample
@@ -1455,6 +1551,11 @@ standard output from the associated process. @emph{All} output from
1455that process is passed to the filter. The default filter simply 1551that process is passed to the filter. The default filter simply
1456outputs directly to the process buffer. 1552outputs directly to the process buffer.
1457 1553
1554 By default, the error output from the process, if any, is also
1555passed to the filter function, unless the destination for the standard
1556error stream of the process was separated from the standard output
1557when the process was created (@pxref{Output from Processes}).
1558
1458 The filter function can only be called when Emacs is waiting for 1559 The filter function can only be called when Emacs is waiting for
1459something, because process output arrives only at such times. Emacs 1560something, because process output arrives only at such times. Emacs
1460waits when reading terminal input (see the function 1561waits when reading terminal input (see the function
@@ -1478,8 +1579,8 @@ cases, the right way to do this is with the macro
1478caught automatically, so that it doesn't stop the execution of whatever 1579caught automatically, so that it doesn't stop the execution of whatever
1479program was running when the filter function was started. However, if 1580program was running when the filter function was started. However, if
1480@code{debug-on-error} is non-@code{nil}, errors are not caught. 1581@code{debug-on-error} is non-@code{nil}, errors are not caught.
1481This makes it possible to use the Lisp debugger to debug the 1582This makes it possible to use the Lisp debugger to debug filter
1482filter function. @xref{Debugger}. 1583functions. @xref{Debugger}.
1483 1584
1484 Many filter functions sometimes (or always) insert the output in the 1585 Many filter functions sometimes (or always) insert the output in the
1485process's buffer, mimicking the actions of the default filter. 1586process's buffer, mimicking the actions of the default filter.
@@ -1517,8 +1618,8 @@ text arrives, you could insert a line like the following just before the
1517@end smallexample 1618@end smallexample
1518 1619
1519 To force point to the end of the new output, no matter where it was 1620 To force point to the end of the new output, no matter where it was
1520previously, eliminate the variable @code{moving} and call 1621previously, eliminate the variable @code{moving} from the example and
1521@code{goto-char} unconditionally. 1622call @code{goto-char} unconditionally.
1522 1623
1523@ignore 1624@ignore
1524 In earlier Emacs versions, every filter function that did regular 1625 In earlier Emacs versions, every filter function that did regular
@@ -1841,10 +1942,11 @@ was not.
1841@node Query Before Exit 1942@node Query Before Exit
1842@section Querying Before Exit 1943@section Querying Before Exit
1843 1944
1844 When Emacs exits, it terminates all its subprocesses by sending them 1945 When Emacs exits, it terminates all its subprocesses. For
1845the @code{SIGHUP} signal. Because subprocesses may be doing 1946subprocesses that run a program, it sends them the @code{SIGHUP}
1846valuable work, Emacs normally asks the user to confirm that it is ok 1947signal; connections are simply closed. Because subprocesses may be
1847to terminate them. Each process has a query flag, which, if 1948doing valuable work, Emacs normally asks the user to confirm that it
1949is ok to terminate them. Each process has a query flag, which, if
1848non-@code{nil}, says that Emacs should ask for confirmation before 1950non-@code{nil}, says that Emacs should ask for confirmation before
1849exiting and thus killing that process. The default for the query flag 1951exiting and thus killing that process. The default for the query flag
1850is @code{t}, meaning @emph{do} query. 1952is @code{t}, meaning @emph{do} query.
@@ -2138,13 +2240,14 @@ the @code{open-network-stream} function described below.
2138 To distinguish the different types of processes, the 2240 To distinguish the different types of processes, the
2139@code{process-type} function returns the symbol @code{network} for a 2241@code{process-type} function returns the symbol @code{network} for a
2140network connection or server, @code{serial} for a serial port 2242network connection or server, @code{serial} for a serial port
2141connection, or @code{real} for a real subprocess. 2243connection, @code{pipe} for a pipe connection, or @code{real} for a
2244real subprocess.
2142 2245
2143 The @code{process-status} function returns @code{open}, 2246 The @code{process-status} function returns @code{open},
2144@code{closed}, @code{connect}, or @code{failed} for network 2247@code{closed}, @code{connect}, @code{stop}, or @code{failed} for
2145connections. For a network server, the status is always 2248network connections. For a network server, the status is always
2146@code{listen}. None of those values is possible for a real 2249@code{listen}. Except for @code{stop}, none of those values is
2147subprocess. @xref{Process Information}. 2250possible for a real subprocess. @xref{Process Information}.
2148 2251
2149 You can stop and resume operation of a network process by calling 2252 You can stop and resume operation of a network process by calling
2150@code{stop-process} and @code{continue-process}. For a server 2253@code{stop-process} and @code{continue-process}. For a server
diff --git a/doc/lispref/searching.texi b/doc/lispref/searching.texi
index a04e6938cef..f627c882fae 100644
--- a/doc/lispref/searching.texi
+++ b/doc/lispref/searching.texi
@@ -948,26 +948,42 @@ possible. A hand-tuned regular expression can sometimes be slightly
948more efficient, but is almost never worth the effort.}. 948more efficient, but is almost never worth the effort.}.
949@c E.g., see http://debbugs.gnu.org/2816 949@c E.g., see http://debbugs.gnu.org/2816
950 950
951If the optional argument @var{paren} is non-@code{nil}, then the 951The optional argument @var{paren} can be any of the following:
952returned regular expression is always enclosed by at least one 952
953parentheses-grouping construct. If @var{paren} is @code{words}, then 953a string
954that construct is additionally surrounded by @samp{\<} and @samp{\>}; 954 the resulting regexp is preceded by @var{paren} and followed by
955alternatively, if @var{paren} is @code{symbols}, then that construct 955 @samp{\)}, e.g. use @samp{"\\(?1:"} to produce an explicitly
956is additionally surrounded by @samp{\_<} and @samp{\_>} 956 numbered group.
957(@code{symbols} is often appropriate when matching 957
958programming-language keywords and the like). 958@code{words}
959 959 the resulting regexp is surrounded by @samp{\<\(} and @samp{\)\>}.
960This simplified definition of @code{regexp-opt} produces a 960
961regular expression which is equivalent to the actual value 961@code{symbols}
962(but not as efficient): 962 the resulting regexp is surrounded by @samp{\_<\(} and @samp{\)\_>}
963 (this is often appropriate when maching programming-language
964 keywords and the like).
965
966non-@code{nil}
967 the resulting regexp is surrounded by @samp{\(} and @samp{\)}.
968
969@code{nil}
970 the resulting regexp is surrounded by @samp{\(?:} and @samp{\)},
971 if it is necessary to ensure that a postfix operator appended to
972 it will apply to the whole expression.
973
974The resulting regexp of @code{regexp-opt} is equivalent to but usually
975more efficient than that of a simplified version:
963 976
964@example 977@example
965(defun regexp-opt (strings &optional paren) 978(defun simplified-regexp-opt (strings &optional paren)
966 (let ((open-paren (if paren "\\(" "")) 979 (let ((parens (cond ((stringp paren) (cons paren "\\)"))
967 (close-paren (if paren "\\)" ""))) 980 ((eq paren 'words) '("\\<\\(" . "\\)\\>"))
968 (concat open-paren 981 ((eq paren 'symbols) '("\\_<\\(" . "\\)\\_>"))
969 (mapconcat 'regexp-quote strings "\\|") 982 ((null paren) '("\\(?:" . "\\)"))
970 close-paren))) 983 (t '("\\(" . "\\)")))))
984 (concat (car paren)
985 (mapconcat 'regexp-quote strings "\\|")
986 (cdr paren))))
971@end example 987@end example
972@end defun 988@end defun
973 989
diff --git a/doc/lispref/strings.texi b/doc/lispref/strings.texi
index 0b9529460f3..c5a6cb264d8 100644
--- a/doc/lispref/strings.texi
+++ b/doc/lispref/strings.texi
@@ -1060,8 +1060,9 @@ precision specifies how many decimal places to show; if zero, the
1060decimal-point itself is also omitted. For @samp{%s} and @samp{%S}, 1060decimal-point itself is also omitted. For @samp{%s} and @samp{%S},
1061the precision truncates the string to the given width, so @samp{%.3s} 1061the precision truncates the string to the given width, so @samp{%.3s}
1062shows only the first three characters of the representation for 1062shows only the first three characters of the representation for
1063@var{object}. Precision has no effect for other specification 1063@var{object}. For other specification characters, the effect of
1064characters. 1064precision is what the local library functions of the @code{printf}
1065family produce.
1065 1066
1066@node Case Conversion 1067@node Case Conversion
1067@section Case Conversion in Lisp 1068@section Case Conversion in Lisp
diff --git a/etc/DEBUG b/etc/DEBUG
index 656e29a8b74..03efa3b10dd 100644
--- a/etc/DEBUG
+++ b/etc/DEBUG
@@ -190,24 +190,44 @@ kick in, provided that you run under GDB.
190 190
191** Getting control to the debugger 191** Getting control to the debugger
192 192
193Setting a breakpoint in a strategic place, after loading Emacs into
194the debugger, but before running it, is the most efficient way of
195making sure control will be returned to the debugger when you need
196that.
197
193'Fsignal' is a very useful place to put a breakpoint in. All Lisp 198'Fsignal' is a very useful place to put a breakpoint in. All Lisp
194errors go through there. If you are only interested in errors that 199errors go through there. If you are only interested in errors that
195would fire the debugger, breaking at 'maybe_call_debugger' is useful. 200would fire the Lisp debugger, breaking at 'maybe_call_debugger' is
201useful.
202
203Another technique for get control to the debugger is to put a
204breakpoint in some rarely used function. One such convenient function
205is Fredraw_display, which you can invoke at will interactively with
206"M-x redraw-display RET".
196 207
197It is useful, when debugging, to have a guaranteed way to return to 208It is also useful to have a guaranteed way to return to the debugger
198the debugger at any time. When using X, this is easy: type C-z at the 209at any arbitrary time. When using X, this is easy: type C-z at the
199window where Emacs is running under GDB, and it will stop Emacs just 210window where you are interacting with GDB, and it will stop Emacs just
200as it would stop any ordinary program. When Emacs is running in a 211as it would stop any ordinary program. (This doesn't work if GDB was
201terminal, things are not so easy. 212attached to a running Emacs process; in that case, you will need to
213type C-z to the shell window from which Emacs was started, or use the
214"kill -TSTP" method described below.)
215
216When Emacs is displaying on a text terminal, things are not so easy,
217so we describe the various alternatives below (however, those of them
218that use signals only work on Posix systems).
202 219
203The src/.gdbinit file in the Emacs distribution arranges for SIGINT 220The src/.gdbinit file in the Emacs distribution arranges for SIGINT
204(C-g in Emacs) to be passed to Emacs and not give control back to GDB. 221(C-g in Emacs on a text-mode frame) to be passed to Emacs and not give
205On modern POSIX systems, you can override that with this command: 222control back to GDB. On modern systems, you can override that with
223this command:
206 224
207 handle SIGINT stop nopass 225 handle SIGINT stop nopass
208 226
209After this 'handle' command, SIGINT will return control to GDB. If 227After this 'handle' command, SIGINT will return control to GDB. If
210you want the C-g to cause a QUIT within Emacs as well, omit the 'nopass'. 228you want the C-g to cause a QUIT within Emacs as well, omit the 'nopass'.
229See the GDB manual for more details about signal handling and the
230'handle' command.
211 231
212A technique that can work when 'handle SIGINT' does not is to store 232A technique that can work when 'handle SIGINT' does not is to store
213the code for some character into the variable stop_character. Thus, 233the code for some character into the variable stop_character. Thus,
@@ -216,26 +236,37 @@ the code for some character into the variable stop_character. Thus,
216 236
217makes Control-] (decimal code 29) the stop character. 237makes Control-] (decimal code 29) the stop character.
218Typing Control-] will cause immediate stop. You cannot 238Typing Control-] will cause immediate stop. You cannot
219use the set command until the inferior process has been started. 239use the set command until the inferior process has been started, so
220Put a breakpoint early in 'main', or suspend the Emacs, 240start Emacs with the 'start' command, to get an opportunity to do the
221to get an opportunity to do the set command. 241above 'set' command.
222 242
223Another technique for get control to the debugger is to put a 243On a Posix host, you can also send a signal using the 'kill' command
224breakpoint in some rarely used function. One such convenient function 244from a shell prompt, like this:
225is Fredraw_display, which you can invoke at will interactively with
226"M-x redraw-display RET".
227 245
228When Emacs is running in a terminal, it is sometimes useful to use a separate 246 kill -TSTP Emacs-PID
229terminal for the debug session. This can be done by starting Emacs as usual,
230then attaching to it from gdb with the 'attach' command which is explained in
231the node "Attach" of the GDB manual.
232 247
233On MS-Windows, you can start Emacs in its own separate terminal by 248where Emacs-PID is the process ID of Emacs being debugged. Other
234setting the new-console option before running Emacs under GDB: 249useful signals to send are SIGUSR1 and SIGUSR2; see "Error Debugging"
250in the ELisp manual for how to use those.
251
252When Emacs is displaying on a text terminal, it is useful to have a
253separate terminal for the debug session. This can be done by starting
254Emacs as usual, then attaching to it from gdb with the 'attach'
255command which is explained in the node "Attach" of the GDB manual.
256
257On MS-Windows, you can alternatively start Emacs from its own separate
258console by setting the new-console option before running Emacs under
259GDB:
235 260
236 (gdb) set new-console 1 261 (gdb) set new-console 1
237 (gdb) run 262 (gdb) run
238 263
264If you do this, then typing C-c or C-BREAK into the console window
265through which you interact with GDB will stop Emacs and return control
266to the debugger, no matter if Emacs displays GUI or text-mode frames.
267This is the only reliable alternative on MS-Windows to get control to
268the debugger, besides setting breakpoints in advance.
269
239** Examining Lisp object values. 270** Examining Lisp object values.
240 271
241When you have a live process to debug, and it has not encountered a 272When you have a live process to debug, and it has not encountered a
@@ -848,7 +879,7 @@ directed to the xterm window you opened above.
848Similar arrangement is possible on a character terminal by using the 879Similar arrangement is possible on a character terminal by using the
849'screen' package. 880'screen' package.
850 881
851On MS-Windows, you can start Emacs in its own separate terminal by 882On MS-Windows, you can start Emacs in its own separate console by
852setting the new-console option before running Emacs under GDB: 883setting the new-console option before running Emacs under GDB:
853 884
854 (gdb) set new-console 1 885 (gdb) set new-console 1
diff --git a/etc/PROBLEMS b/etc/PROBLEMS
index 11532832c38..2e1044f16ea 100644
--- a/etc/PROBLEMS
+++ b/etc/PROBLEMS
@@ -578,6 +578,25 @@ you have a personal configuration file (normally ~/.aspell.conf), it
578can cause this error. Remove that file, execute 'ispell-kill-ispell' 578can cause this error. Remove that file, execute 'ispell-kill-ispell'
579in Emacs, and then try spell-checking again. 579in Emacs, and then try spell-checking again.
580 580
581*** Emacs eats all file descriptors when using kqueue file notifications.
582See <http://debbugs.gnu.org/22814>.
583
584When you have a large number of buffers running auto-revert-mode, and
585Emacs is configured to use the kqueue file notification library, it
586uses an own file descriptor for every watched file. On systems with a
587small limit of file descriptors allowed per process, like OS X, you
588could run out of file descriptors. You won't be able to open new files.
589
590auto-revert-use-notify is set to nil in global-auto-revert-mode, therefore.
591
592*** TLS problems, e.g., Gnus hangs when fetching via imaps
593http://debbugs.gnu.org/24247
594
595gnutls-cli 3.5.3 (2016-08-09) does not generate a "- Handshake was
596completed" message that tls.el relies upon, causing affected Emacs
597functions to hang. To work around the problem, use older or newer
598versions of gnutls-cli, or use Emacs's built-in gnutls support.
599
581* Runtime problems related to font handling 600* Runtime problems related to font handling
582 601
583** Characters are displayed as empty boxes or with wrong font under X. 602** Characters are displayed as empty boxes or with wrong font under X.
diff --git a/lisp/calendar/calendar.el b/lisp/calendar/calendar.el
index ccdae484fa6..7a2b3fe1563 100644
--- a/lisp/calendar/calendar.el
+++ b/lisp/calendar/calendar.el
@@ -905,7 +905,7 @@ styles."
905 '(propertize (format "%s %d" (calendar-month-name month) year) 905 '(propertize (format "%s %d" (calendar-month-name month) year)
906 'font-lock-face 'calendar-month-header) 906 'font-lock-face 'calendar-month-header)
907 "Default format for calendar month headings with the American date style. 907 "Default format for calendar month headings with the American date style.
908Normally you should not customize this, but `calender-month-header'." 908Normally you should not customize this, but `calendar-month-header'."
909 :group 'calendar 909 :group 'calendar
910 :risky t 910 :risky t
911 :type 'sexp 911 :type 'sexp
@@ -915,7 +915,7 @@ Normally you should not customize this, but `calender-month-header'."
915 '(propertize (format "%s %d" (calendar-month-name month) year) 915 '(propertize (format "%s %d" (calendar-month-name month) year)
916 'font-lock-face 'calendar-month-header) 916 'font-lock-face 'calendar-month-header)
917 "Default format for calendar month headings with the European date style. 917 "Default format for calendar month headings with the European date style.
918Normally you should not customize this, but `calender-month-header'." 918Normally you should not customize this, but `calendar-month-header'."
919 :group 'calendar 919 :group 'calendar
920 :risky t 920 :risky t
921 :type 'sexp 921 :type 'sexp
@@ -925,7 +925,7 @@ Normally you should not customize this, but `calender-month-header'."
925 '(propertize (format "%d %s" year (calendar-month-name month)) 925 '(propertize (format "%d %s" year (calendar-month-name month))
926 'font-lock-face 'calendar-month-header) 926 'font-lock-face 'calendar-month-header)
927 "Default format for calendar month headings with the ISO date style. 927 "Default format for calendar month headings with the ISO date style.
928Normally you should not customize this, but `calender-month-header'." 928Normally you should not customize this, but `calendar-month-header'."
929 :group 'calendar 929 :group 'calendar
930 :risky t 930 :risky t
931 :type 'sexp 931 :type 'sexp
diff --git a/lisp/emacs-lisp/gv.el b/lisp/emacs-lisp/gv.el
index 93572e5e658..fa7ac64bf04 100644
--- a/lisp/emacs-lisp/gv.el
+++ b/lisp/emacs-lisp/gv.el
@@ -536,7 +536,7 @@ This macro only makes sense when used in a place."
536 "Return a reference to PLACE. 536 "Return a reference to PLACE.
537This is like the `&' operator of the C language. 537This is like the `&' operator of the C language.
538Note: this only works reliably with lexical binding mode, except for very 538Note: this only works reliably with lexical binding mode, except for very
539simple PLACEs such as (function-symbol \\='foo) which will also work in dynamic 539simple PLACEs such as (symbol-function \\='foo) which will also work in dynamic
540binding mode." 540binding mode."
541 (let ((code 541 (let ((code
542 (gv-letplace (getter setter) place 542 (gv-letplace (getter setter) place
diff --git a/lisp/emacs-lisp/regexp-opt.el b/lisp/emacs-lisp/regexp-opt.el
index cf6653046b5..ef752858a4c 100644
--- a/lisp/emacs-lisp/regexp-opt.el
+++ b/lisp/emacs-lisp/regexp-opt.el
@@ -86,18 +86,44 @@
86;;;###autoload 86;;;###autoload
87(defun regexp-opt (strings &optional paren) 87(defun regexp-opt (strings &optional paren)
88 "Return a regexp to match a string in the list STRINGS. 88 "Return a regexp to match a string in the list STRINGS.
89Each string should be unique in STRINGS and should not contain any regexps, 89Each string should be unique in STRINGS and should not contain
90quoted or not. If optional PAREN is non-nil, ensure that the returned regexp 90any regexps, quoted or not. Optional PAREN specifies how the
91is enclosed by at least one regexp grouping construct. 91returned regexp is surrounded by grouping constructs.
92The returned regexp is typically more efficient than the equivalent regexp:
93 92
94 (let ((open (if PAREN \"\\\\(\" \"\")) (close (if PAREN \"\\\\)\" \"\"))) 93The optional argument PAREN can be any of the following:
95 (concat open (mapconcat \\='regexp-quote STRINGS \"\\\\|\") close))
96 94
97If PAREN is `words', then the resulting regexp is additionally surrounded 95a string
98by \\=\\< and \\>. 96 the resulting regexp is preceded by PAREN and followed by
99If PAREN is `symbols', then the resulting regexp is additionally surrounded 97 \\), e.g. use \"\\\\(?1:\" to produce an explicitly numbered
100by \\=\\_< and \\_>." 98 group.
99
100`words'
101 the resulting regexp is surrounded by \\=\\<\\( and \\)\\>.
102
103`symbols'
104 the resulting regexp is surrounded by \\_<\\( and \\)\\_>.
105
106non-nil
107 the resulting regexp is surrounded by \\( and \\).
108
109nil
110 the resulting regexp is surrounded by \\(?: and \\), if it is
111 necessary to ensure that a postfix operator appended to it will
112 apply to the whole expression.
113
114The resulting regexp is equivalent to but usually more efficient
115than that of a simplified version:
116
117 (defun simplified-regexp-opt (strings &optional paren)
118 (let ((parens
119 (cond ((stringp paren) (cons paren \"\\\\)\"))
120 ((eq paren 'words) '(\"\\\\\\=<\\\\(\" . \"\\\\)\\\\>\"))
121 ((eq paren 'symbols) '(\"\\\\_<\\\\(\" . \"\\\\)\\\\_>\"))
122 ((null paren) '(\"\\\\(?:\" . \"\\\\)\"))
123 (t '(\"\\\\(\" . \"\\\\)\")))))
124 (concat (car paren)
125 (mapconcat 'regexp-quote strings \"\\\\|\")
126 (cdr paren))))"
101 (save-match-data 127 (save-match-data
102 ;; Recurse on the sorted list. 128 ;; Recurse on the sorted list.
103 (let* ((max-lisp-eval-depth 10000) 129 (let* ((max-lisp-eval-depth 10000)
diff --git a/lisp/emacs-lisp/seq.el b/lisp/emacs-lisp/seq.el
index e5004f8cdab..9859f28f8e8 100644
--- a/lisp/emacs-lisp/seq.el
+++ b/lisp/emacs-lisp/seq.el
@@ -137,7 +137,7 @@ the sequence, and its index within the sequence."
137 137
138(cl-defgeneric seq-subseq (sequence start &optional end) 138(cl-defgeneric seq-subseq (sequence start &optional end)
139 "Return the sequence of elements of SEQUENCE from START to END. 139 "Return the sequence of elements of SEQUENCE from START to END.
140END is inclusive. 140END is exclusive.
141 141
142If END is omitted, it defaults to the length of the sequence. If 142If END is omitted, it defaults to the length of the sequence. If
143START or END is negative, it counts from the end. Signal an 143START or END is negative, it counts from the end. Signal an
diff --git a/lisp/progmodes/etags.el b/lisp/progmodes/etags.el
index 890d55294cf..d37ab8a9817 100644
--- a/lisp/progmodes/etags.el
+++ b/lisp/progmodes/etags.el
@@ -1880,8 +1880,6 @@ Third arg DELIMITED (prefix arg) means replace only word-delimited matches.
1880If you exit (\\[keyboard-quit], RET or q), you can resume the query replace 1880If you exit (\\[keyboard-quit], RET or q), you can resume the query replace
1881with the command \\[tags-loop-continue]. 1881with the command \\[tags-loop-continue].
1882Fourth arg FILE-LIST-FORM non-nil means initialize the replacement loop. 1882Fourth arg FILE-LIST-FORM non-nil means initialize the replacement loop.
1883Fifth and sixth arguments START and END are accepted, for compatibility
1884with `query-replace-regexp', and ignored.
1885 1883
1886If FILE-LIST-FORM is non-nil, it is a form to evaluate to 1884If FILE-LIST-FORM is non-nil, it is a form to evaluate to
1887produce the list of files to search. 1885produce the list of files to search.
diff --git a/lisp/url/url-http.el b/lisp/url/url-http.el
index 927d0bb8d57..81bb9b4721e 100644
--- a/lisp/url/url-http.el
+++ b/lisp/url/url-http.el
@@ -366,9 +366,10 @@ The string is based on `url-privacy-level' and `url-user-agent'."
366 auth 366 auth
367 ;; Cookies 367 ;; Cookies
368 (when (url-use-cookies url-http-target-url) 368 (when (url-use-cookies url-http-target-url)
369 (url-cookie-generate-header-lines 369 (url-http--encode-string
370 host real-fname 370 (url-cookie-generate-header-lines
371 (equal "https" (url-type url-http-target-url)))) 371 host real-fname
372 (equal "https" (url-type url-http-target-url)))))
372 ;; If-modified-since 373 ;; If-modified-since
373 (if (and (not no-cache) 374 (if (and (not no-cache)
374 (member url-http-method '("GET" nil))) 375 (member url-http-method '("GET" nil)))
diff --git a/src/process.c b/src/process.c
index 29bf43e0f29..9a0ab00c505 100644
--- a/src/process.c
+++ b/src/process.c
@@ -980,7 +980,7 @@ If PROCESS has not yet exited or died, return 0. */)
980DEFUN ("process-id", Fprocess_id, Sprocess_id, 1, 1, 0, 980DEFUN ("process-id", Fprocess_id, Sprocess_id, 1, 1, 0,
981 doc: /* Return the process id of PROCESS. 981 doc: /* Return the process id of PROCESS.
982This is the pid of the external process which PROCESS uses or talks to. 982This is the pid of the external process which PROCESS uses or talks to.
983For a network connection, this value is nil. */) 983For a network, serial, and pipe connections, this value is nil. */)
984 (register Lisp_Object process) 984 (register Lisp_Object process)
985{ 985{
986 pid_t pid; 986 pid_t pid;
@@ -1004,8 +1004,8 @@ DEFUN ("process-command", Fprocess_command, Sprocess_command, 1, 1, 0,
1004 doc: /* Return the command that was executed to start PROCESS. 1004 doc: /* Return the command that was executed to start PROCESS.
1005This is a list of strings, the first string being the program executed 1005This is a list of strings, the first string being the program executed
1006and the rest of the strings being the arguments given to it. 1006and the rest of the strings being the arguments given to it.
1007For a network or serial process, this is nil (process is running) or t 1007For a network or serial or pipe connection, this is nil (process is running)
1008\(process is stopped). */) 1008or t (process is stopped). */)
1009 (register Lisp_Object process) 1009 (register Lisp_Object process)
1010{ 1010{
1011 CHECK_PROCESS (process); 1011 CHECK_PROCESS (process);
@@ -1237,13 +1237,13 @@ DEFUN ("process-query-on-exit-flag",
1237DEFUN ("process-contact", Fprocess_contact, Sprocess_contact, 1237DEFUN ("process-contact", Fprocess_contact, Sprocess_contact,
1238 1, 2, 0, 1238 1, 2, 0,
1239 doc: /* Return the contact info of PROCESS; t for a real child. 1239 doc: /* Return the contact info of PROCESS; t for a real child.
1240For a network or serial connection, the value depends on the optional 1240For a network or serial or pipe connection, the value depends on the
1241KEY arg. If KEY is nil, value is a cons cell of the form (HOST 1241optional KEY arg. If KEY is nil, value is a cons cell of the form
1242SERVICE) for a network connection or (PORT SPEED) for a serial 1242\(HOST SERVICE) for a network connection or (PORT SPEED) for a serial
1243connection. If KEY is t, the complete contact information for the 1243connection; it is t for a pipe connection. If KEY is t, the complete
1244connection is returned, else the specific value for the keyword KEY is 1244contact information for the connection is returned, else the specific
1245returned. See `make-network-process' or `make-serial-process' for a 1245value for the keyword KEY is returned. See `make-network-process',
1246list of keywords. 1246`make-serial-process', or `make pipe-process' for the list of keywords.
1247If PROCESS is a non-blocking network process that hasn't been fully 1247If PROCESS is a non-blocking network process that hasn't been fully
1248set up yet, this function will block until socket setup has completed. */) 1248set up yet, this function will block until socket setup has completed. */)
1249 (Lisp_Object process, Lisp_Object key) 1249 (Lisp_Object process, Lisp_Object key)
@@ -1316,7 +1316,7 @@ a socket connection. */)
1316 1316
1317DEFUN ("process-type", Fprocess_type, Sprocess_type, 1, 1, 0, 1317DEFUN ("process-type", Fprocess_type, Sprocess_type, 1, 1, 0,
1318 doc: /* Return the connection type of PROCESS. 1318 doc: /* Return the connection type of PROCESS.
1319The value is either the symbol `real', `network', or `serial'. 1319The value is either the symbol `real', `network', `serial', or `pipe'.
1320PROCESS may be a process, a buffer, the name of a process or buffer, or 1320PROCESS may be a process, a buffer, the name of a process or buffer, or
1321nil, indicating the current buffer's process. */) 1321nil, indicating the current buffer's process. */)
1322 (Lisp_Object process) 1322 (Lisp_Object process)
@@ -6532,8 +6532,8 @@ See function `interrupt-process' for more details on usage. */)
6532DEFUN ("stop-process", Fstop_process, Sstop_process, 0, 2, 0, 6532DEFUN ("stop-process", Fstop_process, Sstop_process, 0, 2, 0,
6533 doc: /* Stop process PROCESS. May be process or name of one. 6533 doc: /* Stop process PROCESS. May be process or name of one.
6534See function `interrupt-process' for more details on usage. 6534See function `interrupt-process' for more details on usage.
6535If PROCESS is a network or serial process, inhibit handling of incoming 6535If PROCESS is a network or serial or pipe connection, inhibit handling
6536traffic. */) 6536of incoming traffic. */)
6537 (Lisp_Object process, Lisp_Object current_group) 6537 (Lisp_Object process, Lisp_Object current_group)
6538{ 6538{
6539 if (PROCESSP (process) && (NETCONN_P (process) || SERIALCONN_P (process) 6539 if (PROCESSP (process) && (NETCONN_P (process) || SERIALCONN_P (process)
diff --git a/src/window.h b/src/window.h
index c2898194854..a124b3311d0 100644
--- a/src/window.h
+++ b/src/window.h
@@ -920,7 +920,7 @@ wset_next_buffers (struct window *w, Lisp_Object val)
920 ? WINDOW_CONFIG_SCROLL_BAR_HEIGHT (W) \ 920 ? WINDOW_CONFIG_SCROLL_BAR_HEIGHT (W) \
921 : 0) 921 : 0)
922 922
923/* Height in pixels, and in lines, of the mode line. 923/* Height in pixels of the mode line.
924 May be zero if W doesn't have a mode line. */ 924 May be zero if W doesn't have a mode line. */
925#define WINDOW_MODE_LINE_HEIGHT(W) \ 925#define WINDOW_MODE_LINE_HEIGHT(W) \
926 (WINDOW_WANTS_MODELINE_P ((W)) \ 926 (WINDOW_WANTS_MODELINE_P ((W)) \
@@ -930,7 +930,7 @@ wset_next_buffers (struct window *w, Lisp_Object val)
930#define WINDOW_MODE_LINE_LINES(W) \ 930#define WINDOW_MODE_LINE_LINES(W) \
931 WINDOW_WANTS_MODELINE_P (W) 931 WINDOW_WANTS_MODELINE_P (W)
932 932
933/* Height in pixels, and in lines, of the header line. 933/* Height in pixels of the header line.
934 Zero if W doesn't have a header line. */ 934 Zero if W doesn't have a header line. */
935#define WINDOW_HEADER_LINE_HEIGHT(W) \ 935#define WINDOW_HEADER_LINE_HEIGHT(W) \
936 (WINDOW_WANTS_HEADER_LINE_P (W) \ 936 (WINDOW_WANTS_HEADER_LINE_P (W) \