Path: utzoo!utgpu!jarvis.csri.toronto.edu!mailrus!tut.cis.ohio-state.edu!brutus.cs.uiuc.edu!flute!grunwald From: grunwald@flute.cs.uiuc.edu (Dirk Grunwald) Newsgroups: gnu.emacs Subject: Re: save-context-predicate in saveconf.el Message-ID: Date: 25 Jul 89 17:32:01 GMT References: <1989Jul25.145204.3015@talos.uucp> Sender: news@brutus.cs.uiuc.edu Reply-To: grunwald@flute.cs.uiuc.edu Distribution: na Organization: University of Illinois, Urbana-Champaign Lines: 37 In-reply-to: ghh@cognito.princeton.edu's message of 25 Jul 89 16:35:28 GMT I have been using the following with great success: (setq save-context-predicate (function (lambda (w) (and ; nil? (buffer-file-name (window-buffer w)) ; /usr/tmp or /tmp? (not (string-match "^\\(/usr\\)?/tmp/" (buffer-file-name (window-buffer w)))) ; rmail mode? (let ((isok t)) (save-excursion (set-buffer (window-buffer w)) (setq isok (not (or (eq major-mode 'rmail-mode) (eq major-mode 'mail-mode))))) isok)) ))) Since I've switched to VM, I've adopted another approach: (setq auto-mode-alist (append (list (cons "\\.mail$" 'run-vm-mode) (cons "INBOX$" 'run-vm-mode)))) (defun run-vm-mode () (vm (buffer-file-name))) which works very well. You could also change the pattern to match things in your vm-folder-directory, but I define that later, so didn't do that here. -- Dirk Grunwald -- Univ. of Illinois (grunwald@flute.cs.uiuc.edu)