Xref: utzoo comp.emacs:6045 gnu.emacs:872 Path: utzoo!utgpu!jarvis.csri.toronto.edu!mailrus!csd4.milw.wisc.edu!leah!rpi!rpi.edu!tale From: tale@pawl.rpi.edu (David C Lawrence) Newsgroups: comp.emacs,gnu.emacs Subject: mh-inc-folder-hook Message-ID: Date: 11 May 89 22:39:39 GMT Sender: usenet@rpi.edu Reply-To: tale@pawl.rpi.edu Distribution: comp Lines: 35 A few months ago (December maybe?) Ashwin posted a patch to mh-e.el that took care of the word " Mail" still appearing in the global mode string if display-time is running. Well, I trashed that patch about two months ago when we upgraded to 18.53 (now 18.54) and today, after repeated typing of "i" when I really had no new mail, I got frustrated enough to go back and write the patch for it again. Lo and behold, there is now and mh-inc-folder-hook! (It if was there before I never noticed it and Ashin's patch didn't use it.) Well, anyway, I figured some people might find this useful in their .emacs files. If you already have an inc-folder-hook that does something else you will have to merge this around/into your existing hook. (BTW, echoing someone else's (I forget whose) opinion, why can't match-data be global? This extra code around each random string-match/re-search seems to be somewhat of a kludge when simply (let (VAR) ...) is sufficient in other cases when you want to preserve VAR.) (setq mh-inc-folder-hook '(lambda () (if (and (boundp (quote display-time-process)) (eq (quote run) (process-status display-time-process))) (let ((real-match-data (match-data))) (unwind-protect (setq display-time-string (concat (substring display-time-string 0 (string-match " Mail" display-time-string)) (substring display-time-string (match-end 0)))) (store-match-data real-match-data)) (set-buffer-modified-p (buffer-modified-p)))))) Dave -- tale@rpitsmts.bitnet, tale%mts@itsgw.rpi.edu, tale@pawl.rpi.edu