Zsh Mailing List Archive
Messages sorted by: Reverse Date, Date, Thread, Author

Re: Seeking feedback word breaks and aliasing of tokens



On May 15,  2:41am, Oliver Kiddle wrote:
} Subject: Re: Seeking feedback word breaks and aliasing of tokens
}
} > Note that a word break is introduced to the left of the expansion (because
} > of '||'s original meaning as shell syntax) even though there are no spaces
} > around the original usage; but no word break occurs to the right of the
} > expansion.  The proposal is for word breaks on both sides of the expansion
} > (as is implied by recognition of a separately aliasable word).
} 
} I'd agree that 34781 made sense in that having the word break on only
} one side of the token after alias expansion is not consistent. Was the
} preceding word break always there or intentional as part of the recent
} changes?

It was always there, and nearly impossible to remove without completely
rewriting the parser, as far as I can tell.

} The added word breaks do remove flexibility because you could always
} have included them in the alias: alias -g '||'=' OR '

That introduces a different problem because an alias that explicitly ends
with a space triggers alias expansion on the following word.

} It seems redirections are also covered by this change but this looks
} like a bug:
} % alias -g '>!'='REDIR'
} % echo one>!two
} zsh: event not found: two
}  prompt.c:1539: BUG: cmdstack empty

That has nothing to do with the alias, it's a completely different bug.

schaefer[619] Src/zsh -f
torch% echo one>!two
zsh: event not found: two
../../zsh-5.0/Src/prompt.c:1539: BUG: cmdstack empty

} You can't alias something like 2>&1 though.

Correct, because that's three tokens "2" ">&" "1" and every alias has to
be for a single token.



Messages sorted by: Reverse Date, Date, Thread, Author