From mboxrd@z Thu Jan 1 00:00:00 1970 X-Msuck: nntp://news.gmane.io/gmane.emacs.gnus.general/31675 Path: main.gmane.org!not-for-mail From: ShengHuo ZHU Newsgroups: gmane.emacs.gnus.general Subject: Re: little annoyance in maildir support. Date: 06 Jul 2000 22:40:45 -0400 Sender: owner-ding@hpc.uh.edu Message-ID: <2nbt0ak6he.fsf@tiger.jia.vnet> References: <2nd7krw9dr.fsf@tiger.jia.vnet> <2nvgyjuq4v.fsf@tiger.jia.vnet> NNTP-Posting-Host: coloc-standby.netfonds.no Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="=-=-=" X-Trace: main.gmane.org 1035168059 15438 80.91.224.250 (21 Oct 2002 02:40:59 GMT) X-Complaints-To: usenet@main.gmane.org NNTP-Posting-Date: Mon, 21 Oct 2002 02:40:59 +0000 (UTC) Cc: Gnus Mailing List Return-Path: Original-Received: from fisher.math.uh.edu (fisher.math.uh.edu [129.7.128.35]) by mailhost.sclp.com (Postfix) with ESMTP id B983ED051F for ; Thu, 6 Jul 2000 22:42:12 -0400 (EDT) Original-Received: from sina.hpc.uh.edu (lists@Sina.HPC.UH.EDU [129.7.3.5]) by fisher.math.uh.edu (8.9.1/8.9.1) with ESMTP id VAC15949; Thu, 6 Jul 2000 21:41:15 -0500 (CDT) Original-Received: by sina.hpc.uh.edu (TLB v0.09a (1.20 tibbs 1996/10/09 22:03:07)); Thu, 06 Jul 2000 21:40:23 -0500 (CDT) Original-Received: from mailhost.sclp.com (postfix@sclp3.sclp.com [204.252.123.139]) by sina.hpc.uh.edu (8.9.3/8.9.3) with ESMTP id VAA22429 for ; Thu, 6 Jul 2000 21:40:11 -0500 (CDT) Original-Received: from shenghuo.dhs.org (d185d1e79.rochester.rr.com [24.93.30.121]) by mailhost.sclp.com (Postfix) with ESMTP id 7192ED051F for ; Thu, 6 Jul 2000 22:40:44 -0400 (EDT) Original-Received: (from zsh@localhost) by shenghuo.dhs.org (8.10.0/8.10.0) id e672ejf01526; Thu, 6 Jul 2000 22:40:45 -0400 Original-To: "Robin S. Socha" X-Attribution: ZSH X-Face: 'IF:e51ib'Qbl^(}l^&4-J`'P!@[4~O|&k#:@Gld#b/]oMq&`&FVY._3+b`mzp~Jeve~/#/ ERD!OTe<86UhyN=l`mrPY)M7_}`Ktt\K+58Z!hu7>qU,i.N7TotU[FYE(f1;}`g2xj!u*l`^&=Q!g{ *q|ddto|nkt"$r,K$[)"|6,elPH= GJ6Q In-Reply-To: "Robin S. Socha"'s message of "07 Jul 2000 00:16:17 +0200" Original-Lines: 19 User-Agent: Gnus/5.0808 (Gnus v5.8.8) Emacs/20.7 Precedence: list X-Majordomo: 1.94.jlt7 Xref: main.gmane.org gmane.emacs.gnus.general:31675 X-Report-Spam: http://spam.gmane.org/gmane.emacs.gnus.general:31675 --=-=-= "Robin S. Socha" writes: > * ShengHuo ZHU writes: > > You can redefine or advise display-time-file-nonempty-p to check > > maildir. > > You can. I can't. Could you? Please? Thanks *a lot* in advance, Try this and make sure display-time-mail-file or the environment variable MAIL is set as a string (whatever it is). (require 'mail-watch) (setq mail-watch-files-or-directories '("/my/maildir/new")) (display-time) ShengHuo --=-=-= Content-Type: application/emacs-lisp Content-Disposition: attachment; filename=mail-watch.el ;;; mail-watch.el --- Watch new mail in maildir or others ;; Copyright (C) 2000 Shenghuo ZHU ;; Author: Shenghuo ZHU ;; Created: Thu Jul 6 21:58:09 EDT 2000 ;; Keywords: maildir time ;; This file is not a part of GNU Emacs. ;; ;; This file is free software; you can redistribute it and/or modify ;; it under the terms of the GNU General Public License as published ;; by the Free Software Foundation; either version 2, or (at your ;; option) any later version. ;; ;; This file is distributed in the hope that it will be useful, but ;; WITHOUT ANY WARRANTY; without even the implied warranty of ;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU ;; General Public License for more details. ;; ;; You should have received a copy of the GNU General Public License ;; along with GNU Emacs; see the file COPYING. If not, write to the ;; Free Software Foundation, Inc., 59 Temple Place - Suite 330, ;; Boston, MA 02111-1307, USA. ;;; Commentary: ;; (require 'mail-watch) ;; (setq mail-watch-files-or-directories '("/my/maildir/new")) ;; (display-time) ;; Make sure display-time-mail-file or the environment variable MAIL ;; is set as a string (whatever it is). ;;; Code: (require 'advice) (require 'time) (defcustom mail-watch-files-or-directories nil "The files or directories to watch for new mails." :type '(repeat directory) :group 'mail) (defun mail-watch () "Watch new mails. Return non-nil if there are new mails." (let ((files mail-watch-files-or-directories)) (catch 'found (while files (cond ((file-directory-p (car files)) (dolist (file (directory-files (car files) t nil t)) (and (file-exists-p file) (not (file-directory-p file)) (< 0 (nth 7 (file-attributes (file-chase-links file)))) (throw 'found t)))) ((and (file-exists-p (car files)) (< 0 (nth 7 (file-attributes (file-chase-links (car files)))))) (throw 'found t)) (t nil)) (setq files (cdr files)))))) (defadvice display-time-file-nonempty-p (around display-time-file-nonempty-p/mail-watch activate) (setq ad-return-value (mail-watch))) (provide 'mail-watch) ;; maildir-watch.el ends here --=-=-=--