zsh-workers
 help / color / mirror / code / Atom feed
* RE: bug in _tar?
@ 2001-12-10 12:20 Wischnowsky, Sven
  0 siblings, 0 replies; 4+ messages in thread
From: Wischnowsky, Sven @ 2001-12-10 12:20 UTC (permalink / raw)
  To: zsh-workers


Bart wrote:

> ...
> 
> The source of the problem is going to be that "emacs-" is a prefix of two
> directories which might (probably even do) contain "lisp" subdirectories,
> whereas "emacs-21.1." is a prefix only of the tar.gz file name of which
> the "lisp/" suffix can't possibly be a part.  Consequently there are no
> matches, but rather than beeping, something is executing `compadd -U',
> causing the current word to be replaced by the empty completion.

I've had a look at the weekend. And, yes, it's a `compadd -U', almost.

The real problem is the as yet somewhat simple minded support for suffixes
or for match-insertion-control. It happens in _prefix, the match is already
added with the stuff to the right of the cursor stuffed in ISUFFIX. Then
_prefix checks if there is only one match (as in this case) and if so, it
uses a `compadd -U' to try to make the cursor stay in the right place. With
complicated match specs, this may result in parts of the word being removed.
And with -U there isn't even much we can do about it.

So I'd like to not try and fix this in the matching code but instead try to
come up with the better suffix and insertion handling we were talking about
anyway. I'll try to write a list for discussion real soon now (I've already
got my other machine and hope to be able to install Linux on it this week,
so mailing list handling will be a whole lot easier for me then, uff).


Bye
  Sven


^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: bug in _tar?
  2001-12-06 11:25 Adam Spiers
  2001-12-06 16:04 ` Oliver Kiddle
@ 2001-12-06 17:02 ` Bart Schaefer
  1 sibling, 0 replies; 4+ messages in thread
From: Bart Schaefer @ 2001-12-06 17:02 UTC (permalink / raw)
  To: Adam Spiers, zsh-workers

On Dec 6, 11:25am, Adam Spiers wrote:
} Subject: bug in _tar?

Almost certainly not a bug in _tar itself.

} The problem occurs when you have a word immediately after the cursor,
} i.e. with no space in between it and the cursor.

In this case zsh normally considers the stuff to the right of the cursor
to be part of the same word as what's to the left of the cursor.  Which
are you expecting: complete-in-word behavior or complete-prefix behavior?

(It sounds like you're expecting -prefix but getting -in-word.  Do you use
the _prefix completer?)

}   $ tar ztvf src/emacs-<TAB>lisp/
}   ---- archive file
}   emacs-21.1/             emacs-21.1.tar.gz       emacs-lisp-intro-1.05/
}   
} All good so far, but ...
} 
}   $ tar ztvf src/emacs-21.1.<TAB>lisp/
}   $ tar ztvf src
} 
} Suddenly everything vanishes.

I suspect this is a problem with your matcher specifications or with use
of the _approximate completer.  Try using <C-x ?> instead of <TAB> and
look at the debugging trace.

The source of the problem is going to be that "emacs-" is a prefix of two
directories which might (probably even do) contain "lisp" subdirectories,
whereas "emacs-21.1." is a prefix only of the tar.gz file name of which
the "lisp/" suffix can't possibly be a part.  Consequently there are no
matches, but rather than beeping, something is executing `compadd -U',
causing the current word to be replaced by the empty completion.

Sven would be the best person to address this ...

-- 
Bart Schaefer                                 Brass Lantern Enterprises
http://www.well.com/user/barts              http://www.brasslantern.com

Zsh: http://www.zsh.org | PHPerl Project: http://phperl.sourceforge.net   


^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: bug in _tar?
  2001-12-06 11:25 Adam Spiers
@ 2001-12-06 16:04 ` Oliver Kiddle
  2001-12-06 17:02 ` Bart Schaefer
  1 sibling, 0 replies; 4+ messages in thread
From: Oliver Kiddle @ 2001-12-06 16:04 UTC (permalink / raw)
  To: Adam Spiers; +Cc: zsh workers mailing list

Hi everyone.

Adam Spiers wrote:
> 
> The problem occurs when you have a word immediately after the cursor,
> i.e. with no space in between it and the cursor.
> 
>   $ tar ztvf src/emacs-<TAB>lisp/
>   ---- archive file
>   emacs-21.1/             emacs-21.1.tar.gz       emacs-lisp-intro-1.05/
> 
> All good so far, but ...
> 
>   $ tar ztvf src/emacs-21.1.<TAB>lisp/
>   $ tar ztvf src
> 
> Suddenly everything vanishes.
> 
> This is with latest CVS.

Firstly, the problem is not _tar. It would have helped a lot if you
could have first checked whether the problem was specific to tar (which
it isn't) and then isolated what part of your setup was needed to
reproduce the problem because I struggled to reproduce it.

If anyone else is struggling to reproduce this, try:
    zsh -f
    autoload -U compinit; compinit
    setopt completeinword
    zstyle ':completion:*' completer _complete _prefix
    _c() { compadd -p tz/ -M 'r:|/=* r:|=*' emacs-21.1.tar.gz }
    compdef _c c
    c tz/em<tab>y

In the case of the original _tar example, the compadd comes from
_path_files:650. Seems like a bug somewhere in the C code to me but I
have little idea beyond that. Sven?

Oliver

_____________________________________________________________________
This message has been checked for all known viruses by the 
MessageLabs Virus Scanning Service. For further information visit
http://www.messagelabs.com/stats.asp


^ permalink raw reply	[flat|nested] 4+ messages in thread

* bug in _tar?
@ 2001-12-06 11:25 Adam Spiers
  2001-12-06 16:04 ` Oliver Kiddle
  2001-12-06 17:02 ` Bart Schaefer
  0 siblings, 2 replies; 4+ messages in thread
From: Adam Spiers @ 2001-12-06 11:25 UTC (permalink / raw)
  To: zsh workers mailing list

The problem occurs when you have a word immediately after the cursor,
i.e. with no space in between it and the cursor.

  $ tar ztvf src/emacs-<TAB>lisp/
  ---- archive file
  emacs-21.1/             emacs-21.1.tar.gz       emacs-lisp-intro-1.05/
  
All good so far, but ...

  $ tar ztvf src/emacs-21.1.<TAB>lisp/
  $ tar ztvf src

Suddenly everything vanishes.

This is with latest CVS.


^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2001-12-10 12:27 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2001-12-10 12:20 bug in _tar? Wischnowsky, Sven
  -- strict thread matches above, loose matches on Subject: below --
2001-12-06 11:25 Adam Spiers
2001-12-06 16:04 ` Oliver Kiddle
2001-12-06 17:02 ` Bart Schaefer

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