1 ;;; cus-dep.el --- Find customization dependencies.
3 ;; Copyright (C) 1997 Free Software Foundation, Inc.
5 ;; Author: Per Abrahamsen <abraham@dina.kvl.dk>
8 ;; This file is part of GNU Emacs.
10 ;; GNU Emacs is free software; you can redistribute it and/or modify
11 ;; it under the terms of the GNU General Public License as published by
12 ;; the Free Software Foundation; either version 2, or (at your option)
15 ;; GNU Emacs is distributed in the hope that it will be useful,
16 ;; but WITHOUT ANY WARRANTY; without even the implied warranty of
17 ;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
18 ;; GNU General Public License for more details.
20 ;; You should have received a copy of the GNU General Public License
21 ;; along with GNU Emacs; see the file COPYING. If not, write to the
22 ;; Free Software Foundation, Inc., 59 Temple Place - Suite 330,
23 ;; Boston, MA 02111-1307, USA.
28 (load-file "widget.el")
29 (load-file "custom.el")
30 (load-file "cus-face.el")
32 (defun custom-make-dependencies ()
33 "Batch function to extract custom dependencies from .el files.
34 Usage: emacs -batch -l ./cus-dep.el -f custom-make-dependencies"
35 (let ((enable-local-eval nil)
36 (files (directory-files "" nil "\\`[^=].*\\.el\\'" t))
39 (setq file (car files)
41 (message "Checking %s..." file)
42 (set-buffer (find-file-noselect file))
43 (goto-char (point-min))
44 (string-match "\\`\\(.*\\)\\.el\\'" file)
46 (let ((name (file-name-nondirectory (match-string 1 file))))
48 (let ((expr (read (current-buffer))))
49 (when (and (listp expr)
50 (memq (car expr) '(defcustom defface defgroup)))
52 (put (nth 1 expr) 'custom-where name)))))
54 (kill-buffer (current-buffer))))
55 (message "Generating cus-load.el...")
56 (find-file "cus-load.el")
59 ;;; cus-load.el --- automatically extracted custom dependencies
64 (mapatoms (lambda (symbol)
65 (let ((members (get symbol 'custom-group))
69 (setq item (car (car members))
71 where (get item 'custom-where))
72 (unless (or (null where)
76 (insert "(put '" (symbol-name symbol)
78 (prin1 where (current-buffer))
86 ;;; cus-load.el ends here\n")
88 (message "Generating cus-load.el...done"))
90 ;;; cus-dep.el ends here