Function: tramp-action-show-and-confirm-message

tramp-action-show-and-confirm-message is a byte-compiled function defined in tramp.el.gz.

Signature

(tramp-action-show-and-confirm-message PROC VEC)

Documentation

Show the user a message for confirmation.

Wait, until the connection buffer changes.

Source Code

;; Defined in /usr/src/emacs/lisp/net/tramp.el.gz
(defun tramp-action-show-and-confirm-message (proc vec)
  "Show the user a message for confirmation.
Wait, until the connection buffer changes."
  (with-current-buffer (process-buffer proc)
    (let ((stimers (with-timeout-suspend))
	  (cursor-in-echo-area t)
	  set-message-function clear-message-function)
      ;; Silence byte compiler.
      (ignore set-message-function clear-message-function)
      (tramp-message vec 6 "\n%s" (buffer-string))
      (tramp-check-for-regexp proc tramp-process-action-regexp)
      (with-temp-message (concat (string-trim (match-string 0)) " ")
	;; Hide message in buffer.
	(narrow-to-region (point-max) (point-max))
	;; Wait for new output.
	(while (not (tramp-compat-ignore-error file-error
		      (tramp-wait-for-regexp
		       proc 0.1
		       (tramp-compat-rx
			(| (regexp tramp-security-key-confirmed-regexp)
			   (regexp tramp-security-key-pin-regexp)
			   (regexp tramp-security-key-timeout-regexp))))))
	  (when (tramp-check-for-regexp proc tramp-security-key-timeout-regexp)
	    (throw 'tramp-action 'timeout))
	  (redisplay 'force)))
      ;; Reenable the timers.
      (with-timeout-unsuspend stimers)))
  t)