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 ((cursor-in-echo-area t)
	  set-message-function clear-message-function tramp-dont-suspend-timers)
      (with-tramp-suspended-timers
	;; Silence byte compiler.
	(ignore set-message-function clear-message-function)
	(tramp-message vec 6 "\n%s" (buffer-string))
	(goto-char (point-min))
	(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 (ignore-error file-error
			(tramp-wait-for-regexp
			 proc 0.1
			 (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))))))
  t)