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)
             (if (eq eshell-hist-ignoredups 'erase)
                 ;; Remove any old occurrences of the input, and put
                 ;; the new one at the end.
                 (unless (ring-empty-p eshell-history-ring)
                   (ring-remove eshell-history-ring
                                (ring-member eshell-history-ring input))
                   t)
               ;; Always add...
               (or (null eshell-hist-ignoredups)
                   ;; ... or add if it's not already present at the
                   ;; end.
                   (not (ring-p eshell-history-ring))
                   (ring-empty-p eshell-history-ring)
                   (not (string-equal (eshell-get-history 0) input)))))
    (eshell-put-history input))
  (setq eshell-save-history-index eshell-history-index)
  (setq eshell-history-index nil))