Function: jka-compr-call-process

jka-compr-call-process is a byte-compiled function defined in jka-compr.el.gz.

Signature

(jka-compr-call-process PROG MESSAGE INFILE OUTPUT TEMP ARGS)

Source Code

;; Defined in /usr/src/emacs/lisp/jka-compr.el.gz
(defun jka-compr-call-process (prog message infile output temp args)
  ;; call-process barfs if default-directory is inaccessible.
  (let ((default-directory
	  (if (and default-directory
		   (not (file-remote-p default-directory))
		   (file-accessible-directory-p default-directory))
	      default-directory
	    (file-name-directory infile))))
    (if jka-compr-use-shell
	(let ((err-file (jka-compr-make-temp-name))
	      (coding-system-for-read (or coding-system-for-read 'undecided))
	      (coding-system-for-write 'no-conversion))
	  (unwind-protect
	      (or (memq
		   (call-process jka-compr-shell infile
				 (if (stringp output) nil output)
				 nil
				 "-c"
				 (format "%s %s 2> %s %s"
					 prog
					 (mapconcat #'identity args " ")
					 err-file
					 (if (stringp output)
					     (concat "> " output)
					   "")))
		   jka-compr-acceptable-retval-list)
		  (jka-compr-error prog args infile message err-file))
	    (delete-file err-file)))
      (or (eq 0
	      (apply #'call-process
		     prog infile (if (stringp output) temp output)
		     nil args))
	  (jka-compr-error prog args infile message))
      (and (stringp output)
	   (with-current-buffer temp
	     (write-region (point-min) (point-max) output)
	     (erase-buffer))))))