(require 'cl-lib) (cl-loop with eofs = 0 for i from 0 while (< eofs 2) do (condition-case err (princ (format "line%d: %S\n" i (read-from-minibuffer "> "))) (error (if (equal err '(error "Error reading from stdin")) (message "EOF%d" (cl-incf eofs)) (signal (car err) (cdr err))))))