diff options
| author | Richard M. Stallman | 1997-05-12 00:46:59 +0000 |
|---|---|---|
| committer | Richard M. Stallman | 1997-05-12 00:46:59 +0000 |
| commit | efbdca1221b4bd334c82d0f137dbe255cd2b708c (patch) | |
| tree | f13128bfdb18349d23c78675d247c64ac4dff99f | |
| parent | ff45a04da5ec553a92fb3fd3174fc4f0b98a3c52 (diff) | |
| download | emacs-efbdca1221b4bd334c82d0f137dbe255cd2b708c.tar.gz emacs-efbdca1221b4bd334c82d0f137dbe255cd2b708c.zip | |
(custom-make-dependencies): Don't find the subdirs here;
instead, use the dirs specified on the command line.
| -rw-r--r-- | lisp/cus-dep.el | 64 |
1 files changed, 19 insertions, 45 deletions
diff --git a/lisp/cus-dep.el b/lisp/cus-dep.el index a733da89d79..ee18ee597e2 100644 --- a/lisp/cus-dep.el +++ b/lisp/cus-dep.el | |||
| @@ -30,40 +30,12 @@ | |||
| 30 | 30 | ||
| 31 | (defun custom-make-dependencies () | 31 | (defun custom-make-dependencies () |
| 32 | "Batch function to extract custom dependencies from .el files. | 32 | "Batch function to extract custom dependencies from .el files. |
| 33 | Usage: emacs -batch -l ./cus-dep.el -f custom-make-dependencies" | 33 | Usage: emacs -batch -l ./cus-dep.el -f custom-make-dependencies DIRS" |
| 34 | (let ((enable-local-eval nil) | 34 | (let ((enable-local-eval nil) |
| 35 | all-subdirs pending | 35 | (all-subdirs command-line-args-left) |
| 36 | (start-directory default-directory)) | 36 | (start-directory default-directory)) |
| 37 | (get-buffer-create " cus-dep temp") | 37 | (get-buffer-create " cus-dep temp") |
| 38 | (set-buffer " cus-dep temp") | 38 | (set-buffer " cus-dep temp") |
| 39 | (setq pending '(".")) | ||
| 40 | (while pending | ||
| 41 | (let ((this (car pending)) | ||
| 42 | this-subdirs | ||
| 43 | default-directory) | ||
| 44 | (setq all-subdirs (cons this all-subdirs)) | ||
| 45 | (setq pending (cdr pending)) | ||
| 46 | (setq default-directory | ||
| 47 | (expand-file-name this start-directory)) | ||
| 48 | (message "Finding subdirs of %s" this) | ||
| 49 | (erase-buffer) | ||
| 50 | (condition-case nil | ||
| 51 | (progn | ||
| 52 | (insert-file-contents "subdirs.el") | ||
| 53 | (goto-char (point-min)) | ||
| 54 | (search-forward "'(") | ||
| 55 | (forward-char -1) | ||
| 56 | (setq this-subdirs (read (current-buffer))) | ||
| 57 | (setq pending (nconc pending | ||
| 58 | (mapcar | ||
| 59 | (function (lambda (dir) | ||
| 60 | (file-relative-name | ||
| 61 | (file-name-as-directory | ||
| 62 | (expand-file-name dir this)) | ||
| 63 | start-directory))) | ||
| 64 | this-subdirs)))) | ||
| 65 | (error nil)))) | ||
| 66 | |||
| 67 | (while all-subdirs | 39 | (while all-subdirs |
| 68 | (message "Directory %s" (car all-subdirs)) | 40 | (message "Directory %s" (car all-subdirs)) |
| 69 | (let ((files (directory-files (car all-subdirs) nil "\\`[^=].*\\.el\\'")) | 41 | (let ((files (directory-files (car all-subdirs) nil "\\`[^=].*\\.el\\'")) |
| @@ -73,20 +45,21 @@ Usage: emacs -batch -l ./cus-dep.el -f custom-make-dependencies" | |||
| 73 | (while files | 45 | (while files |
| 74 | (setq file (car files) | 46 | (setq file (car files) |
| 75 | files (cdr files)) | 47 | files (cdr files)) |
| 76 | (message "Checking %s..." file) | 48 | (when (file-exists-p file) |
| 77 | (erase-buffer) | 49 | (message "Checking %s..." file) |
| 78 | (insert-file-contents file) | 50 | (erase-buffer) |
| 79 | (goto-char (point-min)) | 51 | (insert-file-contents file) |
| 80 | (string-match "\\`\\(.*\\)\\.el\\'" file) | 52 | (goto-char (point-min)) |
| 81 | (let ((name (file-name-nondirectory (match-string 1 file)))) | 53 | (string-match "\\`\\(.*\\)\\.el\\'" file) |
| 82 | (condition-case nil | 54 | (let ((name (file-name-nondirectory (match-string 1 file)))) |
| 83 | (while (re-search-forward "^(defcustom\\|^(defface\\|^(defgroup" | 55 | (condition-case nil |
| 84 | nil t) | 56 | (while (re-search-forward "^(defcustom\\|^(defface\\|^(defgroup" |
| 85 | (beginning-of-line) | 57 | nil t) |
| 86 | (let ((expr (read (current-buffer)))) | 58 | (beginning-of-line) |
| 87 | (eval expr) | 59 | (let ((expr (read (current-buffer)))) |
| 88 | (put (nth 1 expr) 'custom-where name))) | 60 | (eval expr) |
| 89 | (error nil)))) | 61 | (put (nth 1 expr) 'custom-where name))) |
| 62 | (error nil))))) | ||
| 90 | (setq all-subdirs (cdr all-subdirs))))) | 63 | (setq all-subdirs (cdr all-subdirs))))) |
| 91 | (message "Generating cus-load.el...") | 64 | (message "Generating cus-load.el...") |
| 92 | (find-file "cus-load.el") | 65 | (find-file "cus-load.el") |
| @@ -122,6 +95,7 @@ Usage: emacs -batch -l ./cus-dep.el -f custom-make-dependencies" | |||
| 122 | ;;; cus-load.el ends here\n") | 95 | ;;; cus-load.el ends here\n") |
| 123 | (let ((kept-new-versions 10000000)) | 96 | (let ((kept-new-versions 10000000)) |
| 124 | (save-buffer)) | 97 | (save-buffer)) |
| 125 | (message "Generating cus-load.el...done")) | 98 | (message "Generating cus-load.el...done") |
| 99 | (kill-emacs)) | ||
| 126 | 100 | ||
| 127 | ;;; cus-dep.el ends here | 101 | ;;; cus-dep.el ends here |