From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from euclid.skiles.gatech.edu (list@euclid.skiles.gatech.edu [130.207.146.50]) by melb.werple.net.au (8.7.5/8.7.3) with ESMTP id EAA24179 for ; Tue, 28 May 1996 04:04:21 +1000 (EST) Received: (from list@localhost) by euclid.skiles.gatech.edu (8.7.3/8.7.3) id NAA29222; Mon, 27 May 1996 13:50:28 -0400 (EDT) Resent-Date: Mon, 27 May 1996 13:50:28 -0400 (EDT) From: Zoltan Hidvegi Message-Id: <199605271706.TAA00782@hzoli.ppp.cs.elte.hu> Subject: Re: mailcheck patch To: heading_anthony@jpmorgan.com (Anthony Heading) Date: Mon, 27 May 1996 19:06:17 +0200 (MET DST) Cc: zsh-workers@math.gatech.edu In-Reply-To: <199605241818.TAA23634@et-sun4.uk.jpmorgan.com> from Anthony Heading at "May 24, 96 07:18:56 pm" X-Mailer: ELM [version 2.4ME+ PL11 (25)] MIME-Version: 1.0 Content-Type: application/pgp; format=text; x-action=sign Content-Transfer-Encoding: 7bit Resent-Message-ID: <"_1orq2.0.W87.ZjUgn"@euclid> Resent-From: zsh-workers@math.gatech.edu X-Mailing-List: archive/latest/1193 X-Loop: zsh-workers@math.gatech.edu Precedence: list Resent-Sender: zsh-workers-request@math.gatech.edu -----BEGIN PGP SIGNED MESSAGE----- > I've had this patch kicking around for a year or two, and find it quite > useful. Perhaps it might be worth incorporating? [The patch called a function if a mailpath element was path??function] I do not incorporate it now. Instead here is an other patch. After that, the message part of mailpath will undergo parameter expansion, command substitution and arithmetic substitution. This is exactly what ksh does. This can provide equivalent functionality to the requested feature. Zoltan *** Src/utils.c 1996/05/20 01:24:18 2.26 --- Src/utils.c 1996/05/27 16:36:40 *************** *** 693,708 **** fprintf(stderr, "You have new mail.\n"); fflush(stderr); } else { ! char *z = u; ! while (*z) ! if (*z == '$' && z[1] == '_') { ! fputs(unmeta(*s), stderr); ! z += 2; ! } else ! fputc(*z++, stderr); ! fputc('\n', stderr); ! fflush(stderr); } if (isset(MAILWARNING) && st.st_atime > st.st_mtime && st.st_atime > lastmailcheck && st.st_size) { --- 693,710 ---- fprintf(stderr, "You have new mail.\n"); fflush(stderr); } else { ! char *usav = underscore; ! underscore = *s; ! heapalloc(); ! u = dupstring(u); ! if (! parsestr(u)) { ! singsub(&u); ! zputs(u, stderr); ! fputc('\n', stderr); ! fflush(stderr); ! } ! underscore = usav; } if (isset(MAILWARNING) && st.st_atime > st.st_mtime && st.st_atime > lastmailcheck && st.st_size) { *** Doc/zshparam.man 1996/05/04 23:32:52 2.8 --- Doc/zshparam.man 1996/05/27 17:00:38 *************** *** 396,409 **** The interval in seconds between checks for new mail. .TP .B mailpath (MAILPATH) ! An array (colon-separated list) ! of filenames to check for new mail. Each filename can ! be followed by a ? and a message that will be printed. ! The sequence $_ in the message will be replaced by the name ! of the mail file. ! The default message is "You have new mail." If an element is a directory ! instead of a file the shell will recursively check every file in every ! subdirectory of the element. .TP .B manpath (MANPATH) An array (colon-separated list) --- 396,410 ---- The interval in seconds between checks for new mail. .TP .B mailpath (MAILPATH) ! An array (colon-separated list) of filenames to check for ! new mail. Each filename can be followed by a ? and a ! message that will be printed. The message will undergo ! parameter expansion, command substitution and arithmetic ! substitution with the variable \fB$_\fP defined as the name ! of the file that has changed. The default message is ! "\fIYou have new mail.\fP" If an element is a directory ! instead of a file the shell will recursively check every ! file in every subdirectory of the element. .TP .B manpath (MANPATH) An array (colon-separated list) -----BEGIN PGP SIGNATURE----- Version: 2.6.3i Charset: noconv iQCVAwUBManhAgupSCiLN749AQGjWgP/dGkUa7loJqSYidCCKVMPC/jlwihH8T1S yPuuBksMNBplcWXD3W9ZsLRkv6DA39jfCXw2NGgwNwVlVWU9/zZm/iVcdPSsiZZ6 VxwAFX+ZttQIhFj+lCFxwbsU6dDliSXvMOAtvoyKvfqDl5FzRq5EBol2vJ4asvTY 6j+PYmfOt/w= =vOfA -----END PGP SIGNATURE-----