[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Emacs-diffs] /srv/bzr/emacs/trunk r112540: Add option for cus-test.el t
From: |
Glenn Morris |
Subject: |
[Emacs-diffs] /srv/bzr/emacs/trunk r112540: Add option for cus-test.el to load all Lisp files |
Date: |
Fri, 10 May 2013 00:31:34 -0700 |
User-agent: |
Bazaar (2.6b2) |
------------------------------------------------------------
revno: 112540
committer: Glenn Morris <address@hidden>
branch nick: trunk
timestamp: Fri 2013-05-10 00:31:34 -0700
message:
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.
modified:
admin/ChangeLog
admin/cus-test.el
=== modified file 'admin/ChangeLog'
--- a/admin/ChangeLog 2013-05-09 06:09:39 +0000
+++ b/admin/ChangeLog 2013-05-10 07:31:34 +0000
@@ -1,3 +1,9 @@
+2013-05-10 Glenn Morris <address@hidden>
+
+ * 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.
+
2013-05-09 Glenn Morris <address@hidden>
* cus-test.el: No need to provide bbdb, bbdb-com any more.
=== modified file 'admin/cus-test.el'
--- a/admin/cus-test.el 2013-05-09 06:09:39 +0000
+++ b/admin/cus-test.el 2013-05-10 07:31:34 +0000
@@ -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 @@
(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 @@
(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 @@
(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:")
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- [Emacs-diffs] /srv/bzr/emacs/trunk r112540: Add option for cus-test.el to load all Lisp files,
Glenn Morris <=