Function: with-tramp-timeout

with-tramp-timeout is a macro defined in tramp.el.gz.

Signature

(with-tramp-timeout (SECONDS TIMEOUT-FORMS...) BODY)

Documentation

Like with-timeout, but allow SECONDS to be nil.

Source Code

;; Defined in /usr/src/emacs/lisp/net/tramp.el.gz
(defmacro with-tramp-timeout (list &rest body)
  "Like `with-timeout', but allow SECONDS to be nil.

\(fn (SECONDS TIMEOUT-FORMS...) BODY)"
  (declare (indent 1) (debug ((form body) body)))
  (let ((seconds (car list))
	(timeout-forms (cdr list)))
    ;; If non-nil, `seconds' must be a positive number.
    `(if-let* (((natnump ,seconds))
	       ((not (zerop timeout))))
         (with-timeout (,seconds ,@timeout-forms) ,@body)
       ,@body)))