zsh-workers
 help / color / mirror / code / Atom feed
From: Oliver Kiddle <okiddle@yahoo.co.uk>
To: zsh-workers@sunsite.dk (Zsh hackers list)
Subject: Re: PATCH: suffix aliases
Date: Wed, 03 Sep 2003 09:55:07 +0200	[thread overview]
Message-ID: <30487.1062575707@gmcs3.local> (raw)
In-Reply-To: <20030902211128.69D218513@pwstephenson.fsnet.co.uk>

Peter wrote:
> This adds aliases for suffixes, so that after
> 
>   alias -s ps=gv
> 
> attempting to run a command called foo.ps will call `gv foo.ps'.
> 
> I could have used `alias .ps=gv' in the way 4DOS did, but as zsh aliases
> can be more or less anything it seemed more natural to have a completely
> separate table.

That makes sense.

Used to like that in 4DOS too myself. Was the only piece of shareware I
ever registered.

> I stuck with suffixes instead of patterns, which would have been less
> efficient and more complicated for little extra gain.

That's a pity. I have preexec testing for <-> and other combinations
like (#b)(<->).(<->) so that I can type numbers to get at MH messages.
I then need a few strategic alias 11='nocorrect 11' so that correction
doesn't offer me X11 or whatever as a correction. With pattern aliases,
back references could disable substituting the word as the last
argument which might have other uses such as commands which don't want
the file as the last argument (e.g. mozilla -remote).

>From the perspective of handling mime types and easier completion there
might be an argument for having both pattern and suffix completion.
Suffix completion could actually look for files, perhaps in it's own
path array and could allow the suffix to be omitted. So for wine
programs you wouldn't need to type the .exe and could put the program
directories in a suffix path.

> I dutifully added completion to _alias, but it seems that doesn't
> understand the difference between aliases with different options, so I

There isn't much point: completing existing aliases when defining new
ones isn't that useful anyway.

Oliver


  parent reply	other threads:[~2003-09-03  7:53 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2003-09-02 21:11 Peter Stephenson
2003-09-02 23:37 ` DervishD
2003-09-03  7:55 ` Oliver Kiddle [this message]
2003-09-03 10:38   ` Peter Stephenson
2003-09-03 12:33     ` Oliver Kiddle
2003-09-03 12:59       ` Peter Stephenson

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=30487.1062575707@gmcs3.local \
    --to=okiddle@yahoo.co.uk \
    --cc=zsh-workers@sunsite.dk \
    /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).