Function: tramp-sudoedit-action-sudo

tramp-sudoedit-action-sudo is a byte-compiled function defined in tramp-sudoedit.el.gz.

Signature

(tramp-sudoedit-action-sudo PROC VEC)

Documentation

Check, whether a sudo process has finished. Remove unneeded output.

Source Code

;; Defined in /usr/src/emacs/lisp/net/tramp-sudoedit.el.gz
;; Internal functions.

;; Used in `tramp-sudoedit-sudo-actions'.
(defun tramp-sudoedit-action-sudo (proc vec)
  "Check, whether a sudo process has finished.  Remove unneeded output."
  ;; There might be pending output for the exit status.
  (unless (process-live-p proc)
    (while (tramp-accept-process-output proc))
    ;; Delete narrowed region, it would be in the way reading a Lisp form.
    (goto-char (point-min))
    (widen)
    (delete-region (point-min) (point))
    ;; Delete empty lines.
    (goto-char (point-min))
    (while (and (not (eobp)) (= (point) (line-end-position)))
      (forward-line))
    (delete-region (point-min) (point))
    (tramp-message vec 3 "Process has finished.")
    (throw 'tramp-action 'ok)))