zsh-workers
 help / color / mirror / code / Atom feed
From: Peter Stephenson <pws@ibmth.df.unipi.it>
To: zsh-workers@sunsite.auc.dk (Zsh hackers list)
Subject: Re: MAIL, MAILPATH and maildir support
Date: Thu, 03 Jun 1999 16:08:48 +0200	[thread overview]
Message-ID: <9906031408.AA18693@ibmth.df.unipi.it> (raw)
In-Reply-To: "Oliver Kiddle"'s message of "Thu, 03 Jun 1999 14:20:54 DFT." <37568136.2B496042@thoth.u-net.com>

Oliver Kiddle wrote:
> Bart Schaefer wrote:
> > 
> > Perhaps checkmailpath is a candidate for some kind of loadable module ...
> 
> In my opinion, it would be useful to put all of the mail related
> handling in a loadable module and then make that module quite powerful
> (with lots of mush style commands etc). I think it would complement
> stuff like the zftp module very well. I suggested writing such a module
> about 2 years ago and got a mostly negative response. What does anyone
> think?

A module with more powerful mail commands is a reasonable idea, but I have
some reservations.  First, if this is going to be a largish add-on, basic
UNIX mail-file checking (as it currently exists) should probably stay in
the basic shell, since pretty much everybody (? I presume) uses that ---
hence exporting it just gets you all the stuff in the module and doesn't in
practice save anything.  Second, with the plethora of mail systems (the
maildir one is just one example), a general module for mail handling is a
big undertaking.  Third, anybody who wants to use individual commands
rather than a monolothic program to get at the mail is probably well
advised to use MH or some other existing system (the problem with mainting
a connection that made zftp useful as a module doesn't exist).
Nonetheless, if you've got some good ideas for what should go in such a
module --- or even some code --- it would be interesting to see them.

As for things like the patch that started all this: it looks to me like it
could be written efficiently enough as a shell function to be run from one
of the functions periodic or precmd.  You could even divide it into two
parts: first, shell code to replace the checkmailpath() functionality,
which is pretty simple (apart from recursive directory checking, but you
can use **/*(.mm???) to get regular files modified in the last ???  minutes
--- maybe (ms???) should work too, but it doesn't at the moment); second,
any ad-hoc functions to be called for special mail systems.  The only
difficulty with implementing mailstat() in that way is that looping over a
lot of files is slow in zsh functions, but I don't think you need to: if
you're just looking for the most recently modified/accessed file, *(om[1])
and *(oa[1]) are efficient (or will be when 3.1.6 appears), and if you want
the total size (do you? checkmailpath() simply looks to see if it's
non-zero),
    ls -l new/* cur/* | awk '{ tot += $5 } END { print tot }'
works (maybe $4 for BSD).  Such functions could certainly be distributed
with the source.

-- 
Peter Stephenson <pws@ibmth.df.unipi.it>       Tel: +39 050 844536
WWW:  http://www.ifh.de/~pws/
Dipartimento di Fisica, Via Buonarroti 2, 56127 Pisa, Italy


  reply	other threads:[~1999-06-03 14:37 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
1999-06-03  4:00 Clint Adams
1999-06-03  5:46 ` Bart Schaefer
1999-06-03 12:02   ` Clint Adams
1999-06-03 13:20   ` Oliver Kiddle
1999-06-03 14:08     ` Peter Stephenson [this message]
1999-06-03 15:51       ` Bart Schaefer
1999-06-03 15:45         ` Peter Stephenson
1999-06-07 13:45       ` Oliver Kiddle
1999-06-03 19:18   ` Bruce Stephens
1999-06-04  9:48 Sven Wischnowsky

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=9906031408.AA18693@ibmth.df.unipi.it \
    --to=pws@ibmth.df.unipi.it \
    --cc=zsh-workers@sunsite.auc.dk \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).