all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: Stefan Monnier <monnier@IRO.UMontreal.CA>
To: Devon Sean McCullough <Emacs-Hacker2014@jovi.net>
Cc: 18409-done@debbugs.gnu.org
Subject: bug#18409: 24.3; call-process-shell-command doc
Date: Thu, 04 Sep 2014 21:22:49 -0400	[thread overview]
Message-ID: <jwviol2vp4c.fsf-monnier+emacsbugs@gnu.org> (raw)
In-Reply-To: <65311DC8-1CA5-4E16-B2C7-7E261C36615E@jovi.net> (Devon Sean McCullough's message of "Thu, 4 Sep 2014 18:54:15 -0400")

> Make the rest args easier to spot in the documentation

On the contrary, this `args' is just asking for trouble.  Don't use it.

We obsoleted it for start-process-shell-command in Emacs-23 and forgot
to do it for the call-process variant, which I just fixed with the
patch below.

Thanks for bringing it up.


        Stefan


=== modified file 'etc/NEWS'
--- etc/NEWS	2014-09-03 16:13:17 +0000
+++ etc/NEWS	2014-09-05 01:17:23 +0000
@@ -200,6 +200,9 @@
 \f
 * Lisp Changes in Emacs 24.5
 
+*** call-process-shell-command and process-file-shell-command
+don't take "&rest args" an more.
+
 ** New function `funcall-interactively', which works like `funcall'
 but makes `called-interactively-p' treat the function as (you guessed it)
 called interactively.

=== modified file 'lisp/ChangeLog'
--- lisp/ChangeLog	2014-09-05 01:04:47 +0000
+++ lisp/ChangeLog	2014-09-05 01:19:21 +0000
@@ -1,3 +1,10 @@
+2014-09-05  Stefan Monnier  <monnier@iro.umontreal.ca>
+
+	* subr.el (call-process-shell-command, process-file-shell-command):
+	Make the `args' obsolete (bug#18409).
+	(start-process-shell-command, start-file-process-shell-command):
+	Use `declare'.
+
 2014-09-05  Jay Belanger  <jay.p.belanger@gmail.com>
 
 	* calc/calc-forms.el (math-normalize-hms): Do a better check for

=== modified file 'lisp/subr.el'
--- lisp/subr.el	2014-09-03 04:21:40 +0000
+++ lisp/subr.el	2014-09-05 01:12:43 +0000
@@ -2877,23 +2877,21 @@
 An old calling convention accepted any number of arguments after COMMAND,
 which were just concatenated to COMMAND.  This is still supported but strongly
 discouraged."
+  (declare (advertised-calling-convention (name buffer command) "23.1"))
    ;; We used to use `exec' to replace the shell with the command,
    ;; but that failed to handle (...) and semicolon, etc.
   (start-process name buffer shell-file-name shell-command-switch
 		 (mapconcat 'identity args " ")))
-(set-advertised-calling-convention 'start-process-shell-command
-                                   '(name buffer command) "23.1")
 
 (defun start-file-process-shell-command (name buffer &rest args)
   "Start a program in a subprocess.  Return the process object for it.
 Similar to `start-process-shell-command', but calls `start-file-process'."
+  (declare (advertised-calling-convention (name buffer command) "23.1"))
   (start-file-process
    name buffer
    (if (file-remote-p default-directory) "/bin/sh" shell-file-name)
    (if (file-remote-p default-directory) "-c" shell-command-switch)
    (mapconcat 'identity args " ")))
-(set-advertised-calling-convention 'start-file-process-shell-command
-                                   '(name buffer command) "23.1")
 
 (defun call-process-shell-command (command &optional infile buffer display
 					   &rest args)
@@ -2909,13 +2907,18 @@
 t (mix it with ordinary output), or a file name string.
 
 Fourth arg DISPLAY non-nil means redisplay buffer as output is inserted.
-Remaining arguments are strings passed as additional arguments for COMMAND.
 Wildcards and redirection are handled as usual in the shell.
 
 If BUFFER is 0, `call-process-shell-command' returns immediately with value nil.
 Otherwise it waits for COMMAND to terminate and returns a numeric exit
 status or a signal description string.
-If you quit, the process is killed with SIGINT, or SIGKILL if you quit again."
+If you quit, the process is killed with SIGINT, or SIGKILL if you quit again.
+
+An old calling convention accepted any number of arguments after DISPLAY,
+which were just concatenated to COMMAND.  This is still supported but strongly
+discouraged."
+  (declare (advertised-calling-convention
+            (command &optional infile buffer display) "24.5"))
   ;; We used to use `exec' to replace the shell with the command,
   ;; but that failed to handle (...) and semicolon, etc.
   (call-process shell-file-name
@@ -2927,6 +2930,8 @@
 					   &rest args)
   "Process files synchronously in a separate process.
 Similar to `call-process-shell-command', but calls `process-file'."
+  (declare (advertised-calling-convention
+            (command &optional infile buffer display) "24.5"))
   (process-file
    (if (file-remote-p default-directory) "/bin/sh" shell-file-name)
    infile buffer display






      reply	other threads:[~2014-09-05  1:22 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-09-04 22:54 bug#18409: 24.3; call-process-shell-command doc Devon Sean McCullough
2014-09-05  1:22 ` Stefan Monnier [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=jwviol2vp4c.fsf-monnier+emacsbugs@gnu.org \
    --to=monnier@iro.umontreal.ca \
    --cc=18409-done@debbugs.gnu.org \
    --cc=Emacs-Hacker2014@jovi.net \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this external index

	https://git.savannah.gnu.org/cgit/emacs.git
	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.