zsh-users
 help / color / mirror / code / Atom feed
* named directory bug
@ 2001-10-31 14:30 Vincent Lefevre
  2001-10-31 15:31 ` Bart Schaefer
  0 siblings, 1 reply; 7+ messages in thread
From: Vincent Lefevre @ 2001-10-31 14:30 UTC (permalink / raw)
  To: zsh-users

The bug concerning named directories is still there. For instance:

$ hash -d out=...
$ kill %[TAB]
$ echo ~out
zsh: no such user or named directory: out

because out is used in _pids. Will this bug be fixed? Otherwise, why
don't functions use reserved variable names, e.g. starting with "_"?

-- 
Vincent Lefèvre <vincent@vinc17.org> - Web: <http://www.vinc17.org/> - 100%
validated HTML - Acorn Risc PC, Yellow Pig 17, Championnat International des
Jeux Mathématiques et Logiques, TETRHEX, etc.
Work: CR INRIA - computer arithmetic / SPACES project at LORIA


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

* Re: named directory bug
  2001-10-31 14:30 named directory bug Vincent Lefevre
@ 2001-10-31 15:31 ` Bart Schaefer
  2001-10-31 19:21   ` Vincent Lefevre
  0 siblings, 1 reply; 7+ messages in thread
From: Bart Schaefer @ 2001-10-31 15:31 UTC (permalink / raw)
  To: Vincent Lefevre, zsh-users

On Oct 31,  3:30pm, Vincent Lefevre wrote:
}
} Will this bug be fixed?

Here's a possible fix.  At the least it's a workaround that you can apply in
the meantime.

Index: Completion/Base/Core/_main_complete
===================================================================
--- Completion/Base/Core/_main_complete	2001/09/05 15:22:28	1.4
+++ Completion/Base/Core/_main_complete	2001/10/31 15:29:50
@@ -17,6 +17,7 @@
 # state than the global one for which you are completing.
 
 eval "$_comp_setup"
+zmodload -i zsh/parameter && local +h nameddirs
 
 local func funcs ret=1 tmp _compskip format nm call match min max i num\
       _completers _completer _completer_num curtag _comp_force_list \


-- 
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] 7+ messages in thread

* Re: named directory bug
  2001-10-31 15:31 ` Bart Schaefer
@ 2001-10-31 19:21   ` Vincent Lefevre
  2001-11-01 15:14     ` Bart Schaefer
  0 siblings, 1 reply; 7+ messages in thread
From: Vincent Lefevre @ 2001-10-31 19:21 UTC (permalink / raw)
  To: zsh-users

On Wed, Oct 31, 2001 at 15:31:24 +0000, Bart Schaefer wrote:
> Here's a possible fix.  At the least it's a workaround that you can apply in
> the meantime.

It fixes the problem, but completion with named directories no longer
works.

-- 
Vincent Lefèvre <vincent@vinc17.org> - Web: <http://www.vinc17.org/> - 100%
validated HTML - Acorn Risc PC, Yellow Pig 17, Championnat International des
Jeux Mathématiques et Logiques, TETRHEX, etc.
Work: CR INRIA - computer arithmetic / SPACES project at LORIA


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

* Re: named directory bug
  2001-10-31 19:21   ` Vincent Lefevre
@ 2001-11-01 15:14     ` Bart Schaefer
  2001-11-01 16:39       ` Vincent Lefevre
  0 siblings, 1 reply; 7+ messages in thread
From: Bart Schaefer @ 2001-11-01 15:14 UTC (permalink / raw)
  To: Vincent Lefevre, zsh-users

On Oct 31,  8:21pm, Vincent Lefevre wrote:
} Subject: Re: named directory bug
}
} On Wed, Oct 31, 2001 at 15:31:24 +0000, Bart Schaefer wrote:
} > Here's a possible fix.  At the least it's a workaround that you can apply in
} > the meantime.
} 
} It fixes the problem, but completion with named directories no longer
} works.

Ah.  Well, then, there's always this:

    zmodload -i zsh/parameter &&
	eval "local +h nameddirs; nameddirs=(${(@kvq)nameddirs})"

That's simulating in shell code what we'd have to write in C in order to
make saving and restoring of the nameddir table possible.

I've thought using parameters for named directories was a bad idea for a
very long time, ever since my csh-junkie hack of `chpwd () { cwd=$PWD }'
started causing `~cwd' to show up in my prompt.  (Guess when autonamedirs
became an option rather than the default behavior.)  At the very least I
think there should be a parameter flag for "this parameter is a nameddir"
checked by unsetparam_pm() and strsetfn() before calling adduserdir().

-- 
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] 7+ messages in thread

* Re: named directory bug
  2001-11-01 15:14     ` Bart Schaefer
@ 2001-11-01 16:39       ` Vincent Lefevre
  2001-11-01 17:43         ` Bart Schaefer
  0 siblings, 1 reply; 7+ messages in thread
From: Vincent Lefevre @ 2001-11-01 16:39 UTC (permalink / raw)
  To: zsh-users

On Thu, Nov 01, 2001 at 15:14:39 +0000, Bart Schaefer wrote:
> Ah.  Well, then, there's always this:
> 
>     zmodload -i zsh/parameter &&
> 	eval "local +h nameddirs; nameddirs=(${(@kvq)nameddirs})"

This doesn't work here:

$ ll ~out/[TAB]
_main_complete:21: bad set of key/value pairs for associative array

-- 
Vincent Lefèvre <vincent@vinc17.org> - Web: <http://www.vinc17.org/> - 100%
validated HTML - Acorn Risc PC, Yellow Pig 17, Championnat International des
Jeux Mathématiques et Logiques, TETRHEX, etc.
Work: CR INRIA - computer arithmetic / SPACES project at LORIA


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

* Re: named directory bug
  2001-11-01 16:39       ` Vincent Lefevre
@ 2001-11-01 17:43         ` Bart Schaefer
  2001-11-01 18:35           ` Vincent Lefevre
  0 siblings, 1 reply; 7+ messages in thread
From: Bart Schaefer @ 2001-11-01 17:43 UTC (permalink / raw)
  To: Vincent Lefevre, zsh-users

On Nov 1,  5:39pm, Vincent Lefevre wrote:
}
} $ ll ~out/[TAB]
} _main_complete:21: bad set of key/value pairs for associative array

That's odd.  What do you see if you run this function?

    tryit() {
	hash -d
	setopt localoptions xtrace
	eval "local +h nameddirs; nameddirs=(${(@kvq)nameddirs})"
    }

-- 
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] 7+ messages in thread

* Re: named directory bug
  2001-11-01 17:43         ` Bart Schaefer
@ 2001-11-01 18:35           ` Vincent Lefevre
  0 siblings, 0 replies; 7+ messages in thread
From: Vincent Lefevre @ 2001-11-01 18:35 UTC (permalink / raw)
  To: zsh-users

On Thu, Nov 01, 2001 at 17:43:07 +0000, Bart Schaefer wrote:
> That's odd.  What do you see if you run this function?
> 
>     tryit() {
> 	hash -d
> 	setopt localoptions xtrace
> 	eval "local +h nameddirs; nameddirs=(${(@kvq)nameddirs})"
>     }

greux:~> tryit                                                        <19:33:49
archive=/users/spaces/lefevre/private/archive
gmp=/users/spaces/logiciels/gmp/linux
hd=/global/greux/lefevre
in=/users/spaces/lefevre/private/in
latex=/usr/local/tex/texmf/tex/latex
mailarc=/users/spaces/lefevre/Mail/arc
oldmail=/global/greux/lefevre/private/oldmail
out=/users/spaces/lefevre/private/out
soft=/users/spaces/logiciels
tex=/usr/local/tex
tmparch=/global/greux/lefevre/private/tmparch
+tryit:3> eval local +h nameddirs; nameddirs=(out) local +h nameddirs; nameddirs=(/users/spaces/lefevre/private/out) local +h nameddirs; nameddirs=(tmparch) local +h nameddirs; nameddirs=(/global/greux/lefevre/private/tmparch) local +h nameddirs; nameddirs=(gmp) local +h nameddirs; nameddirs=(/users/spaces/logiciels/gmp/linux) local +h nameddirs; nameddirs=(hd) local +h nameddirs; nameddirs=(/global/greux/lefevre) local +h nameddirs; nameddirs=(oldmail) local +h nameddirs; nameddirs=(/global/greux/lefevre/private/oldmail) local +h nameddirs; nameddirs=(tex) local +h nameddirs; nameddirs=(/usr/local/tex) local +h nameddirs; nameddirs=(latex) local +h nameddirs; nameddirs=(/usr/local/tex/texmf/tex/latex) local +h nameddirs; nameddirs=(soft) local +h nameddirs; nameddirs=(/users/spaces/logiciels) local +h nameddirs; nameddirs=(mailarc) local +h nameddirs; nameddirs=(/users/spaces/lefevre/Mail/arc) local +h nameddirs; nameddirs=(archive) local +h nameddirs; nameddirs=(/users/spaces/lefevre/private/archive) local +h nameddirs; nameddirs=(in) local +h nameddirs; nameddirs=(/users/spaces/lefevre/private/in)
+tryit:3> local +h nameddirs
tryit:3: bad set of key/value pairs for associative array
+tryit:3> nameddirs=( out ) zsh: exit 1

-- 
Vincent Lefèvre <vincent@vinc17.org> - Web: <http://www.vinc17.org/> - 100%
validated HTML - Acorn Risc PC, Yellow Pig 17, Championnat International des
Jeux Mathématiques et Logiques, TETRHEX, etc.
Work: CR INRIA - computer arithmetic / SPACES project at LORIA


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

end of thread, other threads:[~2001-11-01 18:36 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2001-10-31 14:30 named directory bug Vincent Lefevre
2001-10-31 15:31 ` Bart Schaefer
2001-10-31 19:21   ` Vincent Lefevre
2001-11-01 15:14     ` Bart Schaefer
2001-11-01 16:39       ` Vincent Lefevre
2001-11-01 17:43         ` Bart Schaefer
2001-11-01 18:35           ` Vincent Lefevre

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