zsh-users
 help / color / mirror / code / Atom feed
* "rehash" each time a new program is installed?
@ 2001-02-15 17:57 Louis-David Mitterrand
  2001-02-15 19:31 ` Bart Schaefer
  0 siblings, 1 reply; 12+ messages in thread
From: Louis-David Mitterrand @ 2001-02-15 17:57 UTC (permalink / raw)
  To: zsh-users

[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #1: Type: text/plain; charset=us-ascii, Size: 650 bytes --]

Hello,

I find myself having to run "rehash" to get zsh to recognize the
presence of a new executable in the PATH. bash doesn't seem to have that
requirement. Is there an option to get that behavior in zsh?

Also, how could I have zsh not list "CVS" directories when completing
paths? I tried fignore but it doesn't work.

Oh, and a last one ;) Is it possible to "fignore" a file except when
it's the only completion candidate (considering the typed string e.g.)?

Thanks in advance,

-- 
    OENONE: Quoi, Madame ?
    PHEDRE: Insensée, où suis-je ? et qu'ai-je dit ?
                                          (Phèdre, J-B Racine, acte 1, scène 3)


^ permalink raw reply	[flat|nested] 12+ messages in thread
* Re: "rehash" each time a new program is installed?
@ 2001-02-16  8:06 Sven Wischnowsky
  2001-02-16 10:21 ` Louis-David Mitterrand
  0 siblings, 1 reply; 12+ messages in thread
From: Sven Wischnowsky @ 2001-02-16  8:06 UTC (permalink / raw)
  To: zsh-users; +Cc: Louis-David Mitterrand


Bart Schaefer wrote:

> ...
>
> } Oh, and a last one ;) Is it possible to "fignore" a file except when
> } it's the only completion candidate (considering the typed string e.g.)?
> 
> That should happen already:
> 
> fignore <S> <Z> (FIGNORE <S>)
>      An array (colon separated list) containing the suffixes of files
>      to be ignored during filename completion.  However, if the
>      completion generates only files which would match if this variable
>      would be ignored, than these files are completed anyway.

The fact that it doesn't work out of the box might mean that he's
using the new completion system. In that case he needs to use the
_ignored completer, as in:

  zstyle ':completion:*' completer _complete _ignored


And if he's using the new completion system, this:

> } Also, how could I have zsh not list "CVS" directories when completing
> } paths? I tried fignore but it doesn't work.
> 
> I don't immediately recall any way to ignore intermediate directories in
> a path.  It's probably possible using styles in 3.1.6 and later, but the
> only way for 3.0.8 would be to write a "compctl -K" function and attach
> it to the specific commands for which you don't want to see CVS.

can be solved, too. One only needs to not set $fignore, but instead
use the ignored-patterns style, like so:

  zstyle ':completion:*:complete:*:(all-|)files' \
      '?*~' '?*.(o|log|aux|...)' '(|*/)CVS'
                 ^^^^^^^^^^^^^
                    whatever suffixes one wants to have ignored

And finally: the _ignored completer can also be customized, see the
manual/info or Peter's guide (from www.zsh.org).

Bye
 Sven


--
Sven Wischnowsky                         wischnow@informatik.hu-berlin.de


^ permalink raw reply	[flat|nested] 12+ messages in thread
* Re: "rehash" each time a new program is installed?
@ 2001-02-19  9:20 Sven Wischnowsky
  2001-02-19 20:36 ` Thomas Köhler
  0 siblings, 1 reply; 12+ messages in thread
From: Sven Wischnowsky @ 2001-02-19  9:20 UTC (permalink / raw)
  To: zsh-users


Wayne Davison wrote:

> On Thu, 15 Feb 2001, Bart Schaefer wrote:
> > On Feb 15,  6:57pm, Louis-David Mitterrand wrote:
> > } Oh, and a last one ;) Is it possible to "fignore" a file except when
> > } it's the only completion candidate (considering the typed string e.g.)?
> > 
> > That should happen already:
> 
> There's a problem with this in the new completion system (which I
> complained about quite a while ago).  Fignore works with the old
> completion code, but the new system will never complete a file name
> in the fignore list.  An example of doing both:
> 
>     % zsh -f
>     % fignore=( .bak )
>     % touch test1 test1.bak
>     % ls test1.<TAB>
> 
> This results in the expected test1.bak.  Now continue:
> 
>     % autoload -U compinit
>     % compinit
>     % zstyle ':completion:*' completer _expand _complete
>     % bindkey '\t' complete-word
>     % ls test1.<TAB>
> 
> It just beeps at you.  Using a wildcard will cause _expand to list the
> file, but _complete totally ignores it.  Is there an option that I'm
> missing?  I've tried using:
> 
>     % zstyle ':completion:*:all-files' ignored-patterns \*.bak
> 
> (instead of fignore) with the same results.

(Err, deja vu.  Didn't I answer a similar question last week?)

Anyway... you didn't include the _ignored completer in your list.
With that it will work.

If you don't set the completer style, the default will be used and
that is (_complete _ignored).


Thomas Koehler wrote:

> ...
> 
> % zsh -f
> picard% fignore=3D( .bak )
> picard% touch test1 test1.bak
> picard% autoload -U compinit
> picard% compinit
> picard% ls test1.<TAB>
>   -> leads to
>   picard% ls test1.bak
> 
> Ah, here's the problem: complete-word! expand-or-complete works fine!
> Why is this the case?

For me it works with both bindings. Old version?

Bye
 Sven


--
Sven Wischnowsky                         wischnow@informatik.hu-berlin.de


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

end of thread, other threads:[~2001-05-21 17:31 UTC | newest]

Thread overview: 12+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2001-02-15 17:57 "rehash" each time a new program is installed? Louis-David Mitterrand
2001-02-15 19:31 ` Bart Schaefer
2001-02-16 10:18   ` Louis-David Mitterrand
2001-02-16 18:23   ` Wayne Davison
2001-02-17 12:54     ` Thomas Köhler
2001-04-12 21:07       ` problem making 4.0.1-pre-3 S. Cowles
2001-04-13 10:35         ` Andrej Borsenkow
2001-05-21 17:31         ` Andrej Borsenkow
2001-02-16  8:06 "rehash" each time a new program is installed? Sven Wischnowsky
2001-02-16 10:21 ` Louis-David Mitterrand
2001-02-19  9:20 Sven Wischnowsky
2001-02-19 20:36 ` Thomas Köhler

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