diff options
| author | Stefan Monnier | 2002-10-10 13:33:57 +0000 |
|---|---|---|
| committer | Stefan Monnier | 2002-10-10 13:33:57 +0000 |
| commit | 5188f2eb943cf6a5f08c0701c78486490e2f5c2b (patch) | |
| tree | c2d51270c428cd6aecc491438625f6ce815a7c51 | |
| parent | 87434e7a58dff62fb24c0fa123cd6f00b5569afd (diff) | |
| download | emacs-5188f2eb943cf6a5f08c0701c78486490e2f5c2b.tar.gz emacs-5188f2eb943cf6a5f08c0701c78486490e2f5c2b.zip | |
(custom-make-dependencies): Don't use find-file.
Use feature names rather than file names if applicable.
| -rw-r--r-- | lisp/cus-dep.el | 36 |
1 files changed, 17 insertions, 19 deletions
diff --git a/lisp/cus-dep.el b/lisp/cus-dep.el index d7fd848a9ab..5574cca82b9 100644 --- a/lisp/cus-dep.el +++ b/lisp/cus-dep.el | |||
| @@ -34,30 +34,29 @@ | |||
| 34 | (defun custom-make-dependencies () | 34 | (defun custom-make-dependencies () |
| 35 | "Batch function to extract custom dependencies from .el files. | 35 | "Batch function to extract custom dependencies from .el files. |
| 36 | Usage: emacs -batch -l ./cus-dep.el -f custom-make-dependencies DIRS" | 36 | Usage: emacs -batch -l ./cus-dep.el -f custom-make-dependencies DIRS" |
| 37 | (let ((enable-local-eval nil) | 37 | (let ((enable-local-eval nil)) |
| 38 | (all-subdirs command-line-args-left) | 38 | (set-buffer (get-buffer-create " cus-dep temp")) |
| 39 | (start-directory default-directory)) | 39 | (dolist (subdir command-line-args-left) |
| 40 | (get-buffer-create " cus-dep temp") | 40 | (message "Directory %s" subdir) |
| 41 | (set-buffer " cus-dep temp") | 41 | (let ((files (directory-files subdir nil "\\`[^=].*\\.el\\'")) |
| 42 | (while all-subdirs | 42 | (default-directory (expand-file-name subdir)) |
| 43 | (message "Directory %s" (car all-subdirs)) | ||
| 44 | (let ((files (directory-files (car all-subdirs) nil "\\`[^=].*\\.el\\'")) | ||
| 45 | (default-directory default-directory) | ||
| 46 | file | ||
| 47 | is-autoloaded) | 43 | is-autoloaded) |
| 48 | (cd (car all-subdirs)) | 44 | (dolist (file files) |
| 49 | (while files | ||
| 50 | (setq file (car files) | ||
| 51 | files (cdr files)) | ||
| 52 | (when (file-exists-p file) | 45 | (when (file-exists-p file) |
| 53 | (erase-buffer) | 46 | (erase-buffer) |
| 54 | (insert-file-contents file) | 47 | (insert-file-contents file) |
| 55 | (goto-char (point-min)) | 48 | (goto-char (point-min)) |
| 56 | (string-match "\\`\\(.*\\)\\.el\\'" file) | 49 | (string-match "\\`\\(.*\\)\\.el\\'" file) |
| 57 | (let ((name (file-name-nondirectory (match-string 1 file)))) | 50 | (let ((name (file-name-nondirectory (match-string 1 file)))) |
| 51 | (if (save-excursion | ||
| 52 | (re-search-forward | ||
| 53 | (concat "(provide[ \t\n]+\\('\\|(quote[ \t\n]\\)[ \t\n]*" | ||
| 54 | (regexp-quote name) "[ \t\n)]") | ||
| 55 | nil t)) | ||
| 56 | (setq name (intern name))) | ||
| 58 | (condition-case nil | 57 | (condition-case nil |
| 59 | (while (re-search-forward "^(defcustom\\|^(defface\\|^(defgroup" | 58 | (while (re-search-forward |
| 60 | nil t) | 59 | "^(def\\(custom\\|face\\|group\\)" nil t) |
| 61 | (setq is-autoloaded nil) | 60 | (setq is-autoloaded nil) |
| 62 | (beginning-of-line) | 61 | (beginning-of-line) |
| 63 | (save-excursion | 62 | (save-excursion |
| @@ -71,10 +70,9 @@ Usage: emacs -batch -l ./cus-dep.el -f custom-make-dependencies DIRS" | |||
| 71 | (put (nth 1 expr) 'custom-autoloaded is-autoloaded) | 70 | (put (nth 1 expr) 'custom-autoloaded is-autoloaded) |
| 72 | (put (nth 1 expr) 'custom-where name)) | 71 | (put (nth 1 expr) 'custom-where name)) |
| 73 | (error nil)))) | 72 | (error nil)))) |
| 74 | (error nil))))) | 73 | (error nil)))))))) |
| 75 | (setq all-subdirs (cdr all-subdirs))))) | ||
| 76 | (message "Generating cus-load.el...") | 74 | (message "Generating cus-load.el...") |
| 77 | (find-file "cus-load.el") | 75 | (set-buffer (find-file-noselect "cus-load.el")) |
| 78 | (erase-buffer) | 76 | (erase-buffer) |
| 79 | (insert "\ | 77 | (insert "\ |
| 80 | ;;; cus-load.el --- automatically extracted custom dependencies | 78 | ;;; cus-load.el --- automatically extracted custom dependencies |