zsh-workers
 help / color / mirror / code / Atom feed
* Re: Getting "parse error" from _path_files
@ 2000-06-05 14:33 Sven Wischnowsky
  2000-06-05 15:13 ` insert-tab (Re: Getting "parse error" from _path_files) Bart Schaefer
  0 siblings, 1 reply; 3+ messages in thread
From: Sven Wischnowsky @ 2000-06-05 14:33 UTC (permalink / raw)
  To: zsh-workers


Bart Schaefer wrote:

> On Jun 5, 10:04am, Sven Wischnowsky wrote:
> } Subject: Re: Getting "parse error" from _path_files
> }
> } Bart Schaefer wrote:
> } 
> } >     (( PENDING )) && compstate[insert]=tab
> } > 
> } > near the top of _main_complete, right after curcontext is set up, and that
> } > seems to help a bit, but I'm rather leery of that solution.  It does need
> } > to use PENDING somehow, though.
> } 
> } It should then immediately return, too (to really avoid calling all
> } that completion code).
> 
> Actually, it does return immediately, because of:
> 
> if [[ "$compstate[insert]" = tab* && "$WIDGET" != *list* ]]; then
>   { zstyle -T ":completion:${curcontext}:" insert-tab &&
>     { [[ "$curcontext" != :* || -z "$compstate[vared]" ]] ||
> 	zstyle -t ":completion:vared${curcontext}:" insert-tab } } && return 0
> 
> Which reminds me to wonder why insert-tab is tested for *not* being set,
> at that point?

Err...? It is tested for being set (to true), with different defaults for
not-in-vared and in-vared.

> } > Returning to the original issue:  Perhaps it would be possible to special-
> } > case parsing within ${(e)...} so that errors of this sort simply return an
> } > empty value for the parameter rather than aborting the whole call chain?
> }
> } How about a parameter flag, the opposite of `X', but used for `e' to
> } make it ignore parse errors and return an empty string in such cases?
> } 
> } Or make `e' not report errors normally and use `X' for `e', too, to
> } make it report errors?
> 
> I'd forgotten about (X); yes, I think the latter (have (e) ignore errors
> unless (X) is given) is the right solution.
> 
> It doesn't even have to ignore the errors silently; redirecting 2> is fine.
> It just has to not abort the surrounding parse.

No time now... maybe I'll be able to do that this evening (I'll then
make it behave like (Q), etc).

Bye
 Sven


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


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

* insert-tab (Re: Getting "parse error" from _path_files)
  2000-06-05 14:33 Getting "parse error" from _path_files Sven Wischnowsky
@ 2000-06-05 15:13 ` Bart Schaefer
  0 siblings, 0 replies; 3+ messages in thread
From: Bart Schaefer @ 2000-06-05 15:13 UTC (permalink / raw)
  To: zsh-workers

On Jun 5,  4:33pm, Sven Wischnowsky wrote:
} Subject: Re: Getting "parse error" from _path_files
}
} Bart Schaefer wrote:
} 
} > if [[ "$compstate[insert]" = tab* && "$WIDGET" != *list* ]]; then
} >   { zstyle -T ":completion:${curcontext}:" insert-tab &&
} >     { [[ "$curcontext" != :* || -z "$compstate[vared]" ]] ||
} > 	zstyle -t ":completion:vared${curcontext}:" insert-tab } } && return 0
} > 
} > Which reminds me to wonder why insert-tab is tested for *not* being set,
} > at that point?
} 
} Err...? It is tested for being set (to true), with different defaults for
} not-in-vared and in-vared.

zagzig[38] zstyle ':completion:*' insert-tab true
zagzig[39] ls x<TAB>
Completing `file'

According to the doc for insert-tab, I should have gotten a tab inserted,
because there is a non-blank character to the left of the cursor.

-- 
Bart Schaefer                                 Brass Lantern Enterprises
http://www.well.com/user/barts              http://www.brasslantern.com

Zsh: http://www.zsh.org | PHPerl Project: http://phperl.sourceforge.net   


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

* Re: insert-tab (Re: Getting "parse error" from _path_files)
@ 2000-06-06  8:37 Sven Wischnowsky
  0 siblings, 0 replies; 3+ messages in thread
From: Sven Wischnowsky @ 2000-06-06  8:37 UTC (permalink / raw)
  To: zsh-workers


Bart Schaefer wrote:

> On Jun 5,  4:33pm, Sven Wischnowsky wrote:
> } Subject: Re: Getting "parse error" from _path_files
> }
> } Bart Schaefer wrote:
> } 
> } > if [[ "$compstate[insert]" = tab* && "$WIDGET" != *list* ]]; then
> } >   { zstyle -T ":completion:${curcontext}:" insert-tab &&
> } >     { [[ "$curcontext" != :* || -z "$compstate[vared]" ]] ||
> } > 	zstyle -t ":completion:vared${curcontext}:" insert-tab } } && return 0
> } > 
> } > Which reminds me to wonder why insert-tab is tested for *not* being set,
> } > at that point?
> } 
> } Err...? It is tested for being set (to true), with different defaults for
> } not-in-vared and in-vared.
> 
> zagzig[38] zstyle ':completion:*' insert-tab true
> zagzig[39] ls x<TAB>
> Completing `file'
> 
> According to the doc for insert-tab, I should have gotten a tab inserted,
> because there is a non-blank character to the left of the cursor.

No, you get the tab when there is *no* non-blank character to the left:

item(tt(insert-tab))(
If this has one of the `true' values, the completion system will
insert a TAB character (assuming it was used to start completion) instead
of performing completion when there is no non-blank character to the left
of the cursor.  If set to `false', completion will be done even there.

The default value of this style is `true' unless when completing
inside the tt(vared) builtin command, where it defaults to `false'.
)


Bye
 Sven


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


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

end of thread, other threads:[~2000-06-06  8:38 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2000-06-05 14:33 Getting "parse error" from _path_files Sven Wischnowsky
2000-06-05 15:13 ` insert-tab (Re: Getting "parse error" from _path_files) Bart Schaefer
2000-06-06  8:37 Sven Wischnowsky

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