mirror of
https://github.com/zsh-users/zsh
synced 2024-09-06 08:25:56 +00:00
add `aliases' option to be able to disable alias expansion (13554)
This commit is contained in:
parent
5621ce6faf
commit
061c1ce912
|
@ -1,3 +1,10 @@
|
|||
2001-02-28 Sven Wischnowsky <wischnow@zsh.org>
|
||||
|
||||
* 13554: Completion/Core/compinit, Doc/Zsh/options.yo, Src/lex.c,
|
||||
Src/options.c, Src/zsh.h, Src/Zle/compcore.c, Src/Zle/compctl.c,
|
||||
Src/Zle/zle_tricky.c: add `aliases' option to be able to disable
|
||||
alias expansion
|
||||
|
||||
2001-02-26 Sven Wischnowsky <wischnow@zsh.org>
|
||||
|
||||
* 13536: Completion/Base/_sub_commands, Completion/Core/_normal,
|
||||
|
|
|
@ -137,6 +137,7 @@ _comp_options=(
|
|||
NO_ksharrays
|
||||
NO_cshnullglob
|
||||
NO_allexport
|
||||
NO_aliases
|
||||
)
|
||||
|
||||
# These can hold names of functions that are to be called before/after all
|
||||
|
|
|
@ -53,6 +53,11 @@ tt(KSH_OPTION_PRINT) is set), `tt(setopt)' shows all options whose settings
|
|||
are changed from the default.
|
||||
|
||||
startitem()
|
||||
pindex(ALIASES)
|
||||
cindex(aliases, expansion)
|
||||
item(tt(ALIASES) <D>)(
|
||||
Expand aliases.
|
||||
)
|
||||
pindex(ALL_EXPORT)
|
||||
cindex(export, automatic)
|
||||
item(tt(ALL_EXPORT) (tt(-a), ksh: tt(-a)))(
|
||||
|
|
|
@ -1237,7 +1237,7 @@ set_comp_sep(void)
|
|||
LinkNode n;
|
||||
int owe = we, owb = wb, ocs = cs, swb, swe, scs, soffs, ne = noerrs;
|
||||
int tl, got = 0, i = 0, cur = -1, oll = ll, sl, remq;
|
||||
int ois = instring, oib = inbackt, noffs = lp;
|
||||
int ois = instring, oib = inbackt, noffs = lp, ona = noaliases;
|
||||
char *tmp, *p, *ns, *ol = (char *) line, sav, *qp, *qs, *ts, qc = '\0';
|
||||
|
||||
s += lip;
|
||||
|
@ -1299,7 +1299,7 @@ set_comp_sep(void)
|
|||
}
|
||||
i++;
|
||||
} while (tok != ENDINPUT && tok != LEXERR);
|
||||
noaliases = 0;
|
||||
noaliases = ona;
|
||||
strinend();
|
||||
inpop();
|
||||
errflag = zleparse = 0;
|
||||
|
|
|
@ -2753,7 +2753,7 @@ sep_comp_string(char *ss, char *s, int noffs)
|
|||
LinkNode n;
|
||||
int owe = we, owb = wb, ocs = cs, swb, swe, scs, soffs, ne = noerrs;
|
||||
int sl = strlen(ss), tl, got = 0, i = 0, cur = -1, oll = ll, remq;
|
||||
int ois = instring, oib = inbackt;
|
||||
int ois = instring, oib = inbackt, ona = noaliases;
|
||||
char *tmp, *p, *ns, *ol = (char *) line, sav, *oaq = autoq, *qp, *qs;
|
||||
char *ts, qc = '\0';
|
||||
|
||||
|
@ -2813,7 +2813,7 @@ sep_comp_string(char *ss, char *s, int noffs)
|
|||
}
|
||||
i++;
|
||||
} while (tok != ENDINPUT && tok != LEXERR);
|
||||
noaliases = 0;
|
||||
noaliases = ona;
|
||||
strinend();
|
||||
inpop();
|
||||
errflag = zleparse = 0;
|
||||
|
@ -3648,6 +3648,7 @@ makecomplistflags(Compctl cc, char *s, int incmd, int compadd)
|
|||
LinkList foo = newlinklist();
|
||||
LinkNode n;
|
||||
int first = 1, ng = opts[NULLGLOB], oowe = we, oowb = wb;
|
||||
int ona = noaliases;
|
||||
char *tmpbuf;
|
||||
|
||||
opts[NULLGLOB] = 1;
|
||||
|
@ -3669,7 +3670,7 @@ makecomplistflags(Compctl cc, char *s, int incmd, int compadd)
|
|||
addlinknode(foo, ztrdup(tokstr));
|
||||
first = 0;
|
||||
} while (tok != ENDINPUT && tok != LEXERR);
|
||||
noaliases = 0;
|
||||
noaliases = ona;
|
||||
strinend();
|
||||
inpop();
|
||||
errflag = zleparse = 0;
|
||||
|
|
|
@ -964,6 +964,7 @@ static char *
|
|||
get_comp_string(void)
|
||||
{
|
||||
int t0, tt0, i, j, k, cp, rd, sl, ocs, ins, oins, ia, parct, varq = 0;
|
||||
int ona = noaliases;
|
||||
char *s = NULL, *linptr, *tmp, *p, *tt = NULL;
|
||||
|
||||
freebrinfo(brbeg);
|
||||
|
@ -1236,12 +1237,12 @@ get_comp_string(void)
|
|||
addedx = 0;
|
||||
goto start;
|
||||
}
|
||||
noaliases = 0;
|
||||
noaliases = ona;
|
||||
lexrestore();
|
||||
return NULL;
|
||||
}
|
||||
|
||||
noaliases = 0;
|
||||
noaliases = ona;
|
||||
|
||||
/* Check if we are in an array subscript. We simply assume that *
|
||||
* we are in a subscript if we are in brackets. Correct solution *
|
||||
|
@ -2138,7 +2139,7 @@ int
|
|||
doexpandhist(void)
|
||||
{
|
||||
unsigned char *ol;
|
||||
int oll, ocs, ne = noerrs, err;
|
||||
int oll, ocs, ne = noerrs, err, ona = noaliases;
|
||||
|
||||
pushheap();
|
||||
metafy_line();
|
||||
|
@ -2165,7 +2166,7 @@ doexpandhist(void)
|
|||
* means that the expanded string is unusable. */
|
||||
err = errflag;
|
||||
noerrs = ne;
|
||||
noaliases = 0;
|
||||
noaliases = ona;
|
||||
strinend();
|
||||
inpop();
|
||||
zleparse = 0;
|
||||
|
|
|
@ -1556,7 +1556,7 @@ exalias(void)
|
|||
|
||||
if (tok == STRING) {
|
||||
/* Check for an alias */
|
||||
an = noaliases ? NULL :
|
||||
an = (noaliases || unset(ALIASESOPT)) ? NULL :
|
||||
(Alias) aliastab->getnode(aliastab, yytext);
|
||||
if (an && !an->inuse && ((an->flags & ALIAS_GLOBAL) || incmdpos ||
|
||||
inalmore)) {
|
||||
|
|
|
@ -69,6 +69,7 @@ mod_export HashTable optiontab;
|
|||
* to avoid formatting problems.
|
||||
*/
|
||||
static struct optname optns[] = {
|
||||
{NULL, "aliases", OPT_EMULATE|OPT_ALL, ALIASESOPT},
|
||||
{NULL, "allexport", OPT_EMULATE, ALLEXPORT},
|
||||
{NULL, "alwayslastprompt", OPT_ALL, ALWAYSLASTPROMPT},
|
||||
{NULL, "alwaystoend", 0, ALWAYSTOEND},
|
||||
|
|
Loading…
Reference in a new issue