zsh-workers
 help / color / mirror / code / Atom feed
From: Bart Schaefer <schaefer@brasslantern.com>
To: Peter Stephenson <pws@cambridgesiliconradio.com>
Cc: Zsh hackers list <zsh-workers@sunsite.auc.dk>
Subject: Re: history completion oddity
Date: Tue, 20 Jun 2000 17:52:12 -0700 (PDT)	[thread overview]
Message-ID: <Pine.LNX.4.20.0006201324040.2989-100000@aztec.zanshin.com> (raw)
In-Reply-To: <0FWG003OMOKZCF@la-la.cambridgesiliconradio.com>

On Tue, 20 Jun 2000, Peter Stephenson wrote:

> I expect Sven will tell me this is the way it should work (or has to work),
> but it's worth a try...

I think this is in fact a bug ...

> history completion (ESC-/) on
>   % echo ${PWD
> does nothing.

Using the _history completer and ^X?, I find that this line gets executed:

+_all_labels:39> compadd -1V -default- -Q -a h_words

This ought to produce a match, but apparently it does not, because the
return value is nonzero so _all_labels eventually returns 1.  With

>   % echo ${PWD/

the same compadd is executed, but this time it DOES match.

> I would guess that something visceral is grabbing potential parameter
> completions before the history code can do anything

Nope.

Incidentally, I just had an exchange with A. Spiegl in which he noted that
history completion is unacceptably slow because he has HISTSIZE=15000.  He
also has several match specs.  I played around with the _history completer
a little and found that it gets called once for every match spec, which
thus assigns h_words=("${(@)historywords[2,-1]}") each time ... I estimate
that at ~5 words per command and ~4 bytes per word, zsh is copying about
300Kb of memory every time it does that assignment, so zsh rips through
as much as 3Mb every time he hits TAB.

Admittedly, keeping 15000 lines of history is a little unusual, but there
must be something we can do about this.  (Imagine what was going on before
Sven added "compadd -a arrayname" ...)


      reply	other threads:[~2000-06-21  0:52 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2000-06-20 16:31 Peter Stephenson
2000-06-21  0:52 ` Bart Schaefer [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=Pine.LNX.4.20.0006201324040.2989-100000@aztec.zanshin.com \
    --to=schaefer@brasslantern.com \
    --cc=pws@cambridgesiliconradio.com \
    --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).