🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: gnu.emacs.bug
Article #99469

Mail indicator on mode line.

#99469
From: markf
Date: Thu, 16 Aug 1990 16:53
38 lines
1976 bytes
With emacs 18.55.9 the mail notification no longer works correctly if
your mail reader drains the spool file without deleting it (e.g. MH's
inc command).

The follwing version of display-time-filter in time.el will fix it.

(defun display-time-filter (proc string)
  (let ((time (current-time-string))
	(load (format "%03d" (car (load-average))))
	(mail-spool-file (concat rmail-spool-directory
				 (or (getenv "LOGNAME")
				     (getenv "USER")
				     (user-login-name))))
	hour pm)
    (setq hour (read (substring time 11 13)))
    (setq pm (>= hour 12))
    (if (> hour 12)
	(setq hour (- hour 12))
      (if (= hour 0)
	  (setq hour 12)))
    (setq display-time-string
	  (concat (format "%d" hour) (substring time 13 16)
		  (if pm "pm " "am ")
		  (substring load 0 -2) "." (substring load -2)
		  (if (and (file-exists-p mail-spool-file)
			   ;; file not empty?
			   (> (nth 7 (file-attributes mail-spool-file)) 0))
		      " Mail"
		      "")))
    ;; Append the date if desired.
    (if display-time-day-and-date
	(setq display-time-string
	      (concat (substring time 0 11) display-time-string))))
  ;; Force redisplay of all buffers' mode lines to be considered.
  (save-excursion (set-buffer (other-buffer)))
  (set-buffer-modified-p (buffer-modified-p))
  ;; Do redisplay right now, if no input pending.
  (sit-for 0))
Technical Details
Message-ID: <9008161653.AA20192@life.ai.mit.edu>
Path: arc1-ca.pugleaf.net!gmdzi!unido!mcsun!uunet!tut.cis.ohio-state.edu!ZURICH.AI.MIT.EDU!markf

Show Full Headers
Complete Article Headers
X-Google-Language: ENGLISH,ASCII-7-bit
X-Google-Thread: fb2f1,ab8c023a003b2a2b,start
X-Google-Attributes: gidfb2f1,public
X-Google-ArrivalTime: 1990-08-16 17:54:30 PST
Path: arc1-ca.pugleaf.net!gmdzi!unido!mcsun!uunet!tut.cis.ohio-state.edu!ZURICH.AI.MIT.EDU!markf
From: markf@ZURICH.AI.MIT.EDU
Newsgroups: gnu.emacs.bug
Subject: Mail indicator on mode line.
Message-ID: <9008161653.AA20192@life.ai.mit.edu>
Date: 16 Aug 90 16:53:48 GMT
Sender: daemon@tut.cis.ohio-state.edu
Reply-To: markf@zurich.ai.mit.edu
Distribution: gnu
Organization: GNUs Not Usenet
Lines: 38
Posted: Thu Aug 16 17:53:48 1990