zsh-users
 help / color / mirror / code / Atom feed
From: Oliver Kiddle <okiddle@yahoo.co.uk>
To: Jesper Holmberg <jesper.holmberg.5791@student.uu.se>
Cc: Zsh Users <zsh-users@sunsite.dk>
Subject: Re: preexec function to work after `&&'
Date: Wed, 10 Sep 2003 09:51:49 +0200	[thread overview]
Message-ID: <1960.1063180309@gmcs3.local> (raw)
In-Reply-To: <20030908191720.GR6280@strindberg.student.uu.se>

Jesper Holmberg wrote:

> I only now found the time to experiment with Eric's neat preexec function,
> and it's very nice. However, I'd like it to also work with tab completion,
> is that possible?

Not without modifying completion functions I don't think.

Completion in command context uses the -command- special context. By
default this ($_comps[-command-]) is the _autocd function. So the
easiest is perhaps to write your own wrapper function:

  _cmd_or_file() {
    _alternative \
      'files:file:_path_files -g "(#i)*.(html|jpg|jpeg|tif|tiff|png|doc|xls)"' \
      'commands:command:_autocd'
  }

Then use this new function for the -command- context:

  compdef _cmd_or_file -command-

Or you might find it easier to just get the latest 4.1 sources from CVS
and try out Peter's new suffix aliases feature.

Oliver


      parent reply	other threads:[~2003-09-10  7:51 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2003-08-13 13:14 Eric Smith
2003-08-13 15:16 ` Oliver Kiddle
2003-09-08 19:17 ` Jesper Holmberg
2003-09-08 20:21   ` preexec function to work after `&&' -> tab completion for preexec Eric Smith
2003-09-10  7:51   ` Oliver Kiddle [this message]

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=1960.1063180309@gmcs3.local \
    --to=okiddle@yahoo.co.uk \
    --cc=jesper.holmberg.5791@student.uu.se \
    --cc=zsh-users@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).