* PATCH: jobs completion, and Re: _subscript
@ 1999-06-21 16:53 Oliver Kiddle
0 siblings, 0 replies; only message in thread
From: Oliver Kiddle @ 1999-06-21 16:53 UTC (permalink / raw)
To: zsh-workers
Firstly, sorry about the problems with my patches wrapping: I'll blame
Microsoft because I was using MS Exchange from work because messages
sent from my main account had been taking a week to get to zsh-workers.
I'm using a different SMTP server for this message so hopefully it'll
work.
Is there a good reason for only completing the first word of jobs (with
compctl -j), i.e. just the name of the command? I find this quite
annoying because most of the jobs I suspend are either less or man so I
have several jobs all with the same command name. This means I end up
having to run jobs and then use the job number with fg.
>From the source, this behaviour seems to have been intentional on the
part of whoever wrote it but it is one of the few remaining areas where
I miss the tcsh behaviour. The simple patch at the end of this mail
fixes it to use the full command.
It isn't a major problem but I should just point out one thing relating
to _subscript: it doesn't deal properly with arrays with missing
elements - try:
anarray=( 1 2 3 )
anarray[5]=Five
echo $anarray[<tab>
In the original patch which I made, I made some attempt to deal with
this (the list was right but the matches weren't).
Finally, I'd just like to add that I think Peter's idea for one
parameter expansion flag for print style options is a good one.
Oliver Kiddle
*** Src/Zle/zle_tricky.c.old Sun Jun 20 14:32:34 1999
--- Src/Zle/zle_tricky.c Mon Jun 21 16:01:34 1999
***************
*** 6365,6371 ****
if (cc->mask & (CC_JOBS | CC_RUNNING | CC_STOPPED)) {
/* Get job names. */
int i;
! char *j, *jj;
for (i = 0; i < MAXJOB; i++)
if ((jobtab[i].stat & STAT_INUSE) &&
--- 6365,6371 ----
if (cc->mask & (CC_JOBS | CC_RUNNING | CC_STOPPED)) {
/* Get job names. */
int i;
! char *j;
for (i = 0; i < MAXJOB; i++)
if ((jobtab[i].stat & STAT_INUSE) &&
***************
*** 6372,6384 ****
jobtab[i].procs && jobtab[i].procs->text) {
int stopped = jobtab[i].stat & STAT_STOPPED;
! j = jj = dupstring(jobtab[i].procs->text);
! /* Find the first word. */
! for (; *jj; jj++)
! if (*jj == ' ') {
! *jj = '\0';
! break;
! }
if ((cc->mask & CC_JOBS) ||
(stopped && (cc->mask & CC_STOPPED)) ||
(!stopped && (cc->mask & CC_RUNNING)))
--- 6372,6378 ----
jobtab[i].procs && jobtab[i].procs->text) {
int stopped = jobtab[i].stat & STAT_STOPPED;
! j = dupstring(jobtab[i].procs->text);
if ((cc->mask & CC_JOBS) ||
(stopped && (cc->mask & CC_STOPPED)) ||
(!stopped && (cc->mask & CC_RUNNING)))
^ permalink raw reply [flat|nested] only message in thread
only message in thread, other threads:[~1999-06-21 16:53 UTC | newest]
Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
1999-06-21 16:53 PATCH: jobs completion, and Re: _subscript 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).