* Adding nocorrect to a preexec function
@ 2006-01-17 23:11 Eric Smith
2006-01-18 2:24 ` Bart Schaefer
0 siblings, 1 reply; 2+ messages in thread
From: Eric Smith @ 2006-01-17 23:11 UTC (permalink / raw)
To: zsh-users
I use the following function (which is probably more complex that
required) and wish to add nocorrect to it. How would I do that
as in all the obvious (to me) places it does not seem to work.
function preexec {
local cmd
local application
cmd=(${(Q)${(z)3}})
eval "function ${(q)cmd[1]} {
unsetopt noglob
cost ${(q)cmd[1]}" '$*
unfunction' "${(q)cmd[1]}
}"
setopt noglob
}
Thanks
--
Eric Smith
^ permalink raw reply [flat|nested] 2+ messages in thread
* Re: Adding nocorrect to a preexec function
2006-01-17 23:11 Adding nocorrect to a preexec function Eric Smith
@ 2006-01-18 2:24 ` Bart Schaefer
0 siblings, 0 replies; 2+ messages in thread
From: Bart Schaefer @ 2006-01-18 2:24 UTC (permalink / raw)
To: zsh-users
On Jan 18, 12:11am, Eric Smith wrote:
}
} I use the following function (which is probably more complex that
} required)
Having stared at this for a few minutes without figuring out what the
heck it's supposed to do, I can't say whether it's more complex than
required or not. Have you noticed what happens when you type a command
with any of the separators ; & | && || in it? Not to mention things
like loop constructs.
What is "cost"?
} and wish to add nocorrect to it.
I understand all those words, but they convey to me nothing about the
desired final result ...
However, at a guess, your problem is that correction takes place before
preexec is ever called, so nothing you can do inside it will help.
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2006-01-18 2:24 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2006-01-17 23:11 Adding nocorrect to a preexec function Eric Smith
2006-01-18 2:24 ` 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).