zsh-workers
 help / color / mirror / code / Atom feed
* Minor bugs in _unsetopt and _main_complete ?
@ 2004-12-10  2:25 香川 亘
  2005-01-08 18:16 ` Wayne Davison
  0 siblings, 1 reply; 3+ messages in thread
From: 香川 亘 @ 2004-12-10  2:25 UTC (permalink / raw)
  To: zsh-workers

While trying to configure the setopt and unsetopt commands to complete 
only unset and set options, respectively, I think I found some bugs in 
the _unsetopt and _main_complete functions.

In _unsetopt, "_options_set || _options" should be,

_options_unset || _options

and in _main_complete,

_options_set=(${(k)options[(R)on]})
_options_unset=(${(k)options[(R)off]})

should be,

_options_set=(${(k)options[(R)off]})
_options_unset=(${(k)options[(R)on]})

I am wondering if the CVS versions should include this fix.


Wataru Kagawa, Ph. D.
Postdoctoral Researcher
Protein Research Group
RIKEN (Physical and Chemical Research Institute)

W221, West Research Bldg.
1-7-22 Suehiro-cho, Tsurumi-ku
Yokohama, Japan 230-0045

tel.	045-503-9206
fax.	045-503-9201


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

* Re: Minor bugs in _unsetopt and _main_complete ?
  2004-12-10  2:25 Minor bugs in _unsetopt and _main_complete ? 香川 亘
@ 2005-01-08 18:16 ` Wayne Davison
  2005-01-11  5:38   ` Wataru Kagawa
  0 siblings, 1 reply; 3+ messages in thread
From: Wayne Davison @ 2005-01-08 18:16 UTC (permalink / raw)
  To: ?$B9a@n ?$BOK; +Cc: zsh-workers

[I had thought that someone else would respond to this message, but
since no one did, let me give you a late reply.]

On Fri, Dec 10, 2004 at 11:25:53AM +0900, ?$B9a@n ?$BOK wrote:
> In _unsetopt, "_options_set || _options" should be,
> 
> _options_unset || _options
> 
> and in _main_complete,
> 
> _options_set=(${(k)options[(R)on]})
> _options_unset=(${(k)options[(R)off]})
> 
> should be,
> 
> _options_set=(${(k)options[(R)off]})
> _options_unset=(${(k)options[(R)on]})

You seem to be thinking about the variables in the opposite manner in
which they were intended.  The _options_set variable contains set
options (not options that can be set), so it is used to complete
unsettable options in _unsetopt.  I think this interpretation of the
options is evident in this comment in _main_complete:

    # If you want to complete only set or unset options for the unsetopt
    # and setopt builtin, un-comment these lines:

This is followed by _options_set (the set options) and _options_unset
(the unset options).  Certainly, your choice to reverse the meaning in
both the setting and use of these variables will work fine for your
configuration, but I think the CVS version should remain unchanged.

..wayne..


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

* Re: Minor bugs in _unsetopt and _main_complete ?
  2005-01-08 18:16 ` Wayne Davison
@ 2005-01-11  5:38   ` Wataru Kagawa
  0 siblings, 0 replies; 3+ messages in thread
From: Wataru Kagawa @ 2005-01-11  5:38 UTC (permalink / raw)
  To: Wayne Davison; +Cc: zsh-workers

Thanks for the reply.  I was incorrect.  I was actually trying to use 
_options_set and _options_unsetopt the way they were intended, but got 
confused after playing with the original functions.

Please excuse my ignorance.


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

end of thread, other threads:[~2005-01-11  5:40 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2004-12-10  2:25 Minor bugs in _unsetopt and _main_complete ? 香川 亘
2005-01-08 18:16 ` Wayne Davison
2005-01-11  5:38   ` Wataru Kagawa

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