Function: tramp-error-with-buffer

tramp-error-with-buffer is a byte-compiled function defined in tramp-message.el.gz.

Signature

(tramp-error-with-buffer BUF VEC-OR-PROC SIGNAL FMT-STRING &rest ARGUMENTS)

Documentation

Emit an error, and show BUF.

If BUF is nil, show the connection buf. Wait for 30", or until an input event arrives. The other arguments are passed to tramp-error.

Source Code

;; Defined in /usr/src/emacs/lisp/net/tramp-message.el.gz
(defsubst tramp-error-with-buffer
  (buf vec-or-proc signal fmt-string &rest arguments)
  "Emit an error, and show BUF.
If BUF is nil, show the connection buf.  Wait for 30\", or until
an input event arrives.  The other arguments are passed to `tramp-error'."
  (declare (tramp-suppress-trace t))
  (save-window-excursion
    (let* ((buf (or (and (bufferp buf) buf)
		    (and (processp vec-or-proc) (process-buffer vec-or-proc))
		    (and (tramp-file-name-p vec-or-proc)
			 (tramp-get-connection-buffer vec-or-proc))))
	   (vec (or (and (tramp-file-name-p vec-or-proc) vec-or-proc)
		    (and buf (tramp-dissect-file-name
			      (tramp-get-default-directory buf))))))
      (unwind-protect
	  (apply #'tramp-error vec-or-proc signal fmt-string arguments)
	;; Save exit.
	(when (and buf
		   (natnump tramp-error-show-message-timeout)
		   (not (zerop tramp-verbose))
		   ;; Do not show when flagged from outside.
		   (not non-essential)
		   ;; Show only when Emacs has started already.
		   (current-message))
	  (let ((enable-recursive-minibuffers t)
		inhibit-message)
	    ;; `tramp-error' does not show messages.  So we must do it
	    ;; ourselves.
	    (apply #'message fmt-string arguments)
	    ;; Show buffer.
	    (pop-to-buffer buf)
	    (discard-input)
	    (sit-for tramp-error-show-message-timeout 'nodisp)))
	;; Reset timestamp.  It would be wrong after waiting for a while.
	(when (tramp-file-name-equal-p vec (car tramp-current-connection))
	  (setcdr tramp-current-connection (current-time)))))))