zsh-workers
 help / color / mirror / code / Atom feed
From: Adam Spiers <adam@thelonious.new.ox.ac.uk>
To: zsh-workers@sunsite.auc.dk
Subject: Re: PATCH: 3.1.6-pws-4: Re: simulation of dabbrev-expand
Date: Wed, 22 Sep 1999 23:21:03 +0100	[thread overview]
Message-ID: <19990922232103.B30531@thelonious.new.ox.ac.uk> (raw)
In-Reply-To: <990918195949.ZM6493@candle.brasslantern.com>

Bart Schaefer (schaefer@candle.brasslantern.com) wrote:
> } > On Sep 9,  1:39pm, Adam Spiers wrote:
> } > } Subject: simulation of dabbrev-expand
> } > }
> } > } It appears to always work fine when grabbing words from history added
> } > } by the current shell, but either doesn't work at all, or very
> } > } unreliably when you want to grab a word from the saved history.
> 
> I'm finally able to reproduce something like this.

[...]

> The problem is in zle_tricky.c's use of quietgethist().  With Wayne's new
> stuff, the history list may have holes in it, but makecomplistflags() is
> trying to iterate over the history by calling quietgethist() on consecutive
> integers until it returns nothing -- which happens whenever it encounters
> such a hole.

Ahhh!  Of course!  I had looked at quietgethist() but never twigged
about the holes.

> I think the patch below should take care of this part, but it's possible
> that I've done more than was necessary; in particular, the hist.c hunk
> may not be needed: it might suffice to call the original quietgethist()
> before the loop in makecomplistflags().  It's also possible that calling
> up_histent() N times is the wrong thing to do:  Should the number passed
> to compgen -H specify the number of history entries searched or the range
> of history numbers searched?  I've interpreted it as the former.

I think that's a sensible choice.

[snip patch]

Bart, you're a hero.  This bug has been er, bugging me for ages.
Together with Sven's nice duplicate removing options we can finally
have the dabbrev-expand behaviour which up till now has been the only
aspect of zsh I've found inferior to any other shell.  Great work guys :-)


      reply	other threads:[~1999-09-22 22:21 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <19990909133913.A30055@thelonious.new.ox.ac.uk>
     [not found] ` <990909171104.ZM15814@candle.brasslantern.com>
     [not found]   ` <19990916173409.A17932@thelonious.new.ox.ac.uk>
1999-09-17 21:44     ` Adam Spiers
1999-09-18 19:59       ` PATCH: 3.1.6-pws-4: " Bart Schaefer
1999-09-22 22:21         ` Adam Spiers [this message]

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=19990922232103.B30531@thelonious.new.ox.ac.uk \
    --to=adam@thelonious.new.ox.ac.uk \
    --cc=adam@spiers.net \
    --cc=zsh-workers@sunsite.auc.dk \
    /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).