From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 29706 invoked from network); 20 Jun 2005 16:54:38 -0000 Received: from news.dotsrc.org (HELO a.mx.sunsite.dk) (130.225.247.88) by ns1.primenet.com.au with SMTP; 20 Jun 2005 16:54:38 -0000 Received: (qmail 8394 invoked from network); 20 Jun 2005 16:54:31 -0000 Received: from sunsite.dk (130.225.247.90) by a.mx.sunsite.dk with SMTP; 20 Jun 2005 16:54:31 -0000 Received: (qmail 9637 invoked by alias); 20 Jun 2005 16:54:28 -0000 Mailing-List: contact zsh-workers-help@sunsite.dk; run by ezmlm Precedence: bulk X-No-Archive: yes X-Seq: 21366 Received: (qmail 9627 invoked from network); 20 Jun 2005 16:54:27 -0000 Received: from news.dotsrc.org (HELO a.mx.sunsite.dk) (130.225.247.88) by sunsite.dk with SMTP; 20 Jun 2005 16:54:27 -0000 Received: (qmail 8085 invoked from network); 20 Jun 2005 16:54:27 -0000 Received: from vms040pub.verizon.net (206.46.252.40) by a.mx.sunsite.dk with SMTP; 20 Jun 2005 16:54:23 -0000 Received: from candle.brasslantern.com ([71.116.88.149]) by vms040.mailsrvcs.net (Sun Java System Messaging Server 6.2 HotFix 0.04 (built Dec 24 2004)) with ESMTPA id <0IIE008TF6YIVZF0@vms040.mailsrvcs.net> for zsh-workers@sunsite.dk; Mon, 20 Jun 2005 11:54:19 -0500 (CDT) Received: from candle.brasslantern.com (IDENT:schaefer@localhost [127.0.0.1]) by candle.brasslantern.com (8.12.11/8.12.11) with ESMTP id j5KGsHYU021818 for ; Mon, 20 Jun 2005 09:54:17 -0700 Received: (from schaefer@localhost) by candle.brasslantern.com (8.12.11/8.12.11/Submit) id j5KGsGcq021817 for zsh-workers@sunsite.dk; Mon, 20 Jun 2005 09:54:16 -0700 Date: Mon, 20 Jun 2005 16:54:16 +0000 From: Bart Schaefer Subject: Re: LONG_LIST_JOBS doesn't affect all job listings? In-reply-to: <1050620152337.ZM21590@candle.brasslantern.com> To: zsh-workers@sunsite.dk Message-id: <1050620165416.ZM21816@candle.brasslantern.com> MIME-version: 1.0 X-Mailer: Z-Mail (5.0.0 30July97) Content-type: text/plain; charset=us-ascii References: <1050620034619.ZM21043@candle.brasslantern.com> <200506200955.j5K9t6fN005782@news01.csr.com> <1050620152337.ZM21590@candle.brasslantern.com> Comments: In reply to Bart Schaefer "Re: LONG_LIST_JOBS doesn't affect all job listings?" (Jun 20, 3:23pm) X-Spam-Checker-Version: SpamAssassin 3.0.2 on a.mx.sunsite.dk X-Spam-Level: X-Spam-Status: No, score=-2.6 required=6.0 tests=AWL,BAYES_00 autolearn=ham version=3.0.2 X-Spam-Hits: -2.6 On Jun 20, 3:23pm, Bart Schaefer wrote: } } } Is this connected with users/8989? } } Yes; I was peeking at how difficult it would be to implement tcsh's } option, and was using LONGLISTJOBS as a placeholder (and wondering if } perhaps it couldn't just be employed full time as a stand-in). The necessary patch follows. The (!thisfmt || lng) hunk is where "lng" would have to be replaced with a test of a new option if zsh were going to behave as described in users/8989. Index: Src/jobs.c =================================================================== RCS file: /extra/cvsroot/zsh/zsh-4.0/Src/jobs.c,v retrieving revision 1.15 diff -c -r1.15 jobs.c --- Src/jobs.c 26 Mar 2005 16:14:05 -0000 1.15 +++ Src/jobs.c 20 Jun 2005 16:47:18 -0000 @@ -809,7 +813,7 @@ if (lng < 0) { conted = 1; - lng = 0; + lng = !!isset(LONGLISTJOBS); } /* find length of longest signame, check to see */ @@ -869,7 +873,7 @@ break; len2 += strlen(qn->text) + 2; } - if (!thisfmt) { + if (!thisfmt || lng) { if (fline) fprintf(fout, "[%ld] %c ", (long)job, @@ -1335,7 +1339,7 @@ for (i = 1; i <= maxjob; i++) if (jobtab[i].stat & STAT_CHANGED) - printjob(jobtab + i, 0, 1); + printjob(jobtab + i, !!isset(LONGLISTJOBS), 1); } /**** job control builtins ****/ @@ -1603,10 +1607,14 @@ return 0; } - lng = (OPT_ISSET(ops,'l')) ? 1 : (OPT_ISSET(ops,'p')) ? 2 : 0; - if (OPT_ISSET(ops,'d')) - lng |= 4; - + if (func == BIN_JOBS) { + lng = (OPT_ISSET(ops,'l')) ? 1 : (OPT_ISSET(ops,'p')) ? 2 : 0; + if (OPT_ISSET(ops,'d')) + lng |= 4; + } else { + lng = !!isset(LONGLISTJOBS); + } + if ((func == BIN_FG || func == BIN_BG) && !jobbing) { /* oops... maybe bg and fg should have been disabled? */ zwarnnam(name, "no job control in this shell.", NULL, 0); @@ -1743,7 +1751,7 @@ } if (func != BIN_WAIT) /* for bg and fg -- show the job we are operating on */ - printjob(jobtab + job, (stopped) ? -1 : 0, 1); + printjob(jobtab + job, (stopped) ? -1 : lng, 1); if (func != BIN_BG) { /* fg or wait */ if (jobtab[job].pwd && strcmp(jobtab[job].pwd, pwd)) { fprintf(shout, "(pwd : ");