From: Bart Schaefer <schaefer@brasslantern.com>
To: zsh-workers@zsh.org
Subject: Re: buggy configure completion - when both --enable-foo and --disable-foo are listed
Date: Tue, 6 Sep 2016 22:39:01 -0700 [thread overview]
Message-ID: <160906223901.ZM11245@torch.brasslantern.com> (raw)
In-Reply-To: <f287f209-6f21-5122-255a-81834358b302@googlemail.com>
On Sep 2, 11:02pm, m0viefreak wrote:
} Subject: Re: buggy configure completion - when both --enable-foo and --dis
}
} On 02.09.2016 03:27, Bart Schaefer wrote:
} > I have to update that to look for more than eight spaces for it to work
} > right for zsh's ./configure
}
} Oh, right, I'm missing one #. It should have been '[8spaces]##':
}
} zstyle ':completion:*:configure:*:options' command $'print -r -- "${$(COLUMNS=9999 ${~words[1]} --help)//\n ##/ }"'
}
} > and even then it mysteriously fails to pick
} > out defaults [/usr/local] and [PREFIX] for --prefix and --exec-prefix
}
} This works fine for me:
My problem turns out to be _args_cache_${name} stashing away the long
options, which is problematic for things like "configure" that may be
rebuilt with different/new options in the middle of a shell session.
If I "unset -m _args_cache_\*" and then try again, it works.
} Also, slightly related:
} The _configure completion could benefit from my patch I sent back in march:
} http://www.zsh.org/mla/workers//2016/msg00674.html
In that message, you wrote:
>> After parsing the --help output, zsh internally stores that option as
>> --foo:some option (useful with --bar=baz)
>>
>> Later it filters the options using the following:
>> tmp=("${(@M)lopts:##$~pattern(|:*)}")
>>
>> The (|:*) part is supposed to be limiting the matching to the part
>> before the ':'. This does however not work at all.
>> It will simply use the empty variant and match anyways.
Your patch recommends changing (|:*) to just :* and always append an
extra ":" so that the empty variant is not needed.
I'll point out for the record that zsh tries alternative patterns in
left-to-right order and always uses the first one that succeeds, so it
might also work to change the pattern to (:*|) [and hope your email
reader doesn't interpret that as some sort of emoticon].
However, in workers/39135, Daniel points out that the pattern on lines
266/268 needs fixing, and your change with the appended colon might in
fact accomplish the necessary tweak. So I'm going to apply/commit
workers/38153 and Vincent can tell us whether it helps him at all.
--
Barton E. Schaefer
next prev parent reply other threads:[~2016-09-07 6:30 UTC|newest]
Thread overview: 10+ messages / expand[flat|nested] mbox.gz Atom feed top
2016-08-30 23:23 buggy configure completion Vincent Lefevre
2016-08-31 3:00 ` buggy configure completion - when both --enable-foo and --disable-foo are listed Daniel Shahaf
2016-08-31 6:15 ` Vincent Lefevre
2016-08-31 9:09 ` Daniel Shahaf
2016-08-31 20:27 ` m0viefreak
2016-09-02 1:27 ` Bart Schaefer
2016-09-02 21:02 ` m0viefreak
2016-09-07 5:39 ` Bart Schaefer [this message]
2016-08-31 3:03 ` Daniel Shahaf
2016-08-31 6:45 ` Vincent Lefevre
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=160906223901.ZM11245@torch.brasslantern.com \
--to=schaefer@brasslantern.com \
--cc=zsh-workers@zsh.org \
/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).