Function: eshell-add-input-to-history
eshell-add-input-to-history is a byte-compiled function defined in
em-hist.el.gz.
Signature
(eshell-add-input-to-history INPUT)
Documentation
Add the string INPUT to the history ring.
Input is entered into the input history ring, if the value of
variable eshell-input-filter returns non-nil when called on the
input.
Source Code
;; Defined in /usr/src/emacs/lisp/eshell/em-hist.el.gz
(defun eshell-add-input-to-history (input)
"Add the string INPUT to the history ring.
Input is entered into the input history ring, if the value of
variable `eshell-input-filter' returns non-nil when called on the
input."
(when (and (funcall eshell-input-filter input)
(pcase eshell-hist-ignoredups
('nil t) ; Always add to history
('erase ; Add, removing any old occurrences
(while-let ((old-index (ring-member eshell-history-ring input)))
;; Remove the old occurrences of this input so we can
;; add it to the end.
(ring-remove eshell-history-ring old-index))
t)
(_ ; Add if not already the latest entry
(or (ring-empty-p eshell-history-ring)
(not (string-equal (eshell-get-history 0) input))))))
(setq eshell-hist--new-items
(min eshell-history-size (1+ eshell-hist--new-items)))
(eshell-put-history input))
(setq eshell-save-history-index eshell-history-index)
(setq eshell-history-index nil))