[SA] Port `start-file-process' and `start-file-process-shell-command'
Michael Sperber <[email protected]> Tue, 30 Sep 2014 09:10:36 +0200
| Newsgroups | gmane.emacs.xemacs.patches |
|---|---|
| Message-ID | <[email protected]> |
So I just pushed the attached patch, with the commented as per Stephen's feedback. 2014-09-27 Michael Sperber <[email protected]> * simple-more.el (start-file-process): * subr-more.el (start-file-process-shell-command): Port from GNU Emacs. -- Regards, Mike diff --git a/simple-more.el b/simple-more.el --- a/simple-more.el +++ b/simple-more.el @@ -130,4 +130,22 @@ (setq rest (cdr rest))) done)))) +;;;###autoload +(defun start-file-process (name buffer program &rest program-args) + "Start a program in a subprocess. Return the process object for it. + +Similar to `start-process', but may invoke a file handler based on +`default-directory'. See Info node `(elisp)Magic File Names'. + +This handler ought to run PROGRAM, perhaps on the local host, +perhaps on a remote host that corresponds to `default-directory'. +In the latter case, the local part of `default-directory' becomes +the working directory of the process. + +PROGRAM and PROGRAM-ARGS might be file names." + (let ((fh (find-file-name-handler default-directory 'start-file-process))) + (if fh (apply fh 'start-file-process name buffer program program-args) + (apply 'start-process name buffer program program-args)))) + + ;;; simple-more.el ends here diff --git a/subr-more.el b/subr-more.el --- a/subr-more.el +++ b/subr-more.el @@ -195,4 +195,14 @@ tail (cdr tail))) result)) +;;;###autoload +(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'." + (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 " "))) + ;;; subr-more.el ends here _______________________________________________ XEmacs-Patches mailing list [email protected] http://lists.xemacs.org/mailman/listinfo/xemacs-patches