bug-gnu-emacs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

bug#25838: 25.1; Eshell history polluted by eshell/clear


From: Thomas Ferreira
Subject: bug#25838: 25.1; Eshell history polluted by eshell/clear
Date: Wed, 22 Feb 2017 06:03:13 -0500

In eshell:

~ $ history
    1  history
~ $ eshell/clear
[...]
~ $
[...]
~ $ history
    1  history
    2  eshell/clear
    3 
[...]
    4  history


An easy (dirty?) way to fix it could be override eshell-input-filter (from em-hist.el):

(defcustom eshell-input-filter
  (function
   (lambda (str)
     (not (string-match "\\`\\s-*\\'" str))))
  "Predicate for filtering additions to input history.
Takes one argument, the input.  If non-nil, the input may be saved on
the input history list.  Default is to save anything that isn't all
whitespace."
  :type 'function
  :group 'eshell-hist)

to:

(defcustom eshell-input-filter
  (function
   (lambda (str)
     (not (string-match "\\`\\s-*\\'" (string-trim-left str)))))
  "Predicate for filtering additions to input history.
Takes one argument, the input.  If non-nil, the input may be saved on
the input history list.  Default is to save anything that isn't all
whitespace."
  :type 'function
  :group 'eshell-hist)



reply via email to

[Prev in Thread] Current Thread [Next in Thread]