Path: utzoo!utgpu!jarvis.csri.toronto.edu!rutgers!njin!princeton!phoenix!ghh From: ghh@cognito.princeton.edu (Gilbert Harman) Newsgroups: gnu.emacs Subject: save-context-predicate in saveconf.el Message-ID: Date: 25 Jul 89 00:12:45 GMT Sender: news@phoenix.Princeton.EDU Distribution: na Organization: Princeton University Cognitive Science Lab Lines: 41 I have been using the recently posted version of saveconf.el in gnu emacs v 18.54. I would like to use this to have emacs start up by visiting all the files I was working on when I last stopped. Except that I would like not to have my RMAIL file load as a text file. It would seem that I ought to be able to do this using the variable: save-context-predicate. But I can't get it to work. In fact, I notice that the default for the variable is supposed to prevent /tmp and /usr/tmp files from being restored, and that doesn't work for me either. Here is the defvar in saveconf.el (defvar save-context-predicate (function (lambda (w) (and (buffer-file-name (window-buffer w)) (not (string-match "^\\(/usr\\)?/tmp/" (buffer-file-name (window-buffer w))))))) "*Value is a predicate function which determines which windows' contexts are saved. When the `save-context' command is invoked, this function will be called once for each existing Emacs window. The function should accept one argument which will be a window object, and should return non-nil if the window's context should be saved.") This is what I tried in my .emacs file so as to prevent my RMAIL file from being remembered. (setq save-context-predicate (function (lambda (w) (and (buffer-file-name (window-buffer w)) (not (string-match "\\(^\\(/usr\\)?/tmp/\\)\\|RMAIL" (buffer-file-name (window-buffer w))))))) ) -- Gilbert Harman Princeton University Cognitive Science Laboratory 221 Nassau Street, Princeton, NJ 08542 ghh@princeton.edu HARMAN@PUCC.BITNET