GNU bug report logs -
#30466
25.3; Eshell: Ignore all duplicates when ignoredups is non-nil
Previous Next
Reported by: Pierre Neidhardt <ambrevar <at> gmail.com>
Date: Thu, 15 Feb 2018 14:26:04 UTC
Severity: wishlist
Tags: fixed
Found in version 25.3
Fixed in version 28.1
Done: Lars Ingebrigtsen <larsi <at> gnus.org>
Bug is archived. No further changes may be made.
Full log
View this message in rfc822 format
At the moment, when `eshell-hist-ignoredups' is non-nil, the command
won't be appended to the history if it's the same as the last entry.
This does not prevent Eshell from cluttering the history with the same
commands as long as they are not consecutive (e.g. A, B, A, B...).
I find more useful to always remove the duplicate entry back to the
first position. It makes the history much lighter and much easier to
browse/filter.
This is especially useful when using a completion
framework such as Helm, Ivy.
I could not find a way to customize this myself without modifying
Eshell's code. Here it goes:
(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 (funcall eshell-input-filter input)
(when eshell-hist-ignoredups
(ring-remove eshell-history-ring
(ring-member eshell-history-ring input)))
(eshell-put-history input))
(setq eshell-save-history-index eshell-history-index)
(setq eshell-history-index nil))
We could also keep the current behaviour and add a separate option to
implement the behaviour I mentioned.
In GNU Emacs 25.3.1 (x86_64-unknown-linux-gnu, GTK+ Version 3.22.26)
of 2017-12-16 built on build
Windowing system distributor 'The X.Org Foundation', version 11.0.11906000
System Description: Void Linux
Configured using:
'configure --with-x-toolkit=gtk3 --with-xwidgets --prefix=/usr
--sysconfdir=/etc --sbindir=/usr/bin --bindir=/usr/bin
--mandir=/usr/share/man --infodir=/usr/share/info --localstatedir=/var
--with-file-notification=inotify --with-modules --with-jpeg --with-tiff
--with-gif --with-png --with-xpm --with-rsvg --without-imagemagick
--with-xml2 --with-gnutls --with-sound --with-m17n-flt
--host=x86_64-unknown-linux-gnu --build=x86_64-unknown-linux-gnu
'CFLAGS=-fno-PIE -mtune=generic -O2 -pipe -g' 'CPPFLAGS= '
'LDFLAGS=-no-pie -Wl,--as-needed ''
Configured features:
XPM JPEG TIFF GIF PNG RSVG SOUND DBUS GSETTINGS NOTIFY ACL GNUTLS
LIBXML2 FREETYPE M17N_FLT LIBOTF XFT ZLIB TOOLKIT_SCROLL_BARS GTK3 X11
MODULES XWIDGETS
Important settings:
value of $LC_COLLATE: C
value of $LANG: en_US.UTF-8
locale-coding-system: utf-8-unix
This bug report was last modified 4 years and 194 days ago.
Previous Next
GNU bug tracking system
Copyright (C) 1999 Darren O. Benham,
1997,2003 nCipher Corporation Ltd,
1994-97 Ian Jackson.