Function: eshell-previous-matching-input-from-input

eshell-previous-matching-input-from-input is an interactive and byte-compiled function defined in em-hist.el.gz.

Signature

(eshell-previous-matching-input-from-input ARG)

Documentation

Search backwards through input history for match for current input.

(Previous history elements are earlier commands.)
With prefix argument N, search for Nth previous match. If N is negative, search forwards for the -Nth following match.

Key Bindings

Source Code

;; Defined in /usr/src/emacs/lisp/eshell/em-hist.el.gz
(defun eshell-previous-matching-input-from-input (arg)
  "Search backwards through input history for match for current input.
\(Previous history elements are earlier commands.)
With prefix argument N, search for Nth previous match.
If N is negative, search forwards for the -Nth following match."
  (interactive "p")
  (if (not (memq last-command '(eshell-previous-matching-input-from-input
				eshell-next-matching-input-from-input)))
      ;; Starting a new search
      (setq eshell-matching-input-from-input-string
	    (buffer-substring (save-excursion (eshell-bol) (point))
			      (point))
	    eshell-history-index nil))
  (eshell-previous-matching-input
   (concat "^" (regexp-quote eshell-matching-input-from-input-string))
   arg))