Function: tramp-call-process-region

tramp-call-process-region is a byte-compiled function defined in tramp.el.gz.

Signature

(tramp-call-process-region VEC START END PROGRAM &optional DELETE BUFFER DISPLAY &rest ARGS)

Documentation

Call call-process-region on the local host.

It always returns a return code. The Lisp error raised when PROGRAM is nil is trapped also, returning 1. Furthermore, traces are written with verbosity of 6.

Source Code

;; Defined in /usr/src/emacs/lisp/net/tramp.el.gz
(defun tramp-call-process-region
  (vec start end program &optional delete buffer display &rest args)
  "Call `call-process-region' on the local host.
It always returns a return code.  The Lisp error raised when
PROGRAM is nil is trapped also, returning 1.  Furthermore, traces
are written with verbosity of 6."
  (let ((default-directory tramp-compat-temporary-file-directory)
	(process-environment (default-toplevel-value 'process-environment))
	(buffer (if (eq buffer t) (current-buffer) buffer))
	result)
    (tramp-message
     vec 6 "`%s %s' %s %s %s %s"
     program (string-join args " ") start end delete buffer)
    (condition-case err
	(progn
	  (setq result
		(apply
		 #'call-process-region
		 start end program delete buffer display args))
	  ;; `result' could also be an error string.
	  (when (stringp result)
	    (signal 'file-error (list result)))
	  (with-current-buffer (if (bufferp buffer) buffer (current-buffer))
            (if (zerop result)
                (tramp-message vec 6 "%d" result)
              (tramp-message vec 6 "%d\n%s" result (buffer-string)))))
      (error
       (setq result 1)
       (tramp-message vec 6 "%d\n%s" result (error-message-string err))))
    result))