zsh-users
 help / color / mirror / code / Atom feed
* Tab completion and '{'
@ 2005-03-12 10:00 Haakon Riiser
  2005-03-12 20:04 ` Bart Schaefer
  0 siblings, 1 reply; 5+ messages in thread
From: Haakon Riiser @ 2005-03-12 10:00 UTC (permalink / raw)
  To: zsh-users

Is it possible to make the completion system treat '{' as a normal
character?  What I want is this:

  % touch {foo}
  % ls -l {
  <pressing TAB yields the following result>
  % ls -l \{foo\}

If it is easier to do it without escaping the {}s, that's okay too,
since these files never have commas in them, and thus the {}s need
not be escaped.

Thanks in advance for any help.

-- 
 Haakon


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

* Re: Tab completion and '{'
  2005-03-12 10:00 Tab completion and '{' Haakon Riiser
@ 2005-03-12 20:04 ` Bart Schaefer
  2005-03-12 23:37   ` Haakon Riiser
  0 siblings, 1 reply; 5+ messages in thread
From: Bart Schaefer @ 2005-03-12 20:04 UTC (permalink / raw)
  To: zsh-users

On Mar 12, 11:00am, Haakon Riiser wrote:
} Subject: Tab completion and '{'
}
} Is it possible to make the completion system treat '{' as a normal
} character?

The short answer is, no.

The long answer is that this seems to be a real bug in completion:

The expansion of brace expressions is handled in the builtin commands
that support compsys, e.g. "comptry".  And within "comptry", there is
no test of the IGNORE_BRACES setopt that I can see, so effectively the
brace handling behavior is hardwired in at a low level and cannot be
turned off.

It might be possible to rewrite _files to work around this, but I'm not
feeling like attempting it just now ... Oliver, perhaps?  The idea would
be to check for a possible literal match of the brace(s) and then insert
backslashes if necessary, before calling the builtins to parse the string.


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

* Re: Tab completion and '{'
  2005-03-12 20:04 ` Bart Schaefer
@ 2005-03-12 23:37   ` Haakon Riiser
  2005-03-13  7:53     ` Bart Schaefer
  0 siblings, 1 reply; 5+ messages in thread
From: Haakon Riiser @ 2005-03-12 23:37 UTC (permalink / raw)
  To: zsh-users

[Bart Schaefer]

> The expansion of brace expressions is handled in the builtin
> commands that support compsys, e.g. "comptry".  And within
> "comptry", there is no test of the IGNORE_BRACES setopt that I
> can see, so effectively the brace handling behavior is hardwired
> in at a low level and cannot be turned off.

I appreciate you telling me about this, even if it doesn't work
in current versions of zsh.  Thinking that such a specific feature
would, at best, be configurable with zstyle and not deemed worthy
of its own option, I didn't even bother with zshoptions(1).

But since the option actually /does/ exist, and is now known to be
broken, one might hope for a bugfix in the near future, right? :-)

-- 
 Haakon


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

* Re: Tab completion and '{'
  2005-03-12 23:37   ` Haakon Riiser
@ 2005-03-13  7:53     ` Bart Schaefer
  0 siblings, 0 replies; 5+ messages in thread
From: Bart Schaefer @ 2005-03-13  7:53 UTC (permalink / raw)
  To: zsh-users

On Mar 13, 12:37am, Haakon Riiser wrote:
}
} But since the option actually /does/ exist, and is now known to be
} broken, one might hope for a bugfix in the near future, right? :-)

The option itself isn't broken; what's broken is the completion code
that fails to make use of it.

That code was written by Sven W., who has left university, gotten a
job, and does not follow the zsh lists with any regularity any more.
So you might hope, but it may not be all that near a future before
anyone else understands this well enough to repair it.

Besides that, there are several of the completion shell functions that
fail when that option is set, so those also need to be fixed before it
would do any good to fix comptry.

So ... don't stop hoping, but get used to typing "ls \{" before you
hit TAB.


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

* Tab completion and '{'
@ 2005-03-11 15:51 Haakon Riiser
  0 siblings, 0 replies; 5+ messages in thread
From: Haakon Riiser @ 2005-03-11 15:51 UTC (permalink / raw)
  To: zsh-users

Is it possible to make general file completion treat '{' as a normal
character?  What I want is this:

  % touch {foo}
  % ls -l {
  <presses tab and gets the below result>
  % ls -l \{foo\}

If it is easier to do it without escaping the {}s, that's okay too,
since these files never have commas in them, and thus the {}s need
not be escape.

Thanks in advance for any help.

-- 
 Haakon


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

end of thread, other threads:[~2005-03-13  7:54 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2005-03-12 10:00 Tab completion and '{' Haakon Riiser
2005-03-12 20:04 ` Bart Schaefer
2005-03-12 23:37   ` Haakon Riiser
2005-03-13  7:53     ` Bart Schaefer
  -- strict thread matches above, loose matches on Subject: below --
2005-03-11 15:51 Haakon Riiser

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