zsh-workers
 help / color / mirror / code / Atom feed
* Bug with _sh completion function
@ 2003-04-01  5:41 Felix Rosencrantz
  2003-04-23 10:54 ` PATCH: " Oliver Kiddle
  0 siblings, 1 reply; 2+ messages in thread
From: Felix Rosencrantz @ 2003-04-01  5:41 UTC (permalink / raw)
  To: zw

[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #1: Type: text/plain; charset=us-ascii, Size: 587 bytes --]

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.)

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.

-FR.


__________________________________________________
Do you Yahoo!?
Yahoo! Tax Center - File online, calculators, forms, and more
http://platinum.yahoo.com


^ permalink raw reply	[flat|nested] 2+ messages in thread

* PATCH: Re: Bug with _sh completion function
  2003-04-01  5:41 Bug with _sh completion function Felix Rosencrantz
@ 2003-04-23 10:54 ` Oliver Kiddle
  0 siblings, 0 replies; 2+ messages in thread
From: Oliver Kiddle @ 2003-04-23 10:54 UTC (permalink / raw)
  To: Felix Rosencrantz; +Cc: zw

[-- 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


^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2003-04-23 10:59 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2003-04-01  5:41 Bug with _sh completion function Felix Rosencrantz
2003-04-23 10:54 ` PATCH: " Oliver Kiddle

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).