zsh-users
 help / color / mirror / code / Atom feed
From: Bart Schaefer <schaefer@brasslantern.com>
To: Zsh hackers list <zsh-users@zsh.org>
Cc: Marc Chantreux <khatar@phear.org>
Subject: Re: Dude, where is noglob?
Date: Thu, 20 Aug 2015 08:40:33 -0700	[thread overview]
Message-ID: <150820084033.ZM29067@torch.brasslantern.com> (raw)
In-Reply-To: <20150820132434.GA5903@ramirez.u-strasbg.fr>

On Aug 20,  3:24pm, Marc Chantreux wrote:
}
} alias dude!="noglob dude"
} dude () { print "$@" } 
} dude! where is my car?
} 
} alias dude="noglob dude"
} dude () { print "$@" } 
} dude where is my car?

Normally that second one doesn't work because all you've done is create
a function named "noglob" which then takes precedence over the modifier.
You need to define the alias AFTER the function.  Zsh FAQ #2.1 and #2.3.

torch% alias dude!="noglob dude"
torch% dude () { print "$@" }
torch% dude! where is my car?
where is my car?
torch% alias dude="noglob dude"
torch% dude () { print "$@" }
torch% dude where is my car?
zsh: no matches found: car?
torch% alias
dude='noglob dude'
'dude!'='noglob dude'
run-help=man
which-command=whence
torch% functions
dude () {
        print "$@"
}
noglob () {
        print "$@"
}
torch% 

-- 
Barton E. Schaefer


  reply	other threads:[~2015-08-20 15:40 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-08-19 12:31 Marc Chantreux
2015-08-19 13:00 ` Peter Stephenson
2015-08-20 13:24   ` Marc Chantreux
2015-08-20 15:40     ` Bart Schaefer [this message]
2015-08-20 13:26   ` Marc Chantreux
2015-08-19 14:56 ` Bart Schaefer

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=150820084033.ZM29067@torch.brasslantern.com \
    --to=schaefer@brasslantern.com \
    --cc=khatar@phear.org \
    --cc=zsh-users@zsh.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).