zsh-users
 help / color / mirror / code / Atom feed
* Can $_ substitute $0 when nofunctionargzero
@ 2016-06-09 16:44 Sebastian Gniazdowski
  2016-06-09 17:06 ` Sebastian Gniazdowski
  0 siblings, 1 reply; 7+ messages in thread
From: Sebastian Gniazdowski @ 2016-06-09 16:44 UTC (permalink / raw)
  To: Zsh Users

Hello,
this (one line):
mkdir -p pathcomponent; echo 'echo "0: $0, _: $_";' >
pathcomponent/sourceme; setopt nofunctionargzero; source
pathcomponent/sourceme

outputs:
0: /bin/zsh, _: pathcomponent/sourceme

So it looks like $_ can take back what nofunctionargzero takes away:
path to sourced file. Normally $0 is used in many plugins, making them
incompatible with nofunctionargzero. Z-sy-h has an explicit check for
this and does:

  echo "zsh-syntax-highlighting: error: not compatible with
NO_FUNCTION_ARGZERO" >&2

Can $_ take over? This would mean such scripts can be compatible with
emulate sh and ksh.

Best regards,
Sebastian Gniazdowski


^ permalink raw reply	[flat|nested] 7+ messages in thread

end of thread, other threads:[~2016-06-15 17:40 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2016-06-09 16:44 Can $_ substitute $0 when nofunctionargzero Sebastian Gniazdowski
2016-06-09 17:06 ` Sebastian Gniazdowski
2016-06-09 18:33   ` Sebastian Gniazdowski
2016-06-09 20:46     ` Bart Schaefer
2016-06-10  6:12       ` Sebastian Gniazdowski
2016-06-15 16:58         ` Sebastian Gniazdowski
2016-06-15 17:40           ` 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).