zsh-users
 help / color / mirror / code / Atom feed
* make completion on OpenBSD
@ 2002-05-22 19:27 Jukka Lehti
  0 siblings, 0 replies; 11+ messages in thread
From: Jukka Lehti @ 2002-05-22 19:27 UTC (permalink / raw)
  To: zsh-users

Hi,

I've been using following in my ~/.zshrc to get make
completion right:

compctl -s "\$(awk '/^[a-zA-Z0-9][^\/ \t]+:/ {print
\$1}' FS=: [mM]akefile)" -x 'c[-1,-f]' -f --
{,g,gnu,p,v}make

And this works just fine on Linuxes (RedHat, Debian).
However, after I installed OpenBSD 3.1 and zsh-4.0.4,
the above behaves strangely:

root@bsd:~>make <TAB>awk: i/o error occurred while
closing /dev/stdin
 input record number 538, file Makefile
 source line number 1
p
dep dep-files depend
root@bsd:~>make dep

Makefile is the top-level Makefile from linux-2.4.18.

Any suggestions?

Thanks.

__________________________________________________
Do You Yahoo!?
LAUNCH - Your Yahoo! Music Experience
http://launch.yahoo.com


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

* Re: make completion on OpenBSD
  2002-05-28 15:21             ` Bart Schaefer
@ 2002-05-28 21:18               ` Dennis Haney
  0 siblings, 0 replies; 11+ messages in thread
From: Dennis Haney @ 2002-05-28 21:18 UTC (permalink / raw)
  Cc: Jukka Lehti, zsh-users

[-- Attachment #1: Type: text/plain, Size: 740 bytes --]

Bart Schaefer wrote:

>On Tue, 28 May 2002, Jukka Lehti wrote:
>
>  
>
>>One thing I really miss from default completions is
>>the "cd ..<TAB>" producing /. With Finnish/Swedish
>>(probably German, too) keyboards / is shift+7 and
>>that's quite a penalty.
>>    
>>
>
>http://www.zsh.org/cgi-bin/mla/wilma_glimpse/users?query=shift%3B7&Search=Search&lineonly=on&errors=0&maxfiles=50&maxlines=10
>
>  
>
That doesn't really find what we came up with last time ;(

## Make .. DWIM

setopt GLOB_DOTS

zstyle -e ':completion:*' special-dirs '[[ $PREFIX = (../)#(|.|..) ]] && reply=(..)'

zstyle ':completion:*' ignore-parents parent directory




-- 
Dennis
use Inline C => qq{void p(char*g){printf("Just Another %s Hacker\n",g);}};p("Perl");


[-- Attachment #2: Type: text/html, Size: 1425 bytes --]

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

* Re: make completion on OpenBSD
  2002-05-28 11:05           ` Jukka Lehti
@ 2002-05-28 15:21             ` Bart Schaefer
  2002-05-28 21:18               ` Dennis Haney
  0 siblings, 1 reply; 11+ messages in thread
From: Bart Schaefer @ 2002-05-28 15:21 UTC (permalink / raw)
  To: Jukka Lehti; +Cc: zsh-users

On Tue, 28 May 2002, Jukka Lehti wrote:

> One thing I really miss from default completions is
> the "cd ..<TAB>" producing /. With Finnish/Swedish
> (probably German, too) keyboards / is shift+7 and
> that's quite a penalty.

http://www.zsh.org/cgi-bin/mla/wilma_glimpse/users?query=shift%3B7&Search=Search&lineonly=on&errors=0&maxfiles=50&maxlines=10


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

* Re: make completion on OpenBSD
  2002-05-26 18:16         ` Bart Schaefer
@ 2002-05-28 11:05           ` Jukka Lehti
  2002-05-28 15:21             ` Bart Schaefer
  0 siblings, 1 reply; 11+ messages in thread
From: Jukka Lehti @ 2002-05-28 11:05 UTC (permalink / raw)
  To: Bart Schaefer; +Cc: zsh-users

> That's what I was trying to tell you.  If you remove
> the backslashes, then the $(awk ...) runs at the
> time
> that you *define* the compctl, rather than at the
> time
> that you attempt a completion.  That's the effect of
> having it inside double quotes.  So without the
> backslashes, it only "works" if you run the compctl
> command in the same directory that holds the
> Makefile.

Ok, now I finally got it!

> After loading the new system with `compinit', unset
> the elements of the _comps assoc corresponding to
> the
> compctls that you prefer to use.  E.g.
> 
>  unset '_comps[foo]' '_comps[bar]' '_comps[etc]'
> 
> or (shorthand)
> 
>  noglob unset _comps[{foo,bar,etc}]

Amazing, this really works! :)

> > Maybe I should "port" my compctl rules to compsys
> > rules (I presume they can be override system
> > defaults?), but it takes time if it cannot be
> > automated.
> 
> There isn't any automated way, but it's possible
> that
> there are zstyle commands you could use to get the
> behavior that you want -- many of the new
> completions
> are very configurable.  Ask on the list about a few
> that are most important to you.

I think I'll use compctl for now, I have one system
where only zsh3 is installed. I guess compctl will not
be removed from zsh (ever/soon)?

>  Even if zstyles are
> not available it's possible that your different
> behaviors are generally useful enough to get folded
> into the distribution.

They seemed to work very well, make was an exception:

if in a Makefile is line

FOO :=

make <TAB> lists that also as possible completion,
although "make FOO" is meaningless.

One thing I really miss from default completions is
the "cd ..<TAB>" producing /. With Finnish/Swedish
(probably German, too) keyboards / is shift+7 and
that's quite a penalty.

Anyway, thanks again!

__________________________________________________
Do You Yahoo!?
Yahoo! - Official partner of 2002 FIFA World Cup
http://fifaworldcup.yahoo.com


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

* Re: make completion on OpenBSD
  2002-05-26 17:31       ` Jukka Lehti
@ 2002-05-26 18:16         ` Bart Schaefer
  2002-05-28 11:05           ` Jukka Lehti
  0 siblings, 1 reply; 11+ messages in thread
From: Bart Schaefer @ 2002-05-26 18:16 UTC (permalink / raw)
  To: Jukka Lehti; +Cc: zsh-users

On Sun, 26 May 2002, Jukka Lehti wrote:

> Anyway, I've made some silly mistake, now it seems
> that following works on Linuxes too, after all:
>
> compctl -s "$(awk '/^[a-zA-Z0-9][^\/ \t]+:/ {print
> $1}' FS=: [Mm]akefile)" -x 'c[-1,-f]' -f --
> {,g,gnu,p,v}make
>
> (So backslashes not needed before $'s. Why backslashes
> do not work with BSD awk is a mystery.)
>
> Sorry for wasting everyones time here.

On Sun, 26 May 2002, Jukka Lehti wrote:

> Argh.. This seems to be hopeless. If backslashes are
> not used, on Linux root gets an error:
>
> /root/.zshrc:613: no match

That's what I was trying to tell you.  If you remove
the backslashes, then the $(awk ...) runs at the time
that you *define* the compctl, rather than at the time
that you attempt a completion.  That's the effect of
having it inside double quotes.  So without the
backslashes, it only "works" if you run the compctl
command in the same directory that holds the Makefile.

Furthermore, with the backslashes present, they should
be getting removed by zsh at the time it parses the
double quoted string, long before awk gets anywhere
near it.  The whole thing with the backslashed dollar
signs is a wild goose chase; the problem is somewhere
else, and it's almost certainly something to do with
awk.

> > In any event, since you're using zsh-4.0.4, why
> > not abandon your compctl entirely and enable the
> > newer completion system?  It includes a very
> > detailed "make" completion.
>
> I would love to do that, but I have about 50 compctl
> rules for which I've spent countless hours and some of
> those behave different than the newer completion
> system defaults. I haven't found a way to use the
> newer system and override some of those rules with my
> own compctl rules.

After loading the new system with `compinit', unset
the elements of the _comps assoc corresponding to the
compctls that you prefer to use.  E.g.

 unset '_comps[foo]' '_comps[bar]' '_comps[etc]'

or (shorthand)

 noglob unset _comps[{foo,bar,etc}]

> Maybe I should "port" my compctl rules to compsys
> rules (I presume they can be override system
> defaults?), but it takes time if it cannot be
> automated.

There isn't any automated way, but it's possible that
there are zstyle commands you could use to get the
behavior that you want -- many of the new completions
are very configurable.  Ask on the list about a few
that are most important to you.  Even if zstyles are
not available it's possible that your different
behaviors are generally useful enough to get folded
into the distribution.


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

* Re: make completion on OpenBSD
  2002-05-25 17:42     ` Bart Schaefer
  2002-05-26 10:58       ` Jukka Lehti
@ 2002-05-26 17:31       ` Jukka Lehti
  2002-05-26 18:16         ` Bart Schaefer
  1 sibling, 1 reply; 11+ messages in thread
From: Jukka Lehti @ 2002-05-26 17:31 UTC (permalink / raw)
  To: Bart Schaefer; +Cc: zsh-users

>(So backslashes not needed before $'s. Why
> backslashes do not work with BSD awk is a mystery.)
>
> Sorry for wasting everyones time here.

Argh.. This seems to be hopeless. If backslashes are
not used, on Linux root gets an error:

/root/.zshrc:613: no match

__________________________________________________
Do You Yahoo!?
Yahoo! - Official partner of 2002 FIFA World Cup
http://fifaworldcup.yahoo.com


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

* Re: make completion on OpenBSD
  2002-05-25 17:42     ` Bart Schaefer
@ 2002-05-26 10:58       ` Jukka Lehti
  2002-05-26 17:31       ` Jukka Lehti
  1 sibling, 0 replies; 11+ messages in thread
From: Jukka Lehti @ 2002-05-26 10:58 UTC (permalink / raw)
  To: Bart Schaefer; +Cc: zsh-users

> One possible difference is that awk is definitely
> GNU awk on RedHat, but
> it may be something else on OpenBSD.

Yes, OpenBSD has awk derivate from 4.4BSD, gawk is a
seperate package. (gawk is about 200k, awk 100k!)

Anyway, I've made some silly mistake, now it seems
that following works on Linuxes too, after all:

compctl -s "$(awk '/^[a-zA-Z0-9][^\/ \t]+:/ {print
$1}' FS=: [Mm]akefile)" -x 'c[-1,-f]' -f --
{,g,gnu,p,v}make

(So backslashes not needed before $'s. Why backslashes
do not work with BSD awk is a mystery.)

Sorry for wasting everyones time here.

> In any event, since you're using zsh-4.0.4, why not
> abandon your compctl
> entirely and enable the newer completion system?  It
> includes a very
> detailed "make" completion.

I would love to do that, but I have about 50 compctl
rules for which I've spent countless hours and some of
those behave different than the newer completion
system defaults. I haven't found a way to use the
newer system and override some of those rules with my
own compctl rules. Maybe I should "port" my compctl
rules to compsys rules (I presume they can be override
system defaults?), but it takes time if it cannot be
automated.

Thanks.

__________________________________________________
Do You Yahoo!?
Yahoo! - Official partner of 2002 FIFA World Cup
http://fifaworldcup.yahoo.com


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

* Re: make completion on OpenBSD
  2002-05-25 10:18   ` Jukka Lehti
@ 2002-05-25 17:42     ` Bart Schaefer
  2002-05-26 10:58       ` Jukka Lehti
  2002-05-26 17:31       ` Jukka Lehti
  0 siblings, 2 replies; 11+ messages in thread
From: Bart Schaefer @ 2002-05-25 17:42 UTC (permalink / raw)
  To: Jukka Lehti; +Cc: zsh-users

(Let's peel off some indentation here ...)

On Sat, 25 May 2002, Jukka Lehti wrote:

> compctl -s "\$(awk '/^[a-zA-Z0-9][^\/ \t]+:/{print \$1}' FS=: [mM]akefile)" -x 'c[-1,-f]' -f -- {,g,gnu,p,v}make

> I did "setopt > opts" on both machines and diff
> shows that the files are identical. Both machines have
> zsh-4.0.4. OS are Red Hat Linux 7.3 and OpenBSD 3.1,
> both pretty much at out-of-box state.

One possible difference is that awk is definitely GNU awk on RedHat, but
it may be something else on OpenBSD.  Have you tried running just the awk
expressions on both platforms to see if the output is different?

awk '/^[a-zA-Z0-9][^\/ \t]+:/{print $1}' FS=: [mM]akefile

In particular I'm wondering if you need a literal tab instead of \t in
that character class on OpenBSD.

In any event, since you're using zsh-4.0.4, why not abandon your compctl
entirely and enable the newer completion system?  It includes a very
detailed "make" completion.


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

* Re: make completion on OpenBSD
  2002-05-24 17:02 ` Bart Schaefer
@ 2002-05-25 10:18   ` Jukka Lehti
  2002-05-25 17:42     ` Bart Schaefer
  0 siblings, 1 reply; 11+ messages in thread
From: Jukka Lehti @ 2002-05-25 10:18 UTC (permalink / raw)
  To: Bart Schaefer; +Cc: zsh-users


--- Bart Schaefer <schaefer@brasslantern.com> wrote:
> On Fri, 24 May 2002, Jukka Lehti wrote:
> 
> > I wrote:
> >
> > > compctl -s "\$(awk '/^[a-zA-Z0-9][^\/ \t]+:/
> {print
> > > \$1}' FS=: [mM]akefile)" -x 'c[-1,-f]' -f --
> > > {,g,gnu,p,v}make
> > >
> > > However, after I installed OpenBSD 3.1 and
> zsh-4.0.4,
> > > the above behaves strangely
> >
> > Well, after removing backslashed before $'s it
> started
> > to work on OpenBSD
> 
> Removing the backslashes is almost certainly the
> wrong thing to do, given
> that you have double quotes around the "$(awk ...}".
> 
> More likely you should check whether the values of
> your setopts are the
> same on OpenBSD as they are on Linux.  E.g., does
> one have sh_word_split
> set and the other not?

No. I did "setopt > opts" on both machines and diff
shows that the files are identical. Both machines have
zsh-4.0.4. OS are Red Hat Linux 7.3 and OpenBSD 3.1,
both pretty much at out-of-box state.

__________________________________________________
Do You Yahoo!?
Yahoo! - Official partner of 2002 FIFA World Cup
http://fifaworldcup.yahoo.com


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

* Re: make completion on OpenBSD
  2002-05-24 16:30 Jukka Lehti
@ 2002-05-24 17:02 ` Bart Schaefer
  2002-05-25 10:18   ` Jukka Lehti
  0 siblings, 1 reply; 11+ messages in thread
From: Bart Schaefer @ 2002-05-24 17:02 UTC (permalink / raw)
  To: Jukka Lehti; +Cc: zsh-users

On Fri, 24 May 2002, Jukka Lehti wrote:

> I wrote:
>
> > compctl -s "\$(awk '/^[a-zA-Z0-9][^\/ \t]+:/ {print
> > \$1}' FS=: [mM]akefile)" -x 'c[-1,-f]' -f --
> > {,g,gnu,p,v}make
> >
> > However, after I installed OpenBSD 3.1 and zsh-4.0.4,
> > the above behaves strangely
>
> Well, after removing backslashed before $'s it started
> to work on OpenBSD

Removing the backslashes is almost certainly the wrong thing to do, given
that you have double quotes around the "$(awk ...}".

More likely you should check whether the values of your setopts are the
same on OpenBSD as they are on Linux.  E.g., does one have sh_word_split
set and the other not?


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

* Re: make completion on OpenBSD
@ 2002-05-24 16:30 Jukka Lehti
  2002-05-24 17:02 ` Bart Schaefer
  0 siblings, 1 reply; 11+ messages in thread
From: Jukka Lehti @ 2002-05-24 16:30 UTC (permalink / raw)
  To: zsh-users

I wrote:

> compctl -s "\$(awk '/^[a-zA-Z0-9][^\/ \t]+:/ {print
> \$1}' FS=: [mM]akefile)" -x 'c[-1,-f]' -f --
> {,g,gnu,p,v}make
>
> However, after I installed OpenBSD 3.1 and
zsh-4.0.4,
> the above behaves strangely

Well, after removing backslashed before $'s it started
to work on OpenBSD but broke on Linux. I guess I'll
set up:

[[ "`uname`" = "Linux" ]] && ... || ...

if nobody has better ideas.

Cheers!

__________________________________________________
Do You Yahoo!?
LAUNCH - Your Yahoo! Music Experience
http://launch.yahoo.com


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

end of thread, other threads:[~2002-05-28 21:21 UTC | newest]

Thread overview: 11+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2002-05-22 19:27 make completion on OpenBSD Jukka Lehti
2002-05-24 16:30 Jukka Lehti
2002-05-24 17:02 ` Bart Schaefer
2002-05-25 10:18   ` Jukka Lehti
2002-05-25 17:42     ` Bart Schaefer
2002-05-26 10:58       ` Jukka Lehti
2002-05-26 17:31       ` Jukka Lehti
2002-05-26 18:16         ` Bart Schaefer
2002-05-28 11:05           ` Jukka Lehti
2002-05-28 15:21             ` Bart Schaefer
2002-05-28 21:18               ` Dennis Haney

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