zsh-workers
 help / color / mirror / code / Atom feed
* Re: Space-expansion problem in dev-8
@ 2001-02-02  8:21 Sven Wischnowsky
  0 siblings, 0 replies; 3+ messages in thread
From: Sven Wischnowsky @ 2001-02-02  8:21 UTC (permalink / raw)
  To: zsh-workers


Peter Stephenson wrote:

> > If a filename contains spaces (or other escapable characters) and you
> > expand it via wild-carding, the spaces are not escaped.
> 
> The fix is probably something like the following, but Sven may have better
> ideas.  This is leaving my cursor at the end of the word for some reason.
> Probably _expand was written before ${(q)...} existed.

Hm, maybe. I don't remember why we used that instead of (q), I have
only a very faint memory of problems with (q) when that quoted more
than we wanted but unfortunately I don't remember what that was (and
not even in _expand, but in some other completion function, I think).

So for now I've just committed Peter's patch and left the old stuff
commented out.

Bye
 Sven


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


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

* Re: Space-expansion problem in dev-8
  2001-02-01 17:41 Wayne Davison
@ 2001-02-01 17:57 ` Peter Stephenson
  0 siblings, 0 replies; 3+ messages in thread
From: Peter Stephenson @ 2001-02-01 17:57 UTC (permalink / raw)
  To: Zsh hackers list

> If a filename contains spaces (or other escapable characters) and you
> expand it via wild-carding, the spaces are not escaped.

The fix is probably something like the following, but Sven may have better
ideas.  This is leaving my cursor at the end of the word for some reason.
Probably _expand was written before ${(q)...} existed.

Index: Completion/Core/_expand
===================================================================
RCS file: /cvsroot/zsh/zsh/Completion/Core/_expand,v
retrieving revision 1.33
diff -u -r1.33 _expand
--- Completion/Core/_expand	2000/10/11 12:19:24	1.33
+++ Completion/Core/_expand	2001/02/01 17:46:47
@@ -68,7 +68,7 @@
 # Now try globbing.
 
 [[ "$force" = *g* ]] || zstyle -T ":completion:${curcontext}:" glob &&
-    eval 'exp=( ${~exp} ); exp=( ${exp//(#b)([][()|*?^#~<>\\=])/\\${match[1]}} )' 2>/dev/null
+    eval 'exp=( ${~exp} ); exp=( ${(q)exp} )' 2>/dev/null
 
 # If we don't have any expansions or only one and that is the same
 # as the original string, we let other completers run.

-- 
Peter Stephenson <pws@csr.com>                  Software Engineer
Cambridge Silicon Radio, Unit 300, Science Park, Milton Road,
Cambridge, CB4 0XL, UK                          Tel: +44 (0)1223 392070


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

* Space-expansion problem in dev-8
@ 2001-02-01 17:41 Wayne Davison
  2001-02-01 17:57 ` Peter Stephenson
  0 siblings, 1 reply; 3+ messages in thread
From: Wayne Davison @ 2001-02-01 17:41 UTC (permalink / raw)
  To: Zsh Workers

I just upgraded from dev-7 to dev-8 to try to fix the following problem,
but it is still there.

If a filename contains spaces (or other escapable characters) and you
expand it via wild-carding, the spaces are not escaped.

For instance:

% zsh -f
% touch 'a b c d e'
% autoload -U compinit
% compinit
% zstyle ':completion:*' completer _expand _complete
% bindkey '\t' complete-word
% ls a*<TAB>

One of the offered suggestions is "a b c d e" rather than "a\ b\ c\ d\ e".
If I complete it without the '*' or expand it without changing tab's key
binding, it works properly.

..wayne..


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

end of thread, other threads:[~2001-02-02  8:21 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2001-02-02  8:21 Space-expansion problem in dev-8 Sven Wischnowsky
  -- strict thread matches above, loose matches on Subject: below --
2001-02-01 17:41 Wayne Davison
2001-02-01 17:57 ` Peter Stephenson

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