zsh-workers
 help / color / mirror / code / Atom feed
From: Oliver Kiddle <okiddle@yahoo.co.uk>
To: Felix Rosencrantz <f_rosencrantz@yahoo.com>
Cc: zw <zsh-workers@sunsite.dk>
Subject: PATCH: Re: Bug with _sh completion function
Date: Wed, 23 Apr 2003 12:54:47 +0200	[thread overview]
Message-ID: <23062.1051095287@gmcs3.logica.co.uk> (raw)
In-Reply-To: <20030401054125.86443.qmail@web10410.mail.yahoo.com>

[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #1: Type: text/plain, Size: 1491 bytes --]

On 31 Mar, Felix Rosencrantz wrote:
> There is a problem with the sh completion function.
> 
> I have a script in the cwd called Build.sh
> When I try to complete: sh -x B<TAB>
> The _sh function attempts to complete executable&builtin commands, but not
> files in the cwd.  It should be completing files in the cwd. (I don’t have dot
> in my path.)

This change makes it complete files too. Unfortunately, it further
exacerbates the situation with respect to directory completion. If you
have autocd set, they already get completed twice and with this, they
get added thrice as completions after sh.

> I'm not sure what _sh is trying to do, but it is an attempt at a completion
> function for several different shells at once.

Well, the shells all accept a command as a parameter to run so it is useful
to complete commands for them. Completion in command position was somewhat
simpler when I first added _sh.

Oliver

Index: Completion/Unix/Command/_sh
===================================================================
RCS file: /cvsroot/zsh/zsh/Completion/Unix/Command/_sh,v
retrieving revision 1.2
diff -u -r1.2 _sh
--- Completion/Unix/Command/_sh	28 Aug 2001 20:35:53 -0000	1.2
+++ Completion/Unix/Command/_sh	23 Apr 2003 10:43:36 -0000
@@ -16,7 +16,9 @@
   local n=${words[(b:2:i)[^-]*]}
   if (( n <= CURRENT )); then
     compset -n $n
-    _normal && return 0
+    _alternative \
+      'files:file:_files' \
+      'commands:command:_normal' && return 0
   fi
   _default
 fi


      reply	other threads:[~2003-04-23 10:59 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2003-04-01  5:41 Felix Rosencrantz
2003-04-23 10:54 ` 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=23062.1051095287@gmcs3.logica.co.uk \
    --to=okiddle@yahoo.co.uk \
    --cc=f_rosencrantz@yahoo.com \
    --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).