On Nov 14, 4:31pm, Daniel Serodio (lists) wrote:
}
} It it possible to have zsh automatically run "rehash" after I reply no
} to an auto-correct prompt, so it "learns" this new command?
Hrm. The direct answer is "no" but:
That would certainly seem logical. Also it seems strange to load up
the command tables and check them for proper spellings when the word
that is being checked is not in the command position to begin with.
Index: Src/utils.c
--- ../zsh-forge/current/Src/utils.c 2011-09-25 15:52:55.000000000 -0700
+++ Src/utils.c 2011-11-14 19:58:34.000000000 -0800
@@ -2498,16 +2498,18 @@
return;
if (!(*s)[0] || !(*s)[1])
return;
- if (shfunctab->getnode(shfunctab, *s) ||
- builtintab->getnode(builtintab, *s) ||
- cmdnamtab->getnode(cmdnamtab, *s) ||
- aliastab->getnode(aliastab, *s) ||
- reswdtab->getnode(reswdtab, *s))
- return;
- else if (isset(HASHLISTALL)) {
- cmdnamtab->filltable(cmdnamtab);
- if (cmdnamtab->getnode(cmdnamtab, *s))
+ if (cmd) {
+ if (shfunctab->getnode(shfunctab, *s) ||
+ builtintab->getnode(builtintab, *s) ||
+ cmdnamtab->getnode(cmdnamtab, *s) ||
+ aliastab->getnode(aliastab, *s) ||
+ reswdtab->getnode(reswdtab, *s))
return;
+ else if (isset(HASHLISTALL)) {
+ cmdnamtab->filltable(cmdnamtab);
+ if (cmdnamtab->getnode(cmdnamtab, *s))
+ return;
+ }
}
t = *s;
if (*t == Tilde || *t == Equals || *t == String)
@@ -2621,6 +2623,8 @@
fflush(shout);
zbeep();
x = getquery("nyae \t", 0);
+ if (cmd&& x == 'n')
+ pathchecked = path;
} else
x = 'n';
} else