diff options
author | Glenn Morris <rgm@gnu.org> | 2013-05-10 00:31:34 -0700 |
---|---|---|
committer | Glenn Morris <rgm@gnu.org> | 2013-05-10 00:31:34 -0700 |
commit | a3f276d8ffee80c17919aea509400767d800d4bb (patch) | |
tree | 80f68cbb808b27037718e58da15f637fdb090ee1 /admin/cus-test.el | |
parent | f71c50d026c228b41892135377aee84442ef755d (diff) | |
download | emacs-a3f276d8ffee80c17919aea509400767d800d4bb.tar.gz |
Add option for cus-test.el to load all Lisp files
* admin/cus-test.el (cus-test-libs-noloads): Add some files.
(cus-test-get-lisp-files): New function.
(cus-test-libs): Add option to load more/all Lisp files.
Diffstat (limited to 'admin/cus-test.el')
-rw-r--r-- | admin/cus-test.el | 33 |
1 files changed, 29 insertions, 4 deletions
diff --git a/admin/cus-test.el b/admin/cus-test.el index bce5f5da3cf..90fb40b77c2 100644 --- a/admin/cus-test.el +++ b/admin/cus-test.el @@ -100,7 +100,8 @@ "List of variables to disregard by `cus-test-apropos'.") ;; Loading dunnet in batch mode leads to a Dead end. -(defvar cus-test-libs-noloads '("play/dunnet.el") +(defvar cus-test-libs-noloads '("play/dunnet.el" "emulation/edt-mapper.el" + "loadup.el" "mail/blessmail.el") "List of files not to load by `cus-test-load-libs'. Names should be as they appear in loaddefs.el.") @@ -302,6 +303,22 @@ Don't load libraries in `cus-test-libs-noloads'." (push (buffer-substring (match-end 0) (line-end-position)) files)) files))) +(defun cus-test-get-lisp-files (&optional all) + "Return list of all Lisp files with defcustoms. +Optional argument ALL non-nil means list all Lisp files." + (let ((default-directory (expand-file-name "lisp/" source-directory)) + (msg "Finding files...")) + (message "%s" msg) + (prog1 + ;; Hack to remove leading "./". + (mapcar (lambda (e) (substring e 2)) + (apply 'process-lines find-program + "-name" "*.el" + (unless all + (list "-exec" grep-program + "-l" "^[ \t]*(defcustom" "{}" "+")))) + (message "%sdone" msg)))) + (defun cus-test-message (list) "Print the members of LIST line by line." (dolist (m list) (message "%s" m))) @@ -401,15 +418,21 @@ in the Emacs source directory." (cus-test-message cus-test-deps-errors)) (run-hooks 'cus-test-after-load-libs-hook)) -(defun cus-test-libs () +(defun cus-test-libs (&optional more) "Load the libraries with autoloads in separate processes. This function is useful to detect load problems of libraries. It is suitable for batch mode. E.g., invoke ./src/emacs -batch -l admin/cus-test.el -f cus-test-libs -in the Emacs source directory." +in the Emacs source directory. + +If optional argument MORE is \"defcustom\", load all files with defcustoms. +If it is \"all\", load all Lisp files." (interactive) + (and noninteractive + command-line-args-left + (setq more (pop command-line-args-left))) (cus-test-load-1 (let ((default-directory source-directory) (emacs (expand-file-name "src/emacs")) @@ -436,7 +459,9 @@ in the Emacs source directory." (error (push (cons file alpha) cus-test-libs-errors) (message "Error for %s: %s" file alpha))))) - (cus-test-get-autoload-deps)) + (if more + (cus-test-get-lisp-files (equal more "all")) + (cus-test-get-autoload-deps))) (message "Default directory: %s" default-directory) (when skipped (message "The following libraries were skipped:") |