GNU bug report logs - #30466
25.3; Eshell: Ignore all duplicates when ignoredups is non-nil

Previous Next

Package: emacs;

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.

To add a comment to this bug, you must first unarchive it, by sending
a message to control AT debbugs.gnu.org, with unarchive 30466 in the body.
You can then email your comments to 30466 AT debbugs.gnu.org in the normal way.

Toggle the display of automated, internal messages from the tracker.

View this report as an mbox folder, status mbox, maintainer mbox


Report forwarded to bug-gnu-emacs <at> gnu.org:
bug#30466; Package emacs. (Thu, 15 Feb 2018 14:26:04 GMT) Full text and rfc822 format available.

Acknowledgement sent to Pierre Neidhardt <ambrevar <at> gmail.com>:
New bug report received and forwarded. Copy sent to bug-gnu-emacs <at> gnu.org. (Thu, 15 Feb 2018 14:26:04 GMT) Full text and rfc822 format available.

Message #5 received at submit <at> debbugs.gnu.org (full text, mbox):

From: Pierre Neidhardt <ambrevar <at> gmail.com>
To: bug-gnu-emacs <at> gnu.org
Subject: 25.3; Eshell: Ignore all duplicates when ignoredups is non-nil
Date: Thu, 15 Feb 2018 15:25:14 +0100
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




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#30466; Package emacs. (Thu, 15 Feb 2018 17:25:02 GMT) Full text and rfc822 format available.

Message #8 received at 30466 <at> debbugs.gnu.org (full text, mbox):

From: Glenn Morris <rgm <at> gnu.org>
To: Pierre Neidhardt <ambrevar <at> gmail.com>
Cc: 30466 <at> debbugs.gnu.org
Subject: Re: bug#30466: 25.3;
 Eshell: Ignore all duplicates when ignoredups is non-nil
Date: Thu, 15 Feb 2018 12:24:09 -0500
Pierre Neidhardt wrote:

> 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.

In terms of bash HISTCONTROL, this is the difference between
"ignoredups" and "erasedups".

Ref eg https://www.gnu.org/s/bash/manual/html_node/Bash-Variables.html#index-HISTCONTROL





Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#30466; Package emacs. (Thu, 04 Feb 2021 10:57:02 GMT) Full text and rfc822 format available.

Message #11 received at 30466 <at> debbugs.gnu.org (full text, mbox):

From: Lars Ingebrigtsen <larsi <at> gnus.org>
To: Glenn Morris <rgm <at> gnu.org>
Cc: 30466 <at> debbugs.gnu.org, Pierre Neidhardt <ambrevar <at> gmail.com>
Subject: Re: bug#30466: 25.3; Eshell: Ignore all duplicates when ignoredups
 is non-nil
Date: Thu, 04 Feb 2021 11:56:14 +0100
Glenn Morris <rgm <at> gnu.org> writes:

>> 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.
>
> In terms of bash HISTCONTROL, this is the difference between
> "ignoredups" and "erasedups".
>
> Ref eg
> https://www.gnu.org/s/bash/manual/html_node/Bash-Variables.html#index-HISTCONTROL

Sounds useful to me, so I've now added this to Emacs 28.

-- 
(domestic pets only, the antidote for overdose, milk.)
   bloggy blog: http://lars.ingebrigtsen.no




Added tag(s) fixed. Request was from Lars Ingebrigtsen <larsi <at> gnus.org> to control <at> debbugs.gnu.org. (Thu, 04 Feb 2021 10:57:02 GMT) Full text and rfc822 format available.

bug marked as fixed in version 28.1, send any further explanations to 30466 <at> debbugs.gnu.org and Pierre Neidhardt <ambrevar <at> gmail.com> Request was from Lars Ingebrigtsen <larsi <at> gnus.org> to control <at> debbugs.gnu.org. (Thu, 04 Feb 2021 10:57:03 GMT) Full text and rfc822 format available.

Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#30466; Package emacs. (Thu, 04 Feb 2021 11:04:02 GMT) Full text and rfc822 format available.

Message #18 received at 30466 <at> debbugs.gnu.org (full text, mbox):

From: Pierre Neidhardt <mail <at> ambrevar.xyz>
To: Lars Ingebrigtsen <larsi <at> gnus.org>, Glenn Morris <rgm <at> gnu.org>
Cc: 30466 <at> debbugs.gnu.org, Pierre Neidhardt <ambrevar <at> gmail.com>
Subject: Re: bug#30466: 25.3; Eshell: Ignore all duplicates when ignoredups
 is non-nil
Date: Thu, 04 Feb 2021 12:03:20 +0100
[Message part 1 (text/plain, inline)]
Thank you!

-- 
Pierre Neidhardt
https://ambrevar.xyz/
[signature.asc (application/pgp-signature, inline)]

bug archived. Request was from Debbugs Internal Request <help-debbugs <at> gnu.org> to internal_control <at> debbugs.gnu.org. (Thu, 04 Mar 2021 12:24:08 GMT) Full text and rfc822 format available.

This bug report was last modified 3 years and 46 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.