]> code.delx.au - gnu-emacs/blobdiff - lisp/filesets.el
(makeinfo-compile): Use `compilation-start'. Set `next-error-function'
[gnu-emacs] / lisp / filesets.el
index fe29dd6628393e6ae00565f36ad02a9ce8b1eff4..1ee126465a588795475e84be46a549a5ddc45802 100644 (file)
@@ -1,11 +1,13 @@
 ;;; filesets.el --- handle group of files
 
 ;;; filesets.el --- handle group of files
 
-;; Copyright (C) 2002 Free Software Foundation, Inc.
+;; Copyright (C) 2002, 2003, 2004, 2005 Free Software Foundation, Inc.
 
 
-;; Author: Thomas Link aka t.link (at gmx at)
-;; Time-stamp: <2002-03-22>
+;; Author: Thomas Link <t.link@gmx.at>
+;; Maintainer: FSF
 ;; Keywords: filesets convenience
 
 ;; Keywords: filesets convenience
 
+;; This file is part of GNU Emacs.
+
 ;; This program is free software; you can redistribute it and/or modify
 ;; it under the terms of the GNU General Public License as published by
 ;; the Free Software Foundation; either version 2, or (at your option)
 ;; This program is free software; you can redistribute it and/or modify
 ;; it under the terms of the GNU General Public License as published by
 ;; the Free Software Foundation; either version 2, or (at your option)
 ;; GNU General Public License for more details.
 
 ;; A copy of the GNU General Public License can be obtained from this
 ;; GNU General Public License for more details.
 
 ;; A copy of the GNU General Public License can be obtained from this
-;; program's author or from the Free Software Foundation, Inc., 675 Mass
-;; Ave, Cambridge, MA 02139, USA.
+;; program's author or from the Free Software Foundation, Inc.,
+;; 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
 
 
-(defvar filesets-version "1.8.1")
+(defvar filesets-version "1.8.4")
 (defvar filesets-homepage
   "http://members.a1.net/t.link/CompEmacsFilesets.html")
 
 ;;; Commentary:
 
 (defvar filesets-homepage
   "http://members.a1.net/t.link/CompEmacsFilesets.html")
 
 ;;; Commentary:
 
-;;Define filesets, which can be opened or saved with the power one or
-;;two mouse clicks only.  A fileset is either a list of files, a file
-;;pattern, a base directory and a search pattern (for files), or an
-;;inclusion group (i.e. a base file including other files).
+;; Define filesets, which can be opened or saved with the power of one or
+;; two mouse clicks only.  A fileset is either a list of files, a file
+;; pattern, a base directory and a search pattern (for files), or an
+;; inclusion group (i.e. a base file including other files).
 
 
-;;Usage: 1. Put (require 'filesets) into your start-up file.  2. Type
-;;M-x filesets-edit or choose "Edit Filesets" from the menu.  3. Save
-;;your customizations.
+;; Usage:
+;; 1. Put (require 'filesets) and (filesets-init) in your .emacs file.
+;; 2. Type ;; M-x filesets-edit or choose "Edit Filesets" from the menu.
+;; 3. Save your customizations.
 
 
-;;Caveat: Fileset names have to be unique.
+;; Caveat: Fileset names have to be unique.
 
 
-;;Filesets.el adds a nifty filesets menu to your menubar.  If you change
-;;your filesets on the fly, don't forget to select "Save Filesets" from
-;;the menu.
+;; Filesets.el adds a nifty filesets menu to your menubar.  If you change
+;; your filesets on the fly, don't forget to select "Save Filesets" from
+;; the menu.
 
 
-;;Pressing on the first item in the submenu will open all files at once.
-;;Define your own function, e.g. browse-url, for opening a fileset's
-;;files.  Or define external viewers for opening files with other
-;;programs.  See `filesets-external-viewers'.
+;; Pressing on the first item in the submenu will open all files at once.
+;; Define your own function, e.g. browse-url, for opening a fileset's
+;; files.  Or define external viewers for opening files with other
+;; programs.  See `filesets-external-viewers'.
 
 
-;;BTW, if you close a fileset, files, which have been changed, will
-;;be silently saved.  Change this behaviour by setting
-;;`filesets-save-buffer-fn'.
+;; BTW, if you close a fileset, files, which have been changed, will
+;; be silently saved.  Change this behaviour by setting
+;; `filesets-save-buffer-fn'.
 
 ;;; Supported modes for inclusion groups (`filesets-ingroup-patterns'):
 ;; - Elisp
 
 ;;; Supported modes for inclusion groups (`filesets-ingroup-patterns'):
 ;; - Elisp
 
 ;;- better handling of different customization scenarios
 
 
 ;;- better handling of different customization scenarios
 
+;; Data gathering should be better separated from building the menu
+;; so that one could (1) use filesets without installing the menu
+;; and (2) create new "frontends" to speedbar and others.
+
+;; The functionality to call external viewers should be isolated in
+;; an extra package and possibly integrated with the MIME
+;; handling.
 
 ;;; Credits:
 
 
 ;;; Credits:
 
@@ -82,9 +92,9 @@
 
 
 ;;; Some variables
 
 
 ;;; Some variables
-(unless (boundp 'filesets-running-xemacs)
+(eval-and-compile
   (defvar filesets-running-xemacs (string-match "XEmacs\\|Lucid" emacs-version)
   (defvar filesets-running-xemacs (string-match "XEmacs\\|Lucid" emacs-version)
-    "Non-nil means we are runninn XEmacs."))
+    "Non-nil means we are running XEmacs."))
 
 (defvar filesets-menu-cache nil
   "The whole filesets menu.")
 
 (defvar filesets-menu-cache nil
   "The whole filesets menu.")
 
 (defvar filesets-ingroup-cache nil
   "A plist containing files and their ingroup data.")
 
 (defvar filesets-ingroup-cache nil
   "A plist containing files and their ingroup data.")
-(defvar filesets-ingroup-paths nil
-  "A temporary list of path already processed when searching for
-included files.")
+(defvar filesets-ingroup-files nil
+  "List of files already processed when searching for included files.")
 
 (defvar filesets-has-changed-flag t
   "Non-nil means some fileset definition has changed.")
 
 (defvar filesets-has-changed-flag t
   "Non-nil means some fileset definition has changed.")
@@ -118,12 +127,13 @@ ignored.")
 Is buffer local variable.")
 
 (defvar filesets-verbosity 1
 Is buffer local variable.")
 
 (defvar filesets-verbosity 1
-  "An integer defining the level of verbosity. 0 means no messages
-at all.")
+  "An integer defining the level of verbosity.
+0 means no messages at all.")
 
 (defvar filesets-menu-ensure-use-cached
   (and filesets-running-xemacs
 
 (defvar filesets-menu-ensure-use-cached
   (and filesets-running-xemacs
-       (not (emacs-version>= 21 5)))
+       (if (fboundp 'emacs-version>=)
+          (not (emacs-version>= 21 5))))
   "Make sure (X)Emacs uses filesets' cache.
 
 Well, if you use XEmacs (prior to 21.5?) custom.el is loaded after
   "Make sure (X)Emacs uses filesets' cache.
 
 Well, if you use XEmacs (prior to 21.5?) custom.el is loaded after
@@ -151,6 +161,38 @@ COND-FN takes one argument: the current element."
       (when (funcall cond-fn elt)
        (setq rv (append rv (list elt)))))))
 
       (when (funcall cond-fn elt)
        (setq rv (append rv (list elt)))))))
 
+(defun filesets-ormap (fsom-pred lst)
+  "Return the tail of FSOM-LST for the head of which FSOM-PRED is non-nil."
+  (let ((fsom-lst lst)
+       (fsom-rv nil))
+    (while (and (not (null fsom-lst))
+               (null fsom-rv))
+      (if (funcall fsom-pred (car fsom-lst))
+         (setq fsom-rv fsom-lst)
+       (setq fsom-lst (cdr fsom-lst))))
+    fsom-rv))
+
+(defun filesets-some (fss-pred fss-lst)
+  "Return non-nil if FSS-PRED is non-nil for any element of FSS-LST.
+Like `some', return the first value of FSS-PRED that is non-nil."
+  (catch 'exit
+    (dolist (fss-this fss-lst nil)
+      (let ((fss-rv (funcall fss-pred fss-this)))
+       (when fss-rv
+         (throw 'exit fss-rv))))))
+;(fset 'filesets-some 'some) ;; or use the cl function
+
+(defun filesets-member (fsm-item fsm-lst &rest fsm-keys)
+  "Find the first occurrence of FSM-ITEM in FSM-LST.
+It is supposed to work like cl's `member*'. At the moment only the :test
+key is supported."
+  (let ((fsm-test (or (plist-get fsm-keys ':test)
+                     (function equal))))
+    (filesets-ormap (lambda (fsm-this)
+                     (funcall fsm-test fsm-item fsm-this))
+                   fsm-lst)))
+;(fset 'filesets-member 'member*) ;; or use the cl function
+
 (defun filesets-sublist (lst beg &optional end)
   "Get the sublist of LST from BEG to END - 1."
   (let ((rv  nil)
 (defun filesets-sublist (lst beg &optional end)
   "Get the sublist of LST from BEG to END - 1."
   (let ((rv  nil)
@@ -167,7 +209,7 @@ COND-FN takes one argument: the current element."
   (let ((this (shell-command-to-string
               (format "which --skip-alias %s 2> /dev/null | head -n 1"
                       cmd-list))))
   (let ((this (shell-command-to-string
               (format "which --skip-alias %s 2> /dev/null | head -n 1"
                       cmd-list))))
-    (if (equal this "") 
+    (if (equal this "")
        nil
       (file-name-nondirectory (substring this 0 (- (length this) 1))))))
 
        nil
       (file-name-nondirectory (substring this 0 (- (length this) 1))))))
 
@@ -209,8 +251,15 @@ COND-FN takes one argument: the current element."
 ;  (customize-set-variable var val))
 ;  (filesets-build-menu))
 
 ;  (customize-set-variable var val))
 ;  (filesets-build-menu))
 
+;; It seems this is a workaround for the XEmacs issue described in the
+;; doc-string of filesets-menu-ensure-use-cached. Under Emacs this is
+;; essentially just `set-default'.
 (defun filesets-set-default (sym val &optional init-flag)
 (defun filesets-set-default (sym val &optional init-flag)
-  "Set-default wrapper function used in conjunction with `defcustom'."
+  "Set-default wrapper function used in conjunction with `defcustom'.
+If SYM is in the list `filesets-ignore-next-set-default', delete
+it from that list, and return nil.  Otherwise, set the value of
+SYM to VAL and return t.  If INIT-FLAG is non-nil, set with
+`custom-initialize-set', otherwise with `set-default'."
   (let ((ignore-flag (member sym filesets-ignore-next-set-default)))
     (if ignore-flag
        (setq filesets-ignore-next-set-default
   (let ((ignore-flag (member sym filesets-ignore-next-set-default)))
     (if ignore-flag
        (setq filesets-ignore-next-set-default
@@ -231,6 +280,8 @@ COND-FN takes one argument: the current element."
     (setq filesets-has-changed-flag t)))
 ;    (filesets-reset-fileset nil t)))
 
     (setq filesets-has-changed-flag t)))
 ;    (filesets-reset-fileset nil t)))
 
+(defvar filesets-data)
+
 (defun filesets-data-set-default (sym val)
   "Set the default for `filesets-data'."
   (if filesets-menu-use-cached-flag
 (defun filesets-data-set-default (sym val)
   "Set the default for `filesets-data'."
   (if filesets-menu-use-cached-flag
@@ -247,14 +298,13 @@ COND-FN takes one argument: the current element."
        (dolist (x modified-filesets)
          (filesets-reset-fileset (car x))))))
   (filesets-set-default sym val))
        (dolist (x modified-filesets)
          (filesets-reset-fileset (car x))))))
   (filesets-set-default sym val))
-
-
-
+\f
 ;;; configuration
 (defgroup filesets nil
   "The fileset swapper."
   :prefix "filesets-"
 ;;; configuration
 (defgroup filesets nil
   "The fileset swapper."
   :prefix "filesets-"
-  :group 'convenience)
+  :group 'convenience
+  :version "22.1")
 
 (defcustom filesets-menu-name "Filesets"
   "*Filesets' menu name."
 
 (defcustom filesets-menu-name "Filesets"
   "*Filesets' menu name."
@@ -264,21 +314,21 @@ COND-FN takes one argument: the current element."
 
 (defcustom filesets-menu-path nil
   "*The menu under which the filesets menu should be inserted.
 
 (defcustom filesets-menu-path nil
   "*The menu under which the filesets menu should be inserted.
-XEmacs specific; see `add-submenu' for documentation."
+See `add-submenu' for documentation."
   :set (function filesets-set-default)
   :type 'sexp
   :group 'filesets)
 
 (defcustom filesets-menu-before "File"
   "*The name of a menu before which this menu should be added.
   :set (function filesets-set-default)
   :type 'sexp
   :group 'filesets)
 
 (defcustom filesets-menu-before "File"
   "*The name of a menu before which this menu should be added.
-XEmacs specific; see `add-submenu' for documentation."
+See `add-submenu' for documentation."
   :set (function filesets-set-default)
   :type 'sexp
   :group 'filesets)
 
 (defcustom filesets-menu-in-menu nil
   "*Use that instead of `current-menubar' as the menu to change.
   :set (function filesets-set-default)
   :type 'sexp
   :group 'filesets)
 
 (defcustom filesets-menu-in-menu nil
   "*Use that instead of `current-menubar' as the menu to change.
-XEmacs specific; see `add-submenu' for documentation."
+See `add-submenu' for documentation."
   :set (function filesets-set-default)
   :type 'sexp
   :group 'filesets)
   :set (function filesets-set-default)
   :type 'sexp
   :group 'filesets)
@@ -304,18 +354,19 @@ XEmacs specific; see `add-submenu' for documentation."
 (defcustom filesets-menu-cache-file
   (if filesets-running-xemacs
       "~/.xemacs/filesets-cache.el"
 (defcustom filesets-menu-cache-file
   (if filesets-running-xemacs
       "~/.xemacs/filesets-cache.el"
-      "~/.filesets-cache.el")
-  "*File to be used for saving the filesets menu between (X)Emacs
-sessions.  Set this to \"\", to disable caching of menus.
+      "~/.emacs.d/filesets-cache.el")
+  "*File to be used for saving the filesets menu between sessions.
+Set this to \"\", to disable caching of menus.
 Don't forget to check out `filesets-menu-ensure-use-cached'."
   :set (function filesets-set-default)
   :type 'file
   :group 'filesets)
 Don't forget to check out `filesets-menu-ensure-use-cached'."
   :set (function filesets-set-default)
   :type 'file
   :group 'filesets)
+(put 'filesets-menu-cache-file 'risky-local-variable t)
 
 (defcustom filesets-menu-cache-contents
   '(filesets-be-docile-flag
     filesets-submenus
 
 (defcustom filesets-menu-cache-contents
   '(filesets-be-docile-flag
     filesets-submenus
-    filesets-menu-cache 
+    filesets-menu-cache
     filesets-ingroup-cache)
   "*Stuff we want to save in `filesets-menu-cache-file'.
 
     filesets-ingroup-cache)
   "*Stuff we want to save in `filesets-menu-cache-file'.
 
@@ -378,8 +429,9 @@ Don't forget to check out `filesets-menu-ensure-use-cached'."
   :group 'filesets)
 
 (defcustom filesets-cache-hostname-flag nil
   :group 'filesets)
 
 (defcustom filesets-cache-hostname-flag nil
-  "*Non-nil means cache the hostname. If the current name differs from
-the cached one, rebuild the menu and create a new cache file."
+  "*Non-nil means cache the hostname.
+If the current name differs from the cached one,
+rebuild the menu and create a new cache file."
   :set (function filesets-set-default)
   :type 'boolean
   :group 'filesets)
   :set (function filesets-set-default)
   :type 'boolean
   :group 'filesets)
@@ -407,7 +459,7 @@ will not be rewrapped if their length exceeds this value."
   :type 'integer
   :group 'filesets)
 
   :type 'integer
   :group 'filesets)
 
-(defcustom filesets-browse-dir-fn 'dired
+(defcustom filesets-browse-dir-function 'dired
   "*A function or command used for browsing directories.
 When using an external command, \"%s\" will be replaced with the
 directory's name.
   "*A function or command used for browsing directories.
 When using an external command, \"%s\" will be replaced with the
 directory's name.
@@ -425,7 +477,7 @@ Note: You have to manually rebuild the menu if you change this value."
                           :value nil))
   :group 'filesets)
 
                           :value nil))
   :group 'filesets)
 
-(defcustom filesets-open-file-fn 'filesets-find-or-display-file
+(defcustom filesets-open-file-function 'filesets-find-or-display-file
   "*The function used for opening files.
 
 `filesets-find-or-display-file' ... Filesets' default function for
   "*The function used for opening files.
 
 `filesets-find-or-display-file' ... Filesets' default function for
@@ -448,7 +500,7 @@ Caveat: Changes will take effect only after rebuilding the menu."
                           :value nil))
   :group 'filesets)
 
                           :value nil))
   :group 'filesets)
 
-(defcustom filesets-save-buffer-fn 'save-buffer
+(defcustom filesets-save-buffer-function 'save-buffer
   "*The function used to save a buffer.
 Caveat: Changes will take effect after rebuilding the menu."
   :set (function filesets-set-default)
   "*The function used to save a buffer.
 Caveat: Changes will take effect after rebuilding the menu."
   :set (function filesets-set-default)
@@ -495,7 +547,7 @@ computer environments."
 (defcustom filesets-tree-max-level 3
   "*Maximum scan depth for directory trees.
 A :tree fileset is defined by a base directory the contents of which
 (defcustom filesets-tree-max-level 3
   "*Maximum scan depth for directory trees.
 A :tree fileset is defined by a base directory the contents of which
-will be recursively added to the menu.  filesets-tree-max-level tells up
+will be recursively added to the menu.  `filesets-tree-max-level' tells up
 to which level the directory structure should be scanned/listed,
 i.e. how deep the menu should be.  Try something like
 
 to which level the directory structure should be scanned/listed,
 i.e. how deep the menu should be.  Try something like
 
@@ -551,6 +603,7 @@ the filename."
                                       (function :tag "Function"
                                                 :value nil)))))
   :group 'filesets)
                                       (function :tag "Function"
                                                 :value nil)))))
   :group 'filesets)
+(put 'filesets-commands 'risky-local-variable t)
 
 (defcustom filesets-external-viewers
   (let
 
 (defcustom filesets-external-viewers
   (let
@@ -597,8 +650,8 @@ the filename."
 Has the form ((FILE-PATTERN VIEWER PROPERTIES) ...), VIEWER being either a
 function or a command name as string.
 
 Has the form ((FILE-PATTERN VIEWER PROPERTIES) ...), VIEWER being either a
 function or a command name as string.
 
-Properties is an association list determining filesets' behaviour in
-several conditions. Choose one from this list:
+Properties is an association list determining filesets' behavior in
+several conditions.  Choose one from this list:
 
 :ignore-on-open-all ... Don't open files of this type automatically --
 i.e. on open-all-files-events or when running commands
 
 :ignore-on-open-all ... Don't open files of this type automatically --
 i.e. on open-all-files-events or when running commands
@@ -607,7 +660,7 @@ i.e. on open-all-files-events or when running commands
 
 :constraintp FUNCTION ... use this viewer only if FUNCTION returns non-nil
 
 
 :constraintp FUNCTION ... use this viewer only if FUNCTION returns non-nil
 
-:constraint-flag SYMBOL ... use this viewer only if SYMBOL is non-nil
+:constraint-flag SEXP ... use this viewer only if SEXP evaluates to non-nil
 
 :open-hook HOOK ... run hooks after spawning the viewer -- mainly useful
 in conjunction with :capture-output
 
 :open-hook HOOK ... run hooks after spawning the viewer -- mainly useful
 in conjunction with :capture-output
@@ -655,7 +708,7 @@ In order to view pdf or rtf files in an Emacs buffer, you could use these:
                                      :value (:constraint-flag)
                                      (const :format ""
                                             :value :constraint-flag)
                                      :value (:constraint-flag)
                                      (const :format ""
                                             :value :constraint-flag)
-                                     (symbol :tag "Symbol"))
+                                     (sexp :tag "Symbol"))
                                (list :tag ":ignore-on-open-all"
                                      :value (:ignore-on-open-all t)
                                      (const  :format ""
                                (list :tag ":ignore-on-open-all"
                                      :value (:ignore-on-open-all t)
                                      (const  :format ""
@@ -694,7 +747,7 @@ In order to view pdf or rtf files in an Emacs buffer, you could use these:
                                              :value :capture-output)
                                      (boolean :tag "Boolean"))))))
   :group 'filesets)
                                              :value :capture-output)
                                      (boolean :tag "Boolean"))))))
   :group 'filesets)
-
+(put 'filesets-external-viewers 'risky-local-variable t)
 
 (defcustom filesets-ingroup-patterns
   '(("^.+\\.tex$" t
 
 (defcustom filesets-ingroup-patterns
   '(("^.+\\.tex$" t
@@ -705,7 +758,7 @@ In order to view pdf or rtf files in an Emacs buffer, you could use these:
        (:get-file-name (lambda (master file)
                         (filesets-which-file master
                                              (concat file ".sty")
        (:get-file-name (lambda (master file)
                         (filesets-which-file master
                                              (concat file ".sty")
-                                             (filesets-convert-path-list 
+                                             (filesets-convert-path-list
                                               (or (getenv "MY_TEXINPUTS")
                                                   (getenv "TEXINPUTS")))))))
       ((:name "Include")
                                               (or (getenv "MY_TEXINPUTS")
                                                   (getenv "TEXINPUTS")))))))
       ((:name "Include")
@@ -713,7 +766,7 @@ In order to view pdf or rtf files in an Emacs buffer, you could use these:
        (:get-file-name (lambda (master file)
                         (filesets-which-file master
                                              (concat file ".tex")
        (:get-file-name (lambda (master file)
                         (filesets-which-file master
                                              (concat file ".tex")
-                                             (filesets-convert-path-list 
+                                             (filesets-convert-path-list
                                               (or (getenv "MY_TEXINPUTS")
                                                   (getenv "TEXINPUTS"))))))
        (:scan-depth 5))
                                               (or (getenv "MY_TEXINPUTS")
                                                   (getenv "TEXINPUTS"))))))
        (:scan-depth 5))
@@ -723,7 +776,7 @@ In order to view pdf or rtf files in an Emacs buffer, you could use these:
        (:get-file-name (lambda (master file)
                         (filesets-which-file master
                                              (concat file ".tex")
        (:get-file-name (lambda (master file)
                         (filesets-which-file master
                                              (concat file ".tex")
-                                             (filesets-convert-path-list 
+                                             (filesets-convert-path-list
                                               (or (getenv "MY_TEXINPUTS")
                                                   (getenv "TEXINPUTS"))))))
        (:scan-depth 5))
                                               (or (getenv "MY_TEXINPUTS")
                                                   (getenv "TEXINPUTS"))))))
        (:scan-depth 5))
@@ -732,7 +785,7 @@ In order to view pdf or rtf files in an Emacs buffer, you could use these:
        (:get-file-name (lambda (master file)
                         (filesets-which-file master
                                              (concat file ".bib")
        (:get-file-name (lambda (master file)
                         (filesets-which-file master
                                              (concat file ".bib")
-                                             (filesets-convert-path-list 
+                                             (filesets-convert-path-list
                                               (or (getenv "MY_BIBINPUTS")
                                                   (getenv "BIBINPUTS")))))))))
     ("^.+\\.el$" t
                                               (or (getenv "MY_BIBINPUTS")
                                                   (getenv "BIBINPUTS")))))))))
     ("^.+\\.el$" t
@@ -882,6 +935,7 @@ With duplicates removed, it would be:
                                  (const :format "" :value :preprocess)
                                  (function :tag "Function")))))))
   :group 'filesets)
                                  (const :format "" :value :preprocess)
                                  (function :tag "Function")))))))
   :group 'filesets)
+(put 'filesets-ingroup-patterns 'risky-local-variable t)
 
 (defcustom filesets-data
   nil
 
 (defcustom filesets-data
   nil
@@ -923,7 +977,7 @@ of the file name pattern.
 :filter-dirs-flag BOOLEAN ... is only used in conjunction with :tree.
 
 :tree-max-level INTEGER ... recurse into directories this many levels
 :filter-dirs-flag BOOLEAN ... is only used in conjunction with :tree.
 
 :tree-max-level INTEGER ... recurse into directories this many levels
-(see `filesets-tree-max-level' for a full explanation)
+\(see `filesets-tree-max-level' for a full explanation)
 
 :dormant-flag BOOLEAN ... non-nil means don't show this item in the
 menu; dormant filesets can still be manipulated via commands available
 
 :dormant-flag BOOLEAN ... non-nil means don't show this item in the
 menu; dormant filesets can still be manipulated via commands available
@@ -945,7 +999,7 @@ optional.
 
 In conjunction with the :tree tag, :save is void.  :open refers to the
 function used for opening files in a directory, not for opening the
 
 In conjunction with the :tree tag, :save is void.  :open refers to the
 function used for opening files in a directory, not for opening the
-directory.  For browsing directories, `filesets-browse-dir-fn' is used.
+directory.  For browsing directories, `filesets-browse-dir-function' is used.
 
 Before using :ingroup, make sure that the file type is already
 defined in `filesets-ingroup-patterns'."
 
 Before using :ingroup, make sure that the file type is already
 defined in `filesets-ingroup-patterns'."
@@ -1007,6 +1061,7 @@ defined in `filesets-ingroup-patterns'."
                               :value (:open)
                               (const :format "" :value :open)
                               (function :tag "Function")))))))
                               :value (:open)
                               (const :format "" :value :open)
                               (function :tag "Function")))))))
+(put 'filesets-data 'risky-local-variable t)
 
 
 (defcustom filesets-query-user-limit 15
 
 
 (defcustom filesets-query-user-limit 15
@@ -1014,45 +1069,19 @@ defined in `filesets-ingroup-patterns'."
   :set (function filesets-set-default)
   :type 'integer
   :group 'filesets)
   :set (function filesets-set-default)
   :type 'integer
   :group 'filesets)
-
-
-(defun filesets-error (class &rest args)
-  "`error' wrapper."
-  (error (apply 'concat
-               (mapcar (lambda (x) (format "%s " x))
-                       args))))
-
+\f
 ;;; Emacs compatibility
 (eval-and-compile
   (if filesets-running-xemacs
 ;;; Emacs compatibility
 (eval-and-compile
   (if filesets-running-xemacs
-      (progn
-       (fset 'filesets-add-submenu 'add-submenu))
-    
-    (progn
-
-      (require 'easymenu)
-      
-      ;; This should work for 21.1 Emacs
-      (defun filesets-add-submenu (menu-path submenu &optional
-                                            before in-menu)
-       "`easy-menu-define' wrapper."
-       (easy-menu-define
-         filesets-submenu global-map "Filesets menu" submenu))
-      )))
+      (fset 'filesets-error 'error)
 
 
-;;; helper
-;(defmacro filesets-testing (feature messagep &rest body)
-;  (cond
-;   ((equal filesets-version "testing")
-;    `(progn ,@body))
-;   (messagep
-;    (message "Filestats: feature `%s' is disabled." feature)
-;    nil)
-;   (t
-;    nil)))
+    (require 'easymenu)
 
 
-;(defun filesets-not-yet-implemented (feature)
-;  (message "Filestats: `%s' is not yet implemented." feature))
+    (defun filesets-error (class &rest args)
+      "`error' wrapper."
+      (error (mapconcat 'identity args " ")))
+
+    ))
 
 (defun filesets-filter-dir-names (lst &optional negative)
   "Remove non-directory names from a list of strings. If NEGATIVE is
 
 (defun filesets-filter-dir-names (lst &optional negative)
   "Remove non-directory names from a list of strings. If NEGATIVE is
@@ -1082,7 +1111,7 @@ If SIMPLY-DO-IT is non-nil, the list is sorted regardless of
                   (lambda (a b)
                     (string< (upcase (funcall fni a))
                              (upcase (funcall fni b)))))))
                   (lambda (a b)
                     (string< (upcase (funcall fni a))
                              (upcase (funcall fni b)))))))
-       (sort (copy-list lst) fn))
+       (sort (copy-sequence lst) fn))
     lst))
 
 (defun filesets-directory-files (dir &optional
     lst))
 
 (defun filesets-directory-files (dir &optional
@@ -1097,20 +1126,20 @@ non-nil."
     (let ((files nil)
          (dirs  nil))
       (dolist (this (file-name-all-completions "" dir))
     (let ((files nil)
          (dirs  nil))
       (dolist (this (file-name-all-completions "" dir))
-       (cond 
+       (cond
         ((string-match "^\\.+/$" this)
          nil)
         ((string-match "[:/\\]$" this)
          (when (or (not match-dirs-flag)
                    (not pattern)
                    (string-match pattern this))
         ((string-match "^\\.+/$" this)
          nil)
         ((string-match "[:/\\]$" this)
          (when (or (not match-dirs-flag)
                    (not pattern)
                    (string-match pattern this))
-           (filesets-message 5 "Filesets: matched dir %S with pattern %S" 
+           (filesets-message 5 "Filesets: matched dir %S with pattern %S"
                              this pattern)
            (setq dirs (cons this dirs))))
         (t
          (when (or (not pattern)
                    (string-match pattern this))
                              this pattern)
            (setq dirs (cons this dirs))))
         (t
          (when (or (not pattern)
                    (string-match pattern this))
-           (filesets-message 5 "Filesets: matched file %S with pattern %S" 
+           (filesets-message 5 "Filesets: matched file %S with pattern %S"
                              this pattern)
            (setq files (cons (if full-flag
                                  (concat (file-name-as-directory dir) this)
                              this pattern)
            (setq files (cons (if full-flag
                                  (concat (file-name-as-directory dir) this)
@@ -1182,17 +1211,18 @@ non-nil."
                   filename)))
     (if (file-exists-p f)
        f
                   filename)))
     (if (file-exists-p f)
        f
-      (some (lambda (dir)
-             (let ((dir (file-name-as-directory dir))
-                   (files (if (file-exists-p dir)
-                              (filesets-directory-files dir nil ':files)
-                            nil)))
-               (some (lambda (file)
-                       (if (equal filename (file-name-nondirectory file))
-                           (concat dir file)
-                         nil))
-                     files)))
-           path-list))))
+      (filesets-some
+       (lambda (dir)
+        (let ((dir (file-name-as-directory dir))
+              (files (if (file-exists-p dir)
+                         (filesets-directory-files dir nil ':files)
+                       nil)))
+          (filesets-some (lambda (file)
+                           (if (equal filename (file-name-nondirectory file))
+                               (concat dir file)
+                             nil))
+                         files)))
+       path-list))))
 
 
 (defun filesets-eviewer-get-props (entry)
 
 
 (defun filesets-eviewer-get-props (entry)
@@ -1214,7 +1244,7 @@ non-nil."
 (defun filesets-get-external-viewer (file)
   "Find an external viewer for FILE."
   (let ((filename (file-name-nondirectory file)))
 (defun filesets-get-external-viewer (file)
   "Find an external viewer for FILE."
   (let ((filename (file-name-nondirectory file)))
-    (some
+    (filesets-some
      (lambda (entry)
        (when (and (string-match (nth 0 entry) filename)
                  (filesets-eviewer-constraint-p entry))
      (lambda (entry)
        (when (and (string-match (nth 0 entry) filename)
                  (filesets-eviewer-constraint-p entry))
@@ -1224,7 +1254,7 @@ non-nil."
 (defun filesets-get-external-viewer-by-name (name)
   "Get the external viewer definition called NAME."
   (when name
 (defun filesets-get-external-viewer-by-name (name)
   "Get the external viewer definition called NAME."
   (when name
-    (some
+    (filesets-some
      (lambda (entry)
        (when (and (string-equal (nth 1 entry) name)
                  (filesets-eviewer-constraint-p entry))
      (lambda (entry)
        (when (and (string-equal (nth 1 entry) name)
                  (filesets-eviewer-constraint-p entry))
@@ -1267,7 +1297,7 @@ on-close-all ... not used"
                  (filesets-get-external-viewer filename)))))
     (when def
       (filesets-alist-get def property nil t))))
                  (filesets-get-external-viewer filename)))))
     (when def
       (filesets-alist-get def property nil t))))
-    
+
 (defun filesets-reset-filename-on-change ()
   "Reset a buffer's filename if the buffer is being modified."
   (when filesets-output-buffer-flag
 (defun filesets-reset-filename-on-change ()
   "Reset a buffer's filename if the buffer is being modified."
   (when filesets-output-buffer-flag
@@ -1321,7 +1351,7 @@ Use the viewer defined in EV-ENTRY (a valid element of
                  (run-hooks 'oh))
                (set-buffer-modified-p nil)
                (setq buffer-read-only t)
                  (run-hooks 'oh))
                (set-buffer-modified-p nil)
                (setq buffer-read-only t)
-               (beginning-of-buffer))
+               (goto-char (point-min)))
            (when oh
              (run-hooks 'oh))))
       (filesets-error 'error
            (when oh
              (run-hooks 'oh))))
       (filesets-error 'error
@@ -1350,7 +1380,7 @@ not be opened."
        (filesets-spawn-external-viewer file external-viewer-def)
       (filesets-find-file file))))
 
        (filesets-spawn-external-viewer file external-viewer-def)
       (filesets-find-file file))))
 
-(defun fsfind-file-using ()
+(defun filesets-find-file-using ()
   "Select a viewer and call `filesets-find-or-display-file'."
   (interactive)
   (let* ((lst (mapcar (lambda (this)
   "Select a viewer and call `filesets-find-or-display-file'."
   (interactive)
   (let* ((lst (mapcar (lambda (this)
@@ -1362,19 +1392,19 @@ not be opened."
       (filesets-find-or-display-file nil (cadr (assoc viewer lst))))))
 
 (defun filesets-browser-name ()
       (filesets-find-or-display-file nil (cadr (assoc viewer lst))))))
 
 (defun filesets-browser-name ()
-  "Get the directory browser's name as defined in `filesets-browse-dir-fn'."
+  "Get the directory browser's name as defined in `filesets-browse-dir-function'."
   (cond
   (cond
-   ((listp filesets-browse-dir-fn)
-    (car filesets-browse-dir-fn))
+   ((listp filesets-browse-dir-function)
+    (car filesets-browse-dir-function))
    (t
    (t
-    filesets-browse-dir-fn)))
+    filesets-browse-dir-function)))
 
 (defun filesets-browse-dir (dir)
 
 (defun filesets-browse-dir (dir)
-  "Browse DIR using `filesets-browse-dir-fn'."
-  (if (functionp filesets-browse-dir-fn)
-      (funcall filesets-browse-dir-fn dir)
-    (let ((name (car filesets-browse-dir-fn))
-         (args (format (cadr filesets-browse-dir-fn) (expand-file-name dir))))
+  "Browse DIR using `filesets-browse-dir-function'."
+  (if (functionp filesets-browse-dir-function)
+      (funcall filesets-browse-dir-function dir)
+    (let ((name (car filesets-browse-dir-function))
+         (args (format (cadr filesets-browse-dir-function) (expand-file-name dir))))
       (with-temp-buffer
        (start-process (concat "Filesets:" name)
                       "*Filesets external directory browser*"
       (with-temp-buffer
        (start-process (concat "Filesets:" name)
                       "*Filesets external directory browser*"
@@ -1425,24 +1455,25 @@ Return DEFAULT if not found.  Return (car VALUE) if CARP is non-nil."
   "Return fileset ENTRY's mode: :files, :file, :tree, :pattern, or :ingroup.
 See `filesets-data'."
   (let ((data (filesets-data-get-data entry)))
   "Return fileset ENTRY's mode: :files, :file, :tree, :pattern, or :ingroup.
 See `filesets-data'."
   (let ((data (filesets-data-get-data entry)))
-    (some (lambda (x)
-           (if (assoc x data)
-               x))
-         '(:files :tree :pattern :ingroup :file))))
+    (filesets-some
+     (lambda (x)
+       (if (assoc x data)
+          x))
+     '(:files :tree :pattern :ingroup :file))))
 
 (defun filesets-entry-get-open-fn (fileset-name &optional fileset-entry)
   "Get the open-function for FILESET-NAME.
 Use FILESET-ENTRY for finding the open function, if provided."
   (filesets-data-get (or fileset-entry
                         (filesets-get-fileset-from-name fileset-name))
 
 (defun filesets-entry-get-open-fn (fileset-name &optional fileset-entry)
   "Get the open-function for FILESET-NAME.
 Use FILESET-ENTRY for finding the open function, if provided."
   (filesets-data-get (or fileset-entry
                         (filesets-get-fileset-from-name fileset-name))
-                    ':open filesets-open-file-fn t))
+                    ':open filesets-open-file-function t))
 
 (defun filesets-entry-get-save-fn (fileset-name &optional fileset-entry)
   "Get the save-function for FILESET-NAME.
 Use FILESET-ENTRY for finding the save function, if provided."
   (filesets-data-get (or fileset-entry
                         (filesets-get-fileset-from-name fileset-name))
 
 (defun filesets-entry-get-save-fn (fileset-name &optional fileset-entry)
   "Get the save-function for FILESET-NAME.
 Use FILESET-ENTRY for finding the save function, if provided."
   (filesets-data-get (or fileset-entry
                         (filesets-get-fileset-from-name fileset-name))
-                    ':save filesets-save-buffer-fn t))
+                    ':save filesets-save-buffer-function t))
 
 (defun filesets-entry-get-files (entry)
   "Get the file list for fileset ENTRY."
 
 (defun filesets-entry-get-files (entry)
   "Get the file list for fileset ENTRY."
@@ -1503,8 +1534,8 @@ Use FILESET-ENTRY for finding the save function, if provided."
   (filesets-data-get entry ':ingroup nil t))
 
 (defun filesets-file-open (open-function file-name &optional fileset-name)
   (filesets-data-get entry ':ingroup nil t))
 
 (defun filesets-file-open (open-function file-name &optional fileset-name)
-  "Open FILE-NAME using OPEN-FUNCTION. If OPEN-FUNCTION is nil, it's
-value will be deduced from FILESET-NAME"
+  "Open FILE-NAME using OPEN-FUNCTION. If OPEN-FUNCTION is nil, its
+value will be deduced from FILESET-NAME."
   (let ((open-function (or open-function
                           (filesets-entry-get-open-fn fileset-name))))
     (if (file-readable-p file-name)
   (let ((open-function (or open-function
                           (filesets-entry-get-open-fn fileset-name))))
     (if (file-readable-p file-name)
@@ -1546,7 +1577,7 @@ SAVE-FUNCTION takes no argument, but works on the current buffer."
       (cond
        ((and (symbolp this) (fboundp this))
        (let ((x (funcall this)))
       (cond
        ((and (symbolp this) (fboundp this))
        (let ((x (funcall this)))
-         (setq rv (append rv (if (listp x) x (list x))))))       
+         (setq rv (append rv (if (listp x) x (list x))))))
        (t
        (setq rv (append rv (list this))))))))
 
        (t
        (setq rv (append rv (list this))))))))
 
@@ -1557,7 +1588,8 @@ SAVE-FUNCTION takes no argument, but works on the current buffer."
 (defun filesets-cmd-show-result (cmd output)
   "Show OUTPUT of CMD (a shell command)."
   (pop-to-buffer "*Filesets: Shell Command Output*")
 (defun filesets-cmd-show-result (cmd output)
   "Show OUTPUT of CMD (a shell command)."
   (pop-to-buffer "*Filesets: Shell Command Output*")
-  (end-of-buffer)
+  (with-no-warnings
+   (end-of-buffer))
   (insert "*** ")
   (insert cmd)
   (newline)
   (insert "*** ")
   (insert cmd)
   (newline)
@@ -1591,7 +1623,7 @@ Replace <file-name> or <<file-name>> with filename."
                             (or (equal mode ':ingroup)
                                 (equal mode ':tree)))
                        (filesets-get-filelist fileset mode event)
                             (or (equal mode ':ingroup)
                                 (equal mode ':tree)))
                        (filesets-get-filelist fileset mode event)
-                    (filesets-get-filelist 
+                    (filesets-get-filelist
                      (filesets-get-fileset-from-name name)
                      mode event))))
        (when files
                      (filesets-get-fileset-from-name name)
                      mode event))))
        (when files
@@ -1602,7 +1634,7 @@ Replace <file-name> or <<file-name>> with filename."
                (save-restriction
                  (let ((buffer (filesets-find-file this)))
                    (when buffer
                (save-restriction
                  (let ((buffer (filesets-find-file this)))
                    (when buffer
-                     (beginning-of-buffer)
+                     (goto-char (point-min))
                      (let ()
                        (cond
                         ((stringp fn)
                      (let ()
                        (cond
                         ((stringp fn)
@@ -1617,7 +1649,7 @@ Replace <file-name> or <<file-name>> with filename."
                                                       (if (equal txt "") "" " ")
                                                       (format "%s" this))))))))
                                 (cmd (concat fn " " args)))
                                                       (if (equal txt "") "" " ")
                                                       (format "%s" this))))))))
                                 (cmd (concat fn " " args)))
-                           (filesets-cmd-show-result 
+                           (filesets-cmd-show-result
                             cmd (shell-command-to-string cmd))))
                         ((symbolp fn)
                          (let ((args
                             cmd (shell-command-to-string cmd))))
                         ((symbolp fn)
                          (let ((args
@@ -1763,16 +1795,26 @@ User will be queried, if no fileset name is provided."
         (name   (or name
                     (completing-read
                      (format "Add '%s' to fileset: " buffer)
         (name   (or name
                     (completing-read
                      (format "Add '%s' to fileset: " buffer)
-                     filesets-data nil t)))
-        (entry  (assoc name filesets-data)))
+                     filesets-data nil)))
+         (entry  (or (assoc name filesets-data)
+                     (when (y-or-n-p
+                            (format "Fileset %s does not exist. Create it?"
+                                    name))
+                       (progn
+      (add-to-list 'filesets-data (list name '(:files)))
+      (message
+       "Fileset %s created.  Call `M-x filesets-save-config' to save."
+       name)
+      (car filesets-data))))))
     (if entry
        (let* ((files  (filesets-entry-get-files entry))
               (this   (buffer-file-name buffer))
     (if entry
        (let* ((files  (filesets-entry-get-files entry))
               (this   (buffer-file-name buffer))
-              (inlist (member* this files :test 'filesets-files-equalp)))
+              (inlist (filesets-member this files
+                                       :test 'filesets-files-equalp)))
          (cond
           (inlist
            (message "Filesets: '%s' is already in '%s'" this name))
          (cond
           (inlist
            (message "Filesets: '%s' is already in '%s'" this name))
-          ((and (equal (filesets-entry-mode entry) ':files) 
+          ((and (equal (filesets-entry-mode entry) ':files)
                 this)
            (filesets-entry-set-files entry (cons this files) t)
            (filesets-set-config name 'filesets-data filesets-data))
                 this)
            (filesets-entry-set-files entry (cons this files) t)
            (filesets-set-config name 'filesets-data filesets-data))
@@ -1793,7 +1835,8 @@ User will be queried, if no fileset name is provided."
     (if entry
        (let* ((files  (filesets-entry-get-files entry))
               (this   (buffer-file-name buffer))
     (if entry
        (let* ((files  (filesets-entry-get-files entry))
               (this   (buffer-file-name buffer))
-              (inlist (member* this files :test 'filesets-files-equalp)))
+              (inlist (filesets-member this files
+                                       :test 'filesets-files-equalp)))
          ;;(message "%s %s %s" files this inlist)
          (if (and files this inlist)
              (let ((new (list (cons ':files (delete (car inlist) files)))))
          ;;(message "%s %s %s" files this inlist)
          (if (and files this inlist)
              (let ((new (list (cons ':files (delete (car inlist) files)))))
@@ -1882,7 +1925,7 @@ User will be queried, if no fileset name is provided."
                                                 (if (null (cdr x))
                                                     ""
                                                   ", "))))
                                                 (if (null (cdr x))
                                                     ""
                                                   ", "))))
-                                 (setq rv 
+                                 (setq rv
                                        (concat
                                         rv
                                         (if filesets-menu-shortcuts-flag
                                        (concat
                                         rv
                                         (if filesets-menu-shortcuts-flag
@@ -1957,11 +2000,11 @@ LOOKUP-NAME is used as lookup name for retrieving fileset specific settings."
                      (and (stringp a)
                           (stringp b)
                           (string-match a b))))))
                      (and (stringp a)
                           (stringp b)
                           (string-match a b))))))
-    (some (lambda (x)
-           (if (funcall fn (car x) masterfile)
-               (nth pos x)
-             nil))
-         filesets-ingroup-patterns)))
+    (filesets-some (lambda (x)
+                    (if (funcall fn (car x) masterfile)
+                        (nth pos x)
+                      nil))
+                  filesets-ingroup-patterns)))
 
 (defun filesets-ingroup-get-pattern (master)
   "Access to `filesets-ingroup-patterns'.  Extract patterns."
 
 (defun filesets-ingroup-get-pattern (master)
   "Access to `filesets-ingroup-patterns'.  Extract patterns."
@@ -2023,8 +2066,8 @@ LOOKUP-NAME is used as lookup name for retrieving fileset specific settings."
               ((not this-patt)
                (filesets-error 'error "Filesets: malformed :ingroup definition "
                                this-def))
               ((not this-patt)
                (filesets-error 'error "Filesets: malformed :ingroup definition "
                                this-def))
-              ((<= this-sd 0)
-               (setq rv (nconc rv `(((,master ,this-name))))))
+              ((< this-sd 0)
+               nil)
               (t
                (with-temp-buffer
                  (insert-file-contents master)
               (t
                (with-temp-buffer
                  (insert-file-contents master)
@@ -2037,8 +2080,8 @@ LOOKUP-NAME is used as lookup name for retrieving fileset specific settings."
                      (when (and f
                                 (not (member f flist))
                                 (or (not remdupl-flag)
                      (when (and f
                                 (not (member f flist))
                                 (or (not remdupl-flag)
-                                    (not (member*
-                                          f filesets-ingroup-paths
+                                    (not (filesets-member
+                                          f filesets-ingroup-files
                                           :test 'filesets-files-equalp))))
                        (let ((no-stub-flag
                               (and (not this-stub-flag)
                                           :test 'filesets-files-equalp))))
                        (let ((no-stub-flag
                               (and (not this-stub-flag)
@@ -2047,8 +2090,8 @@ LOOKUP-NAME is used as lookup name for retrieving fileset specific settings."
                                      t))))
                          (setq count (+ count 1))
                          (setq flist (cons f flist))
                                      t))))
                          (setq count (+ count 1))
                          (setq flist (cons f flist))
-                         (setq filesets-ingroup-paths
-                               (cons f filesets-ingroup-paths))
+                         (setq filesets-ingroup-files
+                               (cons f filesets-ingroup-files))
                          (when no-stub-flag
                            (filesets-ingroup-cache-put master f))
                          (setq lst (append lst (list f))))))))
                          (when no-stub-flag
                            (filesets-ingroup-cache-put master f))
                          (setq lst (append lst (list f))))))))
@@ -2088,7 +2131,7 @@ FS is a fileset's name. FLIST is a list returned by
                (append rv
                        (if files
                            `((,nm
                (append rv
                        (if files
                            `((,nm
-                              [,(concat "Inclusion Group: " 
+                              [,(concat "Inclusion Group: "
                                         (file-name-nondirectory master))
                                (filesets-open ':ingroup ',master ',fsn)]
                               "---"
                                         (file-name-nondirectory master))
                                (filesets-open ':ingroup ',master ',fsn)]
                               "---"
@@ -2098,7 +2141,7 @@ FS is a fileset's name. FLIST is a list returned by
                                   (mapcar
                                    (lambda (this)
                                      (setq count (+ count 1))
                                   (mapcar
                                    (lambda (this)
                                      (setq count (+ count 1))
-                                     (let ((ff (filesets-ingroup-collect-build-menu 
+                                     (let ((ff (filesets-ingroup-collect-build-menu
                                                 fs (list this) count)))
                                        (if (= (length ff) 1)
                                            (car ff)
                                                 fs (list this) count)))
                                        (if (= (length ff) 1)
                                            (car ff)
@@ -2119,7 +2162,7 @@ FS is a fileset's name. FLIST is a list returned by
   "Build a :ingroup submenu for file MASTER."
   (if (file-readable-p master)
       (let ((remdupl-flag  (filesets-ingroup-get-remdupl-p master)))
   "Build a :ingroup submenu for file MASTER."
   (if (file-readable-p master)
       (let ((remdupl-flag  (filesets-ingroup-get-remdupl-p master)))
-       (setq filesets-ingroup-paths (list master))
+       (setq filesets-ingroup-files (list master))
        (filesets-ingroup-collect lookup-name remdupl-flag master))
     (if filesets-be-docile-flag
        (progn
        (filesets-ingroup-collect lookup-name remdupl-flag master))
     (if filesets-be-docile-flag
        (progn
@@ -2155,7 +2198,7 @@ FS is a fileset's name. FLIST is a list returned by
                           (let* ((x  (file-name-as-directory x))
                                  (xx (concat dir x))
                                  (dd (filesets-build-dir-submenu-now
                           (let* ((x  (file-name-as-directory x))
                                  (xx (concat dir x))
                                  (dd (filesets-build-dir-submenu-now
-                                      (+ level 1) depth entry 
+                                      (+ level 1) depth entry
                                       lookup-name xx patt fd))
                                  (nm (concat (filesets-get-shortcut count)
                                              x)))
                                       lookup-name xx patt fd))
                                  (nm (concat (filesets-get-shortcut count)
                                              x)))
@@ -2177,7 +2220,7 @@ FS is a fileset's name. FLIST is a list returned by
                 (append
                  dirsmenu
                  filesmenu))
                 (append
                  dirsmenu
                  filesmenu))
-               (filesets-get-menu-epilog `(,dir ,patt) ':tree 
+               (filesets-get-menu-epilog `(,dir ,patt) ':tree
                                          lookup-name rebuild-flag)))
     nil))
 
                                          lookup-name rebuild-flag)))
     nil))
 
@@ -2300,7 +2343,7 @@ bottom up, set `filesets-submenus' to nil, first.)"
       (filesets-menu-cache-file-save-maybe)))
   (let ((cb (current-buffer)))
     (when (not (member cb filesets-updated-buffers))
       (filesets-menu-cache-file-save-maybe)))
   (let ((cb (current-buffer)))
     (when (not (member cb filesets-updated-buffers))
-      (filesets-add-submenu
+      (add-submenu
        filesets-menu-path
        `(,filesets-menu-name
         ("# Filesets"
        filesets-menu-path
        `(,filesets-menu-name
         ("# Filesets"
@@ -2317,7 +2360,8 @@ bottom up, set `filesets-submenus' to nil, first.)"
        filesets-menu-in-menu)
       (setq filesets-updated-buffers
            (cons cb filesets-updated-buffers))
        filesets-menu-in-menu)
       (setq filesets-updated-buffers
            (cons cb filesets-updated-buffers))
-      (message nil)
+      ;; This wipes out other messages in the echo area.
+      ;; (message nil)
       ;;(message "Filesets updated: %s" cb)
       )))
 
       ;;(message "Filesets updated: %s" cb)
       )))
 
@@ -2352,7 +2396,7 @@ fileset thinks this is necessary or not."
     (with-temp-buffer
       (dolist (this filesets-menu-cache-contents)
        (if (get this 'custom-type)
     (with-temp-buffer
       (dolist (this filesets-menu-cache-contents)
        (if (get this 'custom-type)
-           (progn 
+           (progn
              (insert (format "(setq-default %s '%S)" this (eval this)))
              (when filesets-menu-ensure-use-cached
                (newline)
              (insert (format "(setq-default %s '%S)" this (eval this)))
              (when filesets-menu-ensure-use-cached
                (newline)
@@ -2403,7 +2447,7 @@ transform all entries as shown in this example:
        \(\"Test\" (:pattern \"~/dir/^pattern$\"))
        --> \(\"Test\" (:pattern \"~/dir/\" \"^pattern$\"))
 
        \(\"Test\" (:pattern \"~/dir/^pattern$\"))
        --> \(\"Test\" (:pattern \"~/dir/\" \"^pattern$\"))
 
-2. `filesets-data': Change all occurances of \":document\" to \":ingroup\":
+2. `filesets-data': Change all occurrences of \":document\" to \":ingroup\":
 
       \(\(\"Test\" \(:document \"~/dir/file\"))
       --> \(\(\"Test\" \(:ingroup \"~/dir/file\"))
 
       \(\(\"Test\" \(:document \"~/dir/file\"))
       --> \(\(\"Test\" \(:ingroup \"~/dir/file\"))
@@ -2456,6 +2500,7 @@ We apologize for the inconvenience."))
 (defun filesets-exit ()
   (filesets-menu-cache-file-save-maybe))
 
 (defun filesets-exit ()
   (filesets-menu-cache-file-save-maybe))
 
+;;;###autoload
 (defun filesets-init ()
   "Filesets initialization.
 Set up hooks, load the cache file -- if existing -- and build the menu."
 (defun filesets-init ()
   "Filesets initialization.
 Set up hooks, load the cache file -- if existing -- and build the menu."
@@ -2475,14 +2520,11 @@ Set up hooks, load the cache file -- if existing -- and build the menu."
     (filesets-build-menu)))
 
 
     (filesets-build-menu)))
 
 
-;;; run
-(filesets-init)
-
 (provide 'filesets)
 
 ;;; Local Variables:
 (provide 'filesets)
 
 ;;; Local Variables:
-;;; time-stamp-format:"%:y-%02m-%02d"
 ;;; sentence-end-double-space:t
 ;;; End:
 
 ;;; sentence-end-double-space:t
 ;;; End:
 
+;;; arch-tag: 2c03f85f-c3df-4cec-b0a3-b46fd5592d70
 ;;; filesets.el ends here
 ;;; filesets.el ends here