diff options
| author | Sam Steingold | 2001-10-29 17:26:26 +0000 |
|---|---|---|
| committer | Sam Steingold | 2001-10-29 17:26:26 +0000 |
| commit | d90a41e8ba1711e207e80fb6f18182c2645a8601 (patch) | |
| tree | f9083a808bba2d71115b8e4718e612b1b9cad4d0 | |
| parent | e2c2a3e2820068dfa251ea1d70ed67210224c162 (diff) | |
| download | emacs-d90a41e8ba1711e207e80fb6f18182c2645a8601.tar.gz emacs-d90a41e8ba1711e207e80fb6f18182c2645a8601.zip | |
(byte-recompile-directory): Report numbers of files skipped and failed too.
| -rw-r--r-- | lisp/ChangeLog | 6 | ||||
| -rw-r--r-- | lisp/emacs-lisp/bytecomp.el | 41 |
2 files changed, 30 insertions, 17 deletions
diff --git a/lisp/ChangeLog b/lisp/ChangeLog index b8fa90a90d6..8ac7a75476b 100644 --- a/lisp/ChangeLog +++ b/lisp/ChangeLog | |||
| @@ -1,3 +1,9 @@ | |||
| 1 | 2001-10-29 Sam Steingold <sds@gnu.org> | ||
| 2 | |||
| 3 | * emacs-lisp/bytecomp.el (byte-recompile-directory): Report | ||
| 4 | numbers of files skipped and failed too. | ||
| 5 | (byte-compile-file): Return 'no-byte-compile for skipped files. | ||
| 6 | |||
| 1 | 2001-10-29 Kai Gro,A_(Bjohann <Kai.Grossjohann@CS.Uni-Dortmund.DE> | 7 | 2001-10-29 Kai Gro,A_(Bjohann <Kai.Grossjohann@CS.Uni-Dortmund.DE> |
| 2 | 8 | ||
| 3 | * log-view.el (log-view-mode-map): Bind `M-n' and `M-p', not `M n' | 9 | * log-view.el (log-view-mode-map): Bind `M-n' and `M-p', not `M n' |
diff --git a/lisp/emacs-lisp/bytecomp.el b/lisp/emacs-lisp/bytecomp.el index a0144d5a74e..9e5007bfeaa 100644 --- a/lisp/emacs-lisp/bytecomp.el +++ b/lisp/emacs-lisp/bytecomp.el | |||
| @@ -10,7 +10,7 @@ | |||
| 10 | 10 | ||
| 11 | ;;; This version incorporates changes up to version 2.10 of the | 11 | ;;; This version incorporates changes up to version 2.10 of the |
| 12 | ;;; Zawinski-Furuseth compiler. | 12 | ;;; Zawinski-Furuseth compiler. |
| 13 | (defconst byte-compile-version "$Revision: 2.90 $") | 13 | (defconst byte-compile-version "$Revision: 2.91 $") |
| 14 | 14 | ||
| 15 | ;; This file is part of GNU Emacs. | 15 | ;; This file is part of GNU Emacs. |
| 16 | 16 | ||
| @@ -1266,6 +1266,8 @@ recompile every `.el' file that already has a `.elc' file." | |||
| 1266 | (save-some-buffers) | 1266 | (save-some-buffers) |
| 1267 | (force-mode-line-update)) | 1267 | (force-mode-line-update)) |
| 1268 | (let ((directories (list (expand-file-name directory))) | 1268 | (let ((directories (list (expand-file-name directory))) |
| 1269 | (skip-count 0) | ||
| 1270 | (fail-count 0) | ||
| 1269 | (file-count 0) | 1271 | (file-count 0) |
| 1270 | (dir-count 0) | 1272 | (dir-count 0) |
| 1271 | last-dir) | 1273 | last-dir) |
| @@ -1275,9 +1277,9 @@ recompile every `.el' file that already has a `.elc' file." | |||
| 1275 | (message "Checking %s..." directory) | 1277 | (message "Checking %s..." directory) |
| 1276 | (let ((files (directory-files directory)) | 1278 | (let ((files (directory-files directory)) |
| 1277 | source dest) | 1279 | source dest) |
| 1278 | (while files | 1280 | (dolist (file files) |
| 1279 | (setq source (expand-file-name (car files) directory)) | 1281 | (setq source (expand-file-name file directory)) |
| 1280 | (if (and (not (member (car files) '("." ".." "RCS" "CVS"))) | 1282 | (if (and (not (member file '("." ".." "RCS" "CVS"))) |
| 1281 | (file-directory-p source) | 1283 | (file-directory-p source) |
| 1282 | (not (file-symlink-p source))) | 1284 | (not (file-symlink-p source))) |
| 1283 | ;; This file is a subdirectory. Handle them differently. | 1285 | ;; This file is a subdirectory. Handle them differently. |
| @@ -1300,18 +1302,24 @@ recompile every `.el' file that already has a `.elc' file." | |||
| 1300 | (y-or-n-p (concat "Compile " source "? ")))))) | 1302 | (y-or-n-p (concat "Compile " source "? ")))))) |
| 1301 | (progn (if (and noninteractive (not byte-compile-verbose)) | 1303 | (progn (if (and noninteractive (not byte-compile-verbose)) |
| 1302 | (message "Compiling %s..." source)) | 1304 | (message "Compiling %s..." source)) |
| 1303 | (byte-compile-file source) | 1305 | (let ((res (byte-compile-file source))) |
| 1306 | (cond ((eq res 'no-byte-compile) | ||
| 1307 | (setq skip-count (1+ skip-count))) | ||
| 1308 | ((eq res t) | ||
| 1309 | (setq file-count (1+ file-count))) | ||
| 1310 | ((eq res nil) | ||
| 1311 | (setq fail-count (1+ fail-count))))) | ||
| 1304 | (or noninteractive | 1312 | (or noninteractive |
| 1305 | (message "Checking %s..." directory)) | 1313 | (message "Checking %s..." directory)) |
| 1306 | (setq file-count (1+ file-count)) | ||
| 1307 | (if (not (eq last-dir directory)) | 1314 | (if (not (eq last-dir directory)) |
| 1308 | (setq last-dir directory | 1315 | (setq last-dir directory |
| 1309 | dir-count (1+ dir-count))) | 1316 | dir-count (1+ dir-count))) |
| 1310 | ))) | 1317 | ))))) |
| 1311 | (setq files (cdr files)))) | ||
| 1312 | (setq directories (cdr directories)))) | 1318 | (setq directories (cdr directories)))) |
| 1313 | (message "Done (Total of %d file%s compiled%s)" | 1319 | (message "Done (Total of %d file%s compiled%s%s%s)" |
| 1314 | file-count (if (= file-count 1) "" "s") | 1320 | file-count (if (= file-count 1) "" "s") |
| 1321 | (if (> fail-count 0) (format ", %d failed" fail-count) "") | ||
| 1322 | (if (> skip-count 0) (format ", %d skipped" skip-count) "") | ||
| 1315 | (if (> dir-count 1) (format " in %d directories" dir-count) "")))) | 1323 | (if (> dir-count 1) (format " in %d directories" dir-count) "")))) |
| 1316 | 1324 | ||
| 1317 | ;;;###autoload | 1325 | ;;;###autoload |
| @@ -1319,7 +1327,7 @@ recompile every `.el' file that already has a `.elc' file." | |||
| 1319 | "Compile a file of Lisp code named FILENAME into a file of byte code. | 1327 | "Compile a file of Lisp code named FILENAME into a file of byte code. |
| 1320 | The output file's name is made by appending `c' to the end of FILENAME. | 1328 | The output file's name is made by appending `c' to the end of FILENAME. |
| 1321 | With prefix arg (noninteractively: 2nd arg), LOAD the file after compiling. | 1329 | With prefix arg (noninteractively: 2nd arg), LOAD the file after compiling. |
| 1322 | The value is t if there were no errors, nil if errors." | 1330 | The value is non-nil if there were no errors, nil if errors." |
| 1323 | ;; (interactive "fByte compile file: \nP") | 1331 | ;; (interactive "fByte compile file: \nP") |
| 1324 | (interactive | 1332 | (interactive |
| 1325 | (let ((file buffer-file-name) | 1333 | (let ((file buffer-file-name) |
| @@ -1389,7 +1397,7 @@ The value is t if there were no errors, nil if errors." | |||
| 1389 | (if (file-exists-p target-file) | 1397 | (if (file-exists-p target-file) |
| 1390 | (condition-case nil (delete-file target-file) (error nil))) | 1398 | (condition-case nil (delete-file target-file) (error nil))) |
| 1391 | ;; We successfully didn't compile this file. | 1399 | ;; We successfully didn't compile this file. |
| 1392 | t) | 1400 | 'no-byte-compile) |
| 1393 | (if byte-compile-verbose | 1401 | (if byte-compile-verbose |
| 1394 | (message "Compiling %s..." filename)) | 1402 | (message "Compiling %s..." filename)) |
| 1395 | (setq byte-compiler-error-flag nil) | 1403 | (setq byte-compiler-error-flag nil) |
| @@ -3557,17 +3565,16 @@ For example, invoke \"emacs -batch -f batch-byte-compile $emacs/ ~/*.el\"" | |||
| 3557 | (if (file-directory-p (expand-file-name (car command-line-args-left))) | 3565 | (if (file-directory-p (expand-file-name (car command-line-args-left))) |
| 3558 | (let ((files (directory-files (car command-line-args-left))) | 3566 | (let ((files (directory-files (car command-line-args-left))) |
| 3559 | source dest) | 3567 | source dest) |
| 3560 | (while files | 3568 | (dolist (file files) |
| 3561 | (if (and (string-match emacs-lisp-file-regexp (car files)) | 3569 | (if (and (string-match emacs-lisp-file-regexp file) |
| 3562 | (not (auto-save-file-name-p (car files))) | 3570 | (not (auto-save-file-name-p file)) |
| 3563 | (setq source (expand-file-name (car files) | 3571 | (setq source (expand-file-name file |
| 3564 | (car command-line-args-left))) | 3572 | (car command-line-args-left))) |
| 3565 | (setq dest (byte-compile-dest-file source)) | 3573 | (setq dest (byte-compile-dest-file source)) |
| 3566 | (file-exists-p dest) | 3574 | (file-exists-p dest) |
| 3567 | (file-newer-than-file-p source dest)) | 3575 | (file-newer-than-file-p source dest)) |
| 3568 | (if (null (batch-byte-compile-file source)) | 3576 | (if (null (batch-byte-compile-file source)) |
| 3569 | (setq error t))) | 3577 | (setq error t))))) |
| 3570 | (setq files (cdr files)))) | ||
| 3571 | (if (null (batch-byte-compile-file (car command-line-args-left))) | 3578 | (if (null (batch-byte-compile-file (car command-line-args-left))) |
| 3572 | (setq error t))) | 3579 | (setq error t))) |
| 3573 | (setq command-line-args-left (cdr command-line-args-left))) | 3580 | (setq command-line-args-left (cdr command-line-args-left))) |