Mercurial > emacs
comparison doc/lispref/processes.texi @ 111945:c00190a8c8ef
Merge from emacs-23
author | Stefan Monnier <monnier@iro.umontreal.ca> |
---|---|
date | Mon, 13 Dec 2010 10:27:36 -0500 |
parents | 27e6f236ba8d 9b5de34a8646 |
children | 417b1e4d63cd |
comparison
equal
deleted
inserted
replaced
111884:9b5cce10c8e2 | 111945:c00190a8c8ef |
---|---|
193 " " | 193 " " |
194 (shell-quote-argument newfile)) | 194 (shell-quote-argument newfile)) |
195 @end example | 195 @end example |
196 @end defun | 196 @end defun |
197 | 197 |
198 @cindex quoting and unquoting shell command line | 198 @cindex quoting and unquoting command-line arguments |
199 The following two functions are useful for creating shell commands | 199 @cindex minibuffer input, and command-line arguments |
200 from individual argument strings, and taking shell command lines apart | 200 @cindex @code{call-process}, command-line arguments from minibuffer |
201 into individual arguments. | 201 @cindex @code{start-process}, command-line arguments from minibuffer |
202 The following two functions are useful for combining a list of | |
203 individual command-line argument strings into a single string, and | |
204 taking a string apart into a list of individual command-line | |
205 arguments. These functions are mainly intended to be used for | |
206 converting user input in the minibuffer, a Lisp string, into a list of | |
207 string arguments to be passed to @code{call-process} or | |
208 @code{start-process}, or for the converting such lists of arguments in | |
209 a single Lisp string to be presented in the minibuffer or echo area. | |
202 | 210 |
203 @defun split-string-and-unquote string &optional separators | 211 @defun split-string-and-unquote string &optional separators |
204 This function splits @var{string} into substrings at matches for the | 212 This function splits @var{string} into substrings at matches for the |
205 regular expression @var{separators}, like @code{split-string} does | 213 regular expression @var{separators}, like @code{split-string} does |
206 (@pxref{Creating Strings}); in addition, it removes quoting from the | 214 (@pxref{Creating Strings}); in addition, it removes quoting from the |
208 | 216 |
209 If @var{separators} is omitted or @code{nil}, it defaults to | 217 If @var{separators} is omitted or @code{nil}, it defaults to |
210 @code{"\\s-+"}, which is a regular expression that matches one or more | 218 @code{"\\s-+"}, which is a regular expression that matches one or more |
211 characters with whitespace syntax (@pxref{Syntax Class Table}). | 219 characters with whitespace syntax (@pxref{Syntax Class Table}). |
212 | 220 |
213 This function performs two types of quoting: enclosing a whole string | 221 This function supports two types of quoting: enclosing a whole string |
214 in double quotes @code{"@dots{}"}, and quoting individual characters | 222 in double quotes @code{"@dots{}"}, and quoting individual characters |
215 with a backslash escape @samp{\}. The latter is also used in Lisp | 223 with a backslash escape @samp{\}. The latter is also used in Lisp |
216 strings, so this function can handle those as well. | 224 strings, so this function can handle those as well. |
217 @end defun | 225 @end defun |
218 | 226 |
224 resulting string. | 232 resulting string. |
225 | 233 |
226 The strings in @var{list-of-strings} that need quoting are those that | 234 The strings in @var{list-of-strings} that need quoting are those that |
227 include @var{separator} as their substring. Quoting a string encloses | 235 include @var{separator} as their substring. Quoting a string encloses |
228 it in double quotes @code{"@dots{}"}. In the simplest case, if you | 236 it in double quotes @code{"@dots{}"}. In the simplest case, if you |
229 are consing a shell command from the individual command-line | 237 are consing a command from the individual command-line arguments, |
230 arguments, every argument that includes embedded blanks will be | 238 every argument that includes embedded blanks will be quoted. |
231 quoted. | |
232 @end defun | 239 @end defun |
233 | 240 |
234 @node Synchronous Processes | 241 @node Synchronous Processes |
235 @section Creating a Synchronous Process | 242 @section Creating a Synchronous Process |
236 @cindex synchronous subprocess | 243 @cindex synchronous subprocess |