GNU bug report logs -
#63362
Bug+fix for eshell-hist-ignore-dups 'erase
Previous Next
Full log
Message #5 received at submit <at> debbugs.gnu.org (full text, mbox):
Ah! The second bug (the case where there are zero history entries) is
due to the immediately surrounding lines:
(unless (ring-empty-p eshell-history-ring)
...
t)
Same exact steps to reproduce, just don't add one entry to the history
ring - leave it empty.
The cause is that these lines are inside a big condition of a big
`when` - but that "condition" is complecting two things:
1. the actual predicate - should we add this input to the history ring? and
2. the history management side-effects that need to happen if that
predicate is true, before the history addition is made.
So the key observation is that this `(unless ...)` is part of the
surrounding `(and ...)` but is not actually there to influence the
condition! It's there to catch a case which requires a different
side-effect. But when the inner `(unless ...)` was added, the `t` got
accidentally/wrongly scooped into the `(unless ...)` along with the
side-effect.
I think the ideal fix here is a refactor that makes the big picture
clearer (I can provide one if asked, but that would almost certainly
have enough creative substance to require copyright assignment, and
would need to wait on the paperwork). But a good-enough, minimally
disruptive fix that is too mechanical and small to be copyrightable is
just to change the `(unless ... t)` to a `(progn (unless ...) t)`:
(progn
(unless (ring-empty-p eshell-history-ring)
...)
t)
This bug report was last modified 1 year and 272 days ago.
Previous Next
GNU bug tracking system
Copyright (C) 1999 Darren O. Benham,
1997,2003 nCipher Corporation Ltd,
1994-97 Ian Jackson.