zsh-workers
 help / color / mirror / code / Atom feed
* Programmable completion bug in beta18
@ 1996-05-22 17:28 Hrvoje Niksic
  1996-05-22 18:08 ` Zoltan Hidvegi
  0 siblings, 1 reply; 8+ messages in thread
From: Hrvoje Niksic @ 1996-05-22 17:28 UTC (permalink / raw)
  To: zsh-workers

It seems that a prog. completion bug has wound its way into beta18. This
most basic example fails:
{jagor}[0][~/hrv/zsh-2.6-beta18]$ echo $ZSH_VERSION
2.6-beta18
{jagor}[0][~/hrv/zsh-2.6-beta18]$ compctl -L cd
compctl -g '*(D-/)' cd
{jagor}[0][~/hrv/zsh-2.6-beta18]$ cd [^D]

^D gives no output. TAB refuses to menu-complete. Shortly, it doesn't work.

-- 
hniksic@srce.hr              |  Student of electrical engineering
hniksic@fly.cc.fer.hr        |  University of Zagreb, Croatia
------------------------------------------------------------------
`VI' - An editor used by those heretics that don't subscribe to
       the Emacs religion.



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

* Re: Programmable completion bug in beta18
  1996-05-22 17:28 Programmable completion bug in beta18 Hrvoje Niksic
@ 1996-05-22 18:08 ` Zoltan Hidvegi
  1996-05-22 18:47   ` Barton E. Schaefer
  0 siblings, 1 reply; 8+ messages in thread
From: Zoltan Hidvegi @ 1996-05-22 18:08 UTC (permalink / raw)
  To: hniksic; +Cc: Zsh workers list

[-- Attachment #1: Type: application/pgp, Size: 2934 bytes --]

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

* Re: Programmable completion bug in beta18
  1996-05-22 18:08 ` Zoltan Hidvegi
@ 1996-05-22 18:47   ` Barton E. Schaefer
  1996-05-22 19:26     ` Zoltan Hidvegi
  1996-05-22 19:30     ` Mark Borges
  0 siblings, 2 replies; 8+ messages in thread
From: Barton E. Schaefer @ 1996-05-22 18:47 UTC (permalink / raw)
  To: Zoltan Hidvegi; +Cc: zsh-workers

On May 22,  8:08pm, Zoltan Hidvegi wrote:
} Subject: Re: Programmable completion bug in beta18
}
} > compctl -g '*(D-/)' cd
} > {jagor}[0][~/hrv/zsh-2.6-beta18]$ cd [^D]
} > 
} > ^D gives no output. TAB refuses to menu-complete. Shortly, it doesn't work.
} 
} You need to set extended_glob for that.

For what, specifically?

} I think that extended_glob should be set by default when zsh is not called
} as sh or ksh.

There's a whole lot of extendedglob stuff that I don't normally want, so
up through 2.5* I've not had it set.  Under what circumstances is it now
required where it was not required before?

-- 
Bart Schaefer                     Vice President, Technology, Z-Code Software
schaefer@z-code.com                  Division of NCD Software Corporation
http://www.well.com/www/barts           http://www.ncdsoft.com/ZMail/



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

* Re: Programmable completion bug in beta18
  1996-05-22 18:47   ` Barton E. Schaefer
@ 1996-05-22 19:26     ` Zoltan Hidvegi
  1996-05-22 19:36       ` Hrvoje Niksic
  1996-05-22 19:30     ` Mark Borges
  1 sibling, 1 reply; 8+ messages in thread
From: Zoltan Hidvegi @ 1996-05-22 19:26 UTC (permalink / raw)
  To: schaefer; +Cc: zsh-workers

> On May 22,  8:08pm, Zoltan Hidvegi wrote:
> } Subject: Re: Programmable completion bug in beta18
> }
> } > compctl -g '*(D-/)' cd
> } > {jagor}[0][~/hrv/zsh-2.6-beta18]$ cd [^D]
> } > 
> } > ^D gives no output. TAB refuses to menu-complete. Shortly, it doesn't work.
> } 
> } You need to set extended_glob for that.
> 
> For what, specifically?
> 
> } I think that extended_glob should be set by default when zsh is not called
> } as sh or ksh.
> 
> There's a whole lot of extendedglob stuff that I don't normally want, so
> up through 2.5* I've not had it set.  Under what circumstances is it now
> required where it was not required before?

In case of compctl, the pattern is stored as a string, and tokenize() is
called to tokenize it, the same function which is used for GLOB_SUBST.  My
previous example was not really correct.  The problem is that:

% foo='*(/)'
% echo $foo

If zsh is called as sh this should print the files ending in (/) instead of
the directories.

echo *(D-/) is syntactically incorrect under sh and it still works in zsh
without extended_glob.  Everything is affected which uses tokenize()
internally.  E.g. the builtin command arguments after -m only know *, ? and
[...].  Elternatives does not work line (foo|bar)*.  Maybe some more
fine-grained control of glob behaviour is preferable.  With sh (, | and )
are ordinary characters in glob patterns.  Maybe we can keep the original
zsh behaviour and add a new option something like SH_GLOB wich does not
handle (, | and ) specially.

Zoltan



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

* Re: Programmable completion bug in beta18
  1996-05-22 18:47   ` Barton E. Schaefer
  1996-05-22 19:26     ` Zoltan Hidvegi
@ 1996-05-22 19:30     ` Mark Borges
  1996-05-22 19:53       ` Zoltan Hidvegi
  1 sibling, 1 reply; 8+ messages in thread
From: Mark Borges @ 1996-05-22 19:30 UTC (permalink / raw)
  To: alain (a.) caron; +Cc: zsh-workers

>> On Wed, 22 May 1996 11:47:55 -0700,
>> Barton E Schaefer(BES) wrote:
BES> On May 22,  8:08pm, Zoltan Hidvegi wrote:
BES> } Subject: Re: Programmable completion bug in beta18
BES> }
BES> } > compctl -g '*(D-/)' cd
BES> } > {jagor}[0][~/hrv/zsh-2.6-beta18]$ cd [^D]
BES> } > 
BES> } > ^D gives no output. TAB refuses to menu-complete. Shortly, it doesn't work.
BES> } 
BES> } You need to set extended_glob for that.

BES> For what, specifically?

extendedglob seems to be involved in the behaviour alain found as well:

>> On Tue, 21 May 1996 16:31:00 -0400 ,
>> a (ac) wrote:
ac> I think I have found a bug in release 2.6-beta17 with regards to
ac> compctl.

ac> I have the following line in my .zshrc

ac> # rm Emacs backup and autosave files first
ac> compctl -g "*\~(D) \#*\#(D)" + -f rm
ac> FIGNORE=".o:~"
[...]
ac> With zsh 2.5.03, it works as expected, but not with 2.6-beta17.  For
ac> example. with both files .zshrc and .zshrc~

ac> rm .zs<TAB>
ac> expands to
ac> "rm .zshrc\~"   (with 2.5.03) and to
ac> "rm .zshrc"     (with 2.6-beta17)

as well:

  $ ~/bin/sunos-5.5/zsh -f
  % ls -a
  .    ..   .z   .z~  a    a~
  % compctl -g "*~(D) #*#(D)" + -f rm
  % rm a<TAB>        # doesn't complete
  % setopt extendedglob
  % rm a\~ .z\~      # completes
  % ls -a
  .   ..  .z  a
  %

-- 
  -mb-



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

* Re: Programmable completion bug in beta18
  1996-05-22 19:26     ` Zoltan Hidvegi
@ 1996-05-22 19:36       ` Hrvoje Niksic
  1996-05-22 19:46         ` Zoltan Hidvegi
  0 siblings, 1 reply; 8+ messages in thread
From: Hrvoje Niksic @ 1996-05-22 19:36 UTC (permalink / raw)
  To: Zoltan Hidvegi; +Cc: schaefer, zsh-workers

In your mail, you said:
> fine-grained control of glob behaviour is preferable.  With sh (, | and )
> are ordinary characters in glob patterns.  Maybe we can keep the original
> zsh behaviour and add a new option something like SH_GLOB wich does not
> handle (, | and ) specially.

Yes! A vote for that solution (although the number of options is already
huge) -- I liked the behaviour as it was.

BTW, I do not understand what do you mean when you say that (, | and ) are
ordinary characters in sh patterns -- Solaris sh gives:

$ echo *(a)
syntax error: (' unexpected

-- 
hniksic@srce.hr              |  Student of electrical engineering
hniksic@fly.cc.fer.hr        |  University of Zagreb, Croatia
------------------------------------------------------------------
`VI' - An editor used by those heretics that don't subscribe to
       the Emacs religion.



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

* Re: Programmable completion bug in beta18
  1996-05-22 19:36       ` Hrvoje Niksic
@ 1996-05-22 19:46         ` Zoltan Hidvegi
  0 siblings, 0 replies; 8+ messages in thread
From: Zoltan Hidvegi @ 1996-05-22 19:46 UTC (permalink / raw)
  To: hniksic; +Cc: Zsh workers list

> BTW, I do not understand what do you mean when you say that (, | and ) are
> ordinary characters in sh patterns -- Solaris sh gives:
> 
> $ echo *(a)
> syntax error: (' unexpected

But

$ foo='*(a)'
$ echo $foo

prints files ending in (a).

Zoltan



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

* Re: Programmable completion bug in beta18
  1996-05-22 19:30     ` Mark Borges
@ 1996-05-22 19:53       ` Zoltan Hidvegi
  0 siblings, 0 replies; 8+ messages in thread
From: Zoltan Hidvegi @ 1996-05-22 19:53 UTC (permalink / raw)
  To: Mark Borges; +Cc: alainc, zsh-workers

> extendedglob seems to be involved in the behaviour alain found as well:

No, that's a completely different bug.

> ac> compctl -g "*\~(D) \#*\#(D)" + -f rm
> ac> FIGNORE=".o:~"

This does not work even if glob_subst is set.

>   % compctl -g "*~(D) #*#(D)" + -f rm

You did not use backslashes here.  The problem is that remnulargs() should
probably be called before globlist() in the relevant part of zle_tricty.c,
but I have to think about it a little to figure out the right solution.  An
alternative solution is to ignore INULL characters in glob.c.

Zoltan



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

end of thread, other threads:[~1996-05-22 20:12 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
1996-05-22 17:28 Programmable completion bug in beta18 Hrvoje Niksic
1996-05-22 18:08 ` Zoltan Hidvegi
1996-05-22 18:47   ` Barton E. Schaefer
1996-05-22 19:26     ` Zoltan Hidvegi
1996-05-22 19:36       ` Hrvoje Niksic
1996-05-22 19:46         ` Zoltan Hidvegi
1996-05-22 19:30     ` Mark Borges
1996-05-22 19:53       ` Zoltan Hidvegi

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