zsh-workers
 help / color / mirror / code / Atom feed
From: Richard Coleman <coleman@math.gatech.edu>
To: zsh-workers@math.gatech.edu
Subject: Re: Rationalized? aliases
Date: Wed, 08 Nov 1995 18:17:19 -0500	[thread overview]
Message-ID: <199511082317.SAA29367@redwood.skiles.gatech.edu> (raw)
In-Reply-To: Your message of "Wed, 08 Nov 1995 15:57:37 EST." <9511082057.AA08200@spacely.afive>

> Now however, the rationalized alias output makes this not work:
> 
> % echo $ZSH_VERSION
> 2.6-beta11
> alias e="gnuclient -q"
> % [[ $HOST != $HOMESYSTEM ]] && alias e="$(whence e) -h $HOMESYSTEM"
> % type e
> e is an alias for \''gnuclient -q'\'' -h spacely'
> 
> This is not what I desire ('gnuclient -q' is not a valid command) - what
>  I want is to append "-h spacely" to the alias.  How can I do this?

Hmm... A quick fix for your problem is to change
printaliasnode() in hashtable.c so that when the flags
PRINT_WHENCE_* are present, that it will use printf (or puts)
instead of printquoted().  This is exactly how it was done in
beta10.  But is this what we want to do?  It looks natural for
the output of `type' and `which' to be quoted.  For `whence' it
is not quite so clear which is best.

Rather than changing the code of zsh for this, maybe you should
just use

alias e="$(whence e | tr -d \') -h"

Doing things like this is what makes command substitution so
cool.

rc





  reply	other threads:[~1995-11-08 23:33 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
1995-11-08 20:57 Vinnie Shelton
1995-11-08 23:17 ` Richard Coleman [this message]
1995-11-08 23:36   ` Barton E. Schaefer
1995-11-09  0:52     ` Mark Borges
1995-11-09  1:07       ` Barton E. Schaefer
1995-11-09 11:13       ` Zoltan Hidvegi
1995-11-08 23:38   ` Vinnie Shelton
1995-11-09  2:12   ` Zefram

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=199511082317.SAA29367@redwood.skiles.gatech.edu \
    --to=coleman@math.gatech.edu \
    --cc=zsh-workers@math.gatech.edu \
    /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).