summaryrefslogtreecommitdiff
path: root/doc
diff options
context:
space:
mode:
authorTino Calancha <tino.calancha@gmail.com>2016-08-25 22:17:56 +0900
committerTino Calancha <tino.calancha@gmail.com>2016-08-25 22:17:56 +0900
commit5e84dcefb4b7fcf3b5af985345ed1ee5ef5df135 (patch)
tree872bead49b7bcb8494df444d2f7448af4e45e932 /doc
parent95c82efdb141029de89d9136a9ce4fe907de7c5e (diff)
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.texi20
1 files changed, 13 insertions, 7 deletions
diff --git a/doc/lispref/processes.texi b/doc/lispref/processes.texi
index cd1201276e..e043578e29 100644
--- a/doc/lispref/processes.texi
+++ b/doc/lispref/processes.texi
@@ -492,20 +492,17 @@ inputinput@point{}
@end smallexample
For example, the @code{shell-command-on-region} command uses
-@code{call-process-region} in a manner similar to this:
+@code{call-shell-region} in a manner similar to this:
@smallexample
@group
-(call-process-region
+(call-shell-region
start end
- shell-file-name ; @r{name of program}
+ command ; @r{shell command}
nil ; @r{do not delete region}
- buffer ; @r{send output to @code{buffer}}
- nil ; @r{no redisplay during output}
- "-c" command) ; @r{arguments for the shell}
+ buffer) ; @r{send output to @code{buffer}}
@end group
@end smallexample
-@c It actually uses shell-command-switch, but no need to mention that here.
@end defun
@defun call-process-shell-command command &optional infile destination display
@@ -525,6 +522,15 @@ convention allowed passing any number of additional arguments after
supported, but strongly discouraged.
@end defun
+@defun call-shell-region start end command &optional delete destination
+This function sends the text from @var{start} to @var{end} as
+standard input to an inferior shell running @var{command}. This function
+is similar than @code{call-process-region}, with process being a shell.
+The arguments @code{delete}, @code{destination} and the return value
+are like in @code{call-process-region}.
+Note that this funtion doesn't accept additional arguments.
+@end defun
+
@defun shell-command-to-string command
This function executes @var{command} (a string) as a shell command,
then returns the command's output as a string.