zsh-workers
 help / color / mirror / code / Atom feed
From: Peter Stephenson <p.stephenson@samsung.com>
To: zsh-workers@zsh.org
Subject: Re: HIST_IGNORE_DUPS ignores lines which differ by a different number of spaces
Date: Fri, 19 Apr 2013 13:42:38 +0100	[thread overview]
Message-ID: <20130419134238.7a8a05a3@pwslap01u.europe.root.pri> (raw)
In-Reply-To: <20130418210411.3254ac63@pws-pc.ntlworld.com>

On Thu, 18 Apr 2013 21:04:11 +0100
Peter Stephenson <p.w.stephenson@ntlworld.com> wrote:
> My best guess is it's got something to do with freehistdata(), which
> appears to be the only way the hash table can affect the history ring.

Revised theory: when the new node gets added, it retrieves the old node
(addhistnode() in hashtable.c).  Because of the name mangling it
retrieves the previous line if that's the same up to (any, even
significant) white space, even if HIST_IGNORE_DUPS isn't set.  (This is
what's bamboozling me the most.)  Because there's an old node (at all,
even if it doesn't match completely) it gets marked as HIST_DUP by
addhistnode().  Then logic elsewhere removes it.

It's just occurred to me that while it might get *marked* with HIST_DUP
undconditionally, the logic to remove duplicates only kicks in if
HIST_IGNORE_DUPS is set.  That might explain why NO_HIST_IGNORE_DUPS
works at all.

Is this jogging any memories?  The code is (by strong zsh tradition)
undocumented.

pws


  reply	other threads:[~2013-04-19 12:52 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-04-16 17:05 Vincent Lefevre
2013-04-17 16:41 ` Bart Schaefer
2013-04-18 20:04 ` Peter Stephenson
2013-04-19 12:42   ` Peter Stephenson [this message]
2013-04-20  3:01     ` Bart Schaefer

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20130419134238.7a8a05a3@pwslap01u.europe.root.pri \
    --to=p.stephenson@samsung.com \
    --cc=zsh-workers@zsh.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://git.vuxu.org/mirror/zsh/

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).