🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: comp.emacs
Article #8122

Re: Gnu Emacs Mail Flag

#8122
From: Cesar Quiroz
Date: Thu, 15 Dec 1988 10:03
36 lines
2076 bytes
jr@bbn.com (John Robinson) suggests a way to update the mode line so
that in doesn't say "Mail" after an inc:
:(setq mh-inc-folder-hook '(lambda ()
:  (if (and (boundp 'display-time-process) display-time-process)
:      (start-process "update-time-display" nil
:		     "/bin/sh"
:		     "-c" (concat "kill -14 "
:				  (int-to-string
:				   (process-id display-time-process)))))))

So far I have been lucky enough with a method that does not disturb
the currently running display-time process.  I expect this method is
actually faster than the one proposed above.  It goes like this:

(defun cq-mh-inc-folder () ;; This function is my mh-inc-folder-hook
  "Stuff to do after incorporating mail.
If display-time-process is not-null, change the mode line
to stop announcing this mail, without waiting first for
display-time-interval to expire."
  (cond ((and (boundp 'display-time-process)
              display-time-process      ;clean up mode line
              (stringp display-time-string)
              (string-match "\\(.*\\) Mail" display-time-string))
         (setq display-time-string 
               (substring display-time-string 
                          (match-beginning 1) (match-end 1)))
         (sit-for 0))))

It just goes and chops off the "Mail" part.

Comments welcome.
-- 
                                      Cesar Augusto Quiroz Gonzalez
                                      Department of Computer Science
                                      University of Rochester
                                      Rochester,  NY 14627
Technical Details
Message-ID: <1988Dec15.050335.1870@cs.rochester.edu>
Path: arc1-ca.pugleaf.net!utzoo!attcan!uunet!lll-winken!lll-lcc!ames!mailrus!tut.cis.ohio-state.edu!rutgers!rochester!quiroz
References: <12096@hall.cray.com> <33512@bbn.COM>

Show Full Headers
Complete Article Headers
Path: arc1-ca.pugleaf.net!utzoo!attcan!uunet!lll-winken!lll-lcc!ames!mailrus!tut.cis.ohio-state.edu!rutgers!rochester!quiroz
From: quiroz@cs.rochester.edu (Cesar Quiroz)
Newsgroups: comp.emacs
Subject: Re: Gnu Emacs Mail Flag
Message-ID: <1988Dec15.050335.1870@cs.rochester.edu>
Date: 15 Dec 88 10:03:35 GMT
References: <12096@hall.cray.com> <33512@bbn.COM>
Reply-To: quiroz@cs.rochester.edu (Cesar Quiroz)
Distribution: na
Organization: U of Rochester, CS Dept, Rochester, NY 14627
Lines: 35