* zsh AUTO_CD proposal
@ 2005-03-16 21:54 Dave Yost
2005-03-16 22:52 ` Wayne Davison
2005-03-17 0:38 ` Bart Schaefer
0 siblings, 2 replies; 3+ messages in thread
From: Dave Yost @ 2005-03-16 21:54 UTC (permalink / raw)
To: zsh-workers
[-- Attachment #1: Type: text/plain, Size: 557 bytes --]
The definition of
setopt AUTO_CD
should be changed from
If a command is issued that can't be executed as a normal command,
and the command is the name of a directory, perform the cd command to
that directory.
to
If a command is issued that can't be executed as a normal command,
and the command is the name of a directory, then instead execute
dirCommand dir
and zsh should provide a new builtin function
function dirCommand {
cd "$1"
}
Personally, I would redefine this function to call a function that
does a pushd.
Thanks
Dave
[-- Attachment #2: Type: text/html, Size: 1220 bytes --]
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: zsh AUTO_CD proposal
2005-03-16 21:54 zsh AUTO_CD proposal Dave Yost
@ 2005-03-16 22:52 ` Wayne Davison
2005-03-17 0:38 ` Bart Schaefer
1 sibling, 0 replies; 3+ messages in thread
From: Wayne Davison @ 2005-03-16 22:52 UTC (permalink / raw)
To: Dave Yost; +Cc: zsh-workers
On Wed, Mar 16, 2005 at 01:54:43PM -0800, Dave Yost wrote:
> Personally, I would redefine this function to call a function that
> does a pushd.
An alternative is to "setopt auto_pushd", which turns every "cd" command
into a "pushd". Then, if you didn't want a typed "cd" command to do a
pushdir, do this:
function mycd {
setopt local_options noautopushd
builtin cd ${@}
}
alias cd=mycd
(That alias doesn't affect the auto_cd functionality.)
..wayne..
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: zsh AUTO_CD proposal
2005-03-16 21:54 zsh AUTO_CD proposal Dave Yost
2005-03-16 22:52 ` Wayne Davison
@ 2005-03-17 0:38 ` Bart Schaefer
1 sibling, 0 replies; 3+ messages in thread
From: Bart Schaefer @ 2005-03-17 0:38 UTC (permalink / raw)
To: zsh-workers
On Mar 16, 1:54pm, Dave Yost wrote:
}
} The definition of
} setopt AUTO_CD
} should be changed
No, it shouldn't.
We could add a user-level command-not-found handler, perhaps, but not
change AUTO_CD.
} If a command is issued that can't be executed as a normal command,
} and the command is the name of a directory, then instead execute
} dirCommand dir
Let's try to avoid camelCapsNames in zsh, please. All other such
names have hyphens or underscores between words.
} Personally, I would redefine this function to call a function that
} does a pushd.
Not sufficient simply to do this?
setopt AUTO_PUSHD
cd chdir () {
setopt localoptions NO_AUTO_PUSHD
builtin cd "$@"
}
This accomplishes what you describe, in all versions of zsh that support
local options. Or maybe you just want AUTO_PUSHD set all the time and
don't care about redefining "cd" to avoid it?
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2005-03-17 0:38 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2005-03-16 21:54 zsh AUTO_CD proposal Dave Yost
2005-03-16 22:52 ` Wayne Davison
2005-03-17 0:38 ` Bart Schaefer
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).