Mercurial > emacs
view lisp/cus-dep.el @ 22477:9bc88c123895 gcc-2_8_1-980627 gcc-2_8_1-980705 gcc-2_8_1-980718 libc-980614 libc-980615 libc-980616 libc-980617 libc-980618 libc-980619 libc-980620 libc-980621 libc-980622 libc-980623 libc-980624 libc-980625 libc-980626 libc-980627 libc-980628 libc-980629 libc-980630 libc-980701 libc-980702 libc-980703 libc-980704 libc-980705 libc-980706 libc-980707 libc-980708 libc-980709 libc-980710 libc-980711 libc-980712 libc-980713 libc-980714 libc-980715 libc-980716 libc-980717 libc-980718 libc-980719
(sun4H:SunOS:5.*:*): New case.
author | Richard Kenner <kenner@gnu.org> |
---|---|
date | Sat, 13 Jun 1998 19:51:10 +0000 |
parents | 44c9237d9e52 |
children | 2649d061d370 |
line wrap: on
line source
;;; cus-dep.el --- Find customization dependencies. ;; ;; Copyright (C) 1997 Free Software Foundation, Inc. ;; ;; Author: Per Abrahamsen <abraham@dina.kvl.dk> ;; Keywords: internal ;; This file is part of GNU Emacs. ;; GNU Emacs 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) ;; any later version. ;; GNU Emacs is distributed in the hope that it will be useful, ;; but WITHOUT ANY WARRANTY; without even the implied warranty of ;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the ;; GNU General Public License for more details. ;; You should have received a copy of the GNU General Public License ;; along with GNU Emacs; see the file COPYING. If not, write to the ;; Free Software Foundation, Inc., 59 Temple Place - Suite 330, ;; Boston, MA 02111-1307, USA. ;;; Code: (require 'cl) (require 'widget) (require 'cus-face) (defun custom-make-dependencies () "Batch function to extract custom dependencies from .el files. Usage: emacs -batch -l ./cus-dep.el -f custom-make-dependencies DIRS" (let ((enable-local-eval nil) (all-subdirs command-line-args-left) (start-directory default-directory)) (get-buffer-create " cus-dep temp") (set-buffer " cus-dep temp") (while all-subdirs (message "Directory %s" (car all-subdirs)) (let ((files (directory-files (car all-subdirs) nil "\\`[^=].*\\.el\\'")) (default-directory default-directory) file) (cd (car all-subdirs)) (while files (setq file (car files) files (cdr files)) (when (file-exists-p file) (erase-buffer) (insert-file-contents file) (goto-char (point-min)) (string-match "\\`\\(.*\\)\\.el\\'" file) (let ((name (file-name-nondirectory (match-string 1 file)))) (condition-case nil (while (re-search-forward "^(defcustom\\|^(defface\\|^(defgroup" nil t) (beginning-of-line) (let ((expr (read (current-buffer)))) (condition-case nil (progn (eval expr) (put (nth 1 expr) 'custom-where name)) (error nil)))) (error nil))))) (setq all-subdirs (cdr all-subdirs))))) (message "Generating cus-load.el...") (find-file "cus-load.el") (erase-buffer) (insert "\ ;;; cus-load.el --- automatically extracted custom dependencies ;; ;;; Code: ") (mapatoms (lambda (symbol) (let ((members (get symbol 'custom-group)) item where found) (when members (while members (setq item (car (car members)) members (cdr members) where (get item 'custom-where)) (unless (or (null where) (member where found)) (if found (insert " ") (insert "(put '" (symbol-name symbol) " 'custom-loads '(")) (prin1 where (current-buffer)) (push where found))) (when found (insert "))\n")))))) (insert "\ \(provide 'cus-load) ;;; cus-load.el ends here\n") (let ((kept-new-versions 10000000)) (save-buffer)) (message "Generating cus-load.el...done") (kill-emacs)) ;;; cus-dep.el ends here