Function: comint-goto-input

comint-goto-input is a byte-compiled function defined in comint.el.gz.

Signature

(comint-goto-input POS)

Documentation

Put input history item of the absolute history position POS.

Source Code

;; Defined in /usr/src/emacs/lisp/comint.el.gz
(defun comint-goto-input (pos)
  "Put input history item of the absolute history position POS."
  ;; If leaving the edit line, save partial unfinished input.
  (if (null comint-input-ring-index)
      (setq comint-stored-incomplete-input
	    (funcall comint-get-old-input)))
  (setq comint-input-ring-index pos)
  (comint-delete-input)
  (if (and pos (not (ring-empty-p comint-input-ring)))
      (insert (ring-ref comint-input-ring pos))
    ;; Restore partial unfinished input.
    (when (> (length comint-stored-incomplete-input) 0)
      (insert comint-stored-incomplete-input))))