diff options
| author | Tino Calancha | 2016-08-25 22:17:56 +0900 |
|---|---|---|
| committer | Tino Calancha | 2016-08-25 22:17:56 +0900 |
| commit | 5e84dcefb4b7fcf3b5af985345ed1ee5ef5df135 (patch) | |
| tree | 872bead49b7bcb8494df444d2f7448af4e45e932 /doc | |
| parent | 95c82efdb141029de89d9136a9ce4fe907de7c5e (diff) | |
| download | emacs-5e84dcefb4b7fcf3b5af985345ed1ee5ef5df135.tar.gz emacs-5e84dcefb4b7fcf3b5af985345ed1ee5ef5df135.zip | |
call-shell-region: New defun
Suggested by Stefan Monnier in Bug#22679.
* lisp/subr.el (call-shell-region): New defun; execute a command
in an inferior shell with the buffer region as input.
* lisp/simple.el (shell-command-on-region): Use it.
* lisp/gnus/message.el (message-do-fcc): Idem.
* doc/lispref/processes.texi: Document call-shell-region in the manual.
;* etc/NEWS: Add entry for this new function.
Diffstat (limited to 'doc')
| -rw-r--r-- | doc/lispref/processes.texi | 20 |
1 files changed, 13 insertions, 7 deletions
diff --git a/doc/lispref/processes.texi b/doc/lispref/processes.texi index cd1201276e2..e043578e298 100644 --- a/doc/lispref/processes.texi +++ b/doc/lispref/processes.texi | |||
| @@ -492,20 +492,17 @@ inputinput@point{} | |||
| 492 | @end smallexample | 492 | @end smallexample |
| 493 | 493 | ||
| 494 | For example, the @code{shell-command-on-region} command uses | 494 | For example, the @code{shell-command-on-region} command uses |
| 495 | @code{call-process-region} in a manner similar to this: | 495 | @code{call-shell-region} in a manner similar to this: |
| 496 | 496 | ||
| 497 | @smallexample | 497 | @smallexample |
| 498 | @group | 498 | @group |
| 499 | (call-process-region | 499 | (call-shell-region |
| 500 | start end | 500 | start end |
| 501 | shell-file-name ; @r{name of program} | 501 | command ; @r{shell command} |
| 502 | nil ; @r{do not delete region} | 502 | nil ; @r{do not delete region} |
| 503 | buffer ; @r{send output to @code{buffer}} | 503 | buffer) ; @r{send output to @code{buffer}} |
| 504 | nil ; @r{no redisplay during output} | ||
| 505 | "-c" command) ; @r{arguments for the shell} | ||
| 506 | @end group | 504 | @end group |
| 507 | @end smallexample | 505 | @end smallexample |
| 508 | @c It actually uses shell-command-switch, but no need to mention that here. | ||
| 509 | @end defun | 506 | @end defun |
| 510 | 507 | ||
| 511 | @defun call-process-shell-command command &optional infile destination display | 508 | @defun call-process-shell-command command &optional infile destination display |
| @@ -525,6 +522,15 @@ convention allowed passing any number of additional arguments after | |||
| 525 | supported, but strongly discouraged. | 522 | supported, but strongly discouraged. |
| 526 | @end defun | 523 | @end defun |
| 527 | 524 | ||
| 525 | @defun call-shell-region start end command &optional delete destination | ||
| 526 | This function sends the text from @var{start} to @var{end} as | ||
| 527 | standard input to an inferior shell running @var{command}. This function | ||
| 528 | is similar than @code{call-process-region}, with process being a shell. | ||
| 529 | The arguments @code{delete}, @code{destination} and the return value | ||
| 530 | are like in @code{call-process-region}. | ||
| 531 | Note that this funtion doesn't accept additional arguments. | ||
| 532 | @end defun | ||
| 533 | |||
| 528 | @defun shell-command-to-string command | 534 | @defun shell-command-to-string command |
| 529 | This function executes @var{command} (a string) as a shell command, | 535 | This function executes @var{command} (a string) as a shell command, |
| 530 | then returns the command's output as a string. | 536 | then returns the command's output as a string. |