commit/xemacs-base: sperber: Add `start-file-process' and `start-file-process-command'.

[email protected] Tue, 30 Sep 2014 07:09:30 -0000
Newsgroups gmane.emacs.xemacs.patches
Message-ID <[email protected]>
1 new commit in xemacs-base:

https://bitbucket.org/xemacs/xemacs-base/commits/8d5a9615314b/
Changeset:   8d5a9615314b
User:        sperber
Date:        2014-09-27 12:21:15+00:00
Summary:     Add `start-file-process' and `start-file-process-command'.

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.
Affected #:  3 files

diff -r ab20b62d00275b0b8d2caaf681aef0bc23ccbe73 -r 8d5a9615314b44c0bec0662e690f54c74ca7ce3f ChangeLog
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,9 @@
+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.
+
 2014-09-08  Norbert Koch  <[email protected]>
 
 	* Makefile (VERSION): XEmacs package 2.42 released.

diff -r ab20b62d00275b0b8d2caaf681aef0bc23ccbe73 -r 8d5a9615314b44c0bec0662e690f54c74ca7ce3f 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 -r ab20b62d00275b0b8d2caaf681aef0bc23ccbe73 -r 8d5a9615314b44c0bec0662e690f54c74ca7ce3f 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

Repository URL: https://bitbucket.org/xemacs/xemacs-base/

--

This is a commit notification from bitbucket.org. You are receiving
this because you have the service enabled, addressing the recipient of
this email.