* PATCH: Re: Completion for kill
@ 2001-03-23 15:17 Sven Wischnowsky
2001-03-23 16:05 ` Oliver Kiddle
0 siblings, 1 reply; 3+ messages in thread
From: Sven Wischnowsky @ 2001-03-23 15:17 UTC (permalink / raw)
To: zsh-workers
Oliver Kiddle wrote:
> This has just been annoying me: completion for kill insists on doing
> menu completion: from zsh -f + compinit, create a couple of background
> jobs and then type kill %<tab>. After pressing just one tab, menu
> completion is entered with the first job completed in full on the
> command-line. The behaviour I would like is exactly what you get with
> fg %<tab> in the same situation where you need more tabs before menu
> completion is used.
>
> The situation is caused by _pids which _kill uses along with _jobs.
> None of the possible values of the insert-ids style help. One solution
> is if I add compstate[insert]=unambiguous to the end of _kill. Is there
> a better solution to this. Surely _pids should only be messing about
> with compstate[insert] if pids are the only thing being completed?
Ahem. Sorry (I use jobs so seldom that I didn't see that...)
Bye
Sven
Index: Completion/Builtins/_pids
===================================================================
RCS file: /cvsroot/zsh/zsh/Completion/Builtins/_pids,v
retrieving revision 1.9
diff -u -r1.9 _pids
--- Completion/Builtins/_pids 2000/08/16 07:16:12 1.9
+++ Completion/Builtins/_pids 2001/03/23 15:15:34
@@ -11,7 +11,7 @@
all=()
match="*[[:blank:]]${PREFIX}[0-9]#${SUFFIX}[[:blank:]]*[/[:blank:]]${2}*"
shift 2
-elif [[ "$PREFIX$SUFFIX" = [0-9]# ]]; then
+elif [[ "$PREFIX$SUFFIX" = (%*|[0-9]#) ]]; then
all=()
match="*[[:blank:]]${PREFIX}[0-9]#${SUFFIX}[[:blank:]]*"
else
--
Sven Wischnowsky wischnow@informatik.hu-berlin.de
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: PATCH: Re: Completion for kill
2001-03-23 15:17 PATCH: Re: Completion for kill Sven Wischnowsky
@ 2001-03-23 16:05 ` Oliver Kiddle
0 siblings, 0 replies; 3+ messages in thread
From: Oliver Kiddle @ 2001-03-23 16:05 UTC (permalink / raw)
To: zsh-workers
--- Sven Wischnowsky <wischnow@informatik.hu-berlin.de> wrote:
> Ahem. Sorry (I use jobs so seldom that I didn't see that...)
> -elif [[ "$PREFIX$SUFFIX" = [0-9]# ]]; then
> +elif [[ "$PREFIX$SUFFIX" = (%*|[0-9]#) ]]; then
Thanks. The same situation happens with signals so that change needs to
use [%-] instead of %. I didn't mention the signals because I rarely
complete them.
I find it mildly concerning that _pids needs to know about the
situation it is called in here. If in the future, it is used somewhere
else where the other matches don't start with something simple like %
or -, I can't see that it could know. I see that it works in _gdb but
only because _gdb calls _pids with a -m option. I suppose we can worry
about this if and when it becomes an issue.
Oliver
____________________________________________________________
Do You Yahoo!?
Get your free @yahoo.co.uk address at http://mail.yahoo.co.uk
or your free @yahoo.ie address at http://mail.yahoo.ie
^ permalink raw reply [flat|nested] 3+ messages in thread
* PATCH: Re: Completion for kill
@ 2001-03-26 8:25 Sven Wischnowsky
0 siblings, 0 replies; 3+ messages in thread
From: Sven Wischnowsky @ 2001-03-26 8:25 UTC (permalink / raw)
To: zsh-workers
Oliver Kiddle wrote:
> --- Sven Wischnowsky <wischnow@informatik.hu-berlin.de> wrote:
> > Ahem. Sorry (I use jobs so seldom that I didn't see that...)
>
> > -elif [[ "$PREFIX$SUFFIX" = [0-9]# ]]; then
> > +elif [[ "$PREFIX$SUFFIX" = (%*|[0-9]#) ]]; then
>
> Thanks. The same situation happens with signals so that change needs to
> use [%-] instead of %. I didn't mention the signals because I rarely
> complete them.
Ah, right.
> I find it mildly concerning that _pids needs to know about the
> situation it is called in here. If in the future, it is used somewhere
> else where the other matches don't start with something simple like %
> or -, I can't see that it could know. I see that it works in _gdb but
> only because _gdb calls _pids with a -m option. I suppose we can worry
> about this if and when it becomes an issue.
Yes. I don't have an idea for that yet.
There's also a hunk fixing a typo in the docs (thanks to Mario).
Bye
Sven
Index: Completion/Builtins/_pids
===================================================================
RCS file: /cvsroot/zsh/zsh/Completion/Builtins/_pids,v
retrieving revision 1.10
diff -u -r1.10 _pids
--- Completion/Builtins/_pids 2001/03/23 15:18:48 1.10
+++ Completion/Builtins/_pids 2001/03/26 08:25:22
@@ -11,7 +11,7 @@
all=()
match="*[[:blank:]]${PREFIX}[0-9]#${SUFFIX}[[:blank:]]*[/[:blank:]]${2}*"
shift 2
-elif [[ "$PREFIX$SUFFIX" = (%*|[0-9]#) ]]; then
+elif [[ "$PREFIX$SUFFIX" = ([%-]*|[0-9]#) ]]; then
all=()
match="*[[:blank:]]${PREFIX}[0-9]#${SUFFIX}[[:blank:]]*"
else
Index: Doc/Zsh/compsys.yo
===================================================================
RCS file: /cvsroot/zsh/zsh/Doc/Zsh/compsys.yo,v
retrieving revision 1.110
diff -u -r1.110 compsys.yo
--- Doc/Zsh/compsys.yo 2001/03/23 12:52:39 1.110
+++ Doc/Zsh/compsys.yo 2001/03/26 08:25:25
@@ -2300,7 +2300,7 @@
the same as the value of the tt(max-errors) style, all in one string.
Note that this completer (and the tt(_correct) completer mentioned
-below) can be quite expansive to call, especially when a large number
+below) can be quite expensive to call, especially when a large number
of errors is allowed. One way to avoid this is to set up the
tt(completer) style using the tt(-e) option to zstyle so that some
completers are only used when completion is attempted a second time on
--
Sven Wischnowsky wischnow@informatik.hu-berlin.de
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2001-03-26 8:25 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2001-03-23 15:17 PATCH: Re: Completion for kill Sven Wischnowsky
2001-03-23 16:05 ` Oliver Kiddle
2001-03-26 8:25 Sven Wischnowsky
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).