Mercurial > hg > xemacs-beta
comparison lisp/bytecomp.el @ 406:b8cc9ab3f761 r21-2-33
Import from CVS: tag r21-2-33
author | cvs |
---|---|
date | Mon, 13 Aug 2007 11:17:09 +0200 |
parents | 74fd4e045ea6 |
children | 697ef44129c6 |
comparison
equal
deleted
inserted
replaced
405:0e08f63c74d2 | 406:b8cc9ab3f761 |
---|---|
1353 ;;;###autoload | 1353 ;;;###autoload |
1354 (defun byte-force-recompile (directory) | 1354 (defun byte-force-recompile (directory) |
1355 "Recompile every `.el' file in DIRECTORY that already has a `.elc' file. | 1355 "Recompile every `.el' file in DIRECTORY that already has a `.elc' file. |
1356 Files in subdirectories of DIRECTORY are processed also." | 1356 Files in subdirectories of DIRECTORY are processed also." |
1357 (interactive "DByte force recompile (directory): ") | 1357 (interactive "DByte force recompile (directory): ") |
1358 (byte-recompile-directory directory nil t)) | 1358 (byte-recompile-directory directory nil nil t)) |
1359 | 1359 |
1360 ;;;###autoload | 1360 ;;;###autoload |
1361 (defun byte-recompile-directory (directory &optional arg norecursion force) | 1361 (defun byte-recompile-directory (directory &optional arg norecursion force) |
1362 "Recompile every `.el' file in DIRECTORY that needs recompilation. | 1362 "Recompile every `.el' file in DIRECTORY that needs recompilation. |
1363 This is if a `.elc' file exists but is older than the `.el' file. | 1363 This is if a `.elc' file exists but is older than the `.el' file. |
4035 (defvar command-line-args-left) ;Avoid 'free variable' warning | 4035 (defvar command-line-args-left) ;Avoid 'free variable' warning |
4036 (if (not noninteractive) | 4036 (if (not noninteractive) |
4037 (error "`batch-byte-compile' is to be used only with -batch")) | 4037 (error "`batch-byte-compile' is to be used only with -batch")) |
4038 (let ((error nil)) | 4038 (let ((error nil)) |
4039 (while command-line-args-left | 4039 (while command-line-args-left |
4040 (if (file-directory-p (expand-file-name (car command-line-args-left))) | 4040 (if (null (batch-byte-compile-one-file)) |
4041 (let ((files (directory-files (car command-line-args-left))) | 4041 (setq error t))) |
4042 source dest) | |
4043 (while files | |
4044 (if (and (string-match emacs-lisp-file-regexp (car files)) | |
4045 (not (auto-save-file-name-p (car files))) | |
4046 (setq source (expand-file-name | |
4047 (car files) | |
4048 (car command-line-args-left))) | |
4049 (setq dest (byte-compile-dest-file source)) | |
4050 (file-exists-p dest) | |
4051 (file-newer-than-file-p source dest)) | |
4052 (if (null (batch-byte-compile-1 source)) | |
4053 (setq error t))) | |
4054 (setq files (cdr files)))) | |
4055 (if (null (batch-byte-compile-1 (car command-line-args-left))) | |
4056 (setq error t))) | |
4057 (setq command-line-args-left (cdr command-line-args-left))) | |
4058 (message "Done") | 4042 (message "Done") |
4059 (kill-emacs (if error 1 0)))) | 4043 (kill-emacs (if error 1 0)))) |
4044 | |
4045 ;;;###autoload | |
4046 (defun batch-byte-compile-one-file () | |
4047 "Run `byte-compile-file' on a single file remaining on the command line. | |
4048 Use this from the command line, with `-batch'; | |
4049 it won't work in an interactive Emacs." | |
4050 ;; command-line-args-left is what is left of the command line (from | |
4051 ;; startup.el) | |
4052 (defvar command-line-args-left) ;Avoid 'free variable' warning | |
4053 (if (not noninteractive) | |
4054 (error "`batch-byte-compile-one-file' is to be used only with -batch")) | |
4055 (let (error | |
4056 (file-to-process (car command-line-args-left))) | |
4057 (setq command-line-args-left (cdr command-line-args-left)) | |
4058 (if (file-directory-p (expand-file-name file-to-process)) | |
4059 (let ((files (directory-files file-to-process)) | |
4060 source dest) | |
4061 (while files | |
4062 (if (and (string-match emacs-lisp-file-regexp (car files)) | |
4063 (not (auto-save-file-name-p (car files))) | |
4064 (setq source (expand-file-name | |
4065 (car files) | |
4066 file-to-process)) | |
4067 (setq dest (byte-compile-dest-file source)) | |
4068 (file-exists-p dest) | |
4069 (file-newer-than-file-p source dest)) | |
4070 (if (null (batch-byte-compile-1 source)) | |
4071 (setq error t))) | |
4072 (setq files (cdr files))) | |
4073 (null error)) | |
4074 (batch-byte-compile-1 file-to-process)))) | |
4060 | 4075 |
4061 (defun batch-byte-compile-1 (file) | 4076 (defun batch-byte-compile-1 (file) |
4062 (condition-case err | 4077 (condition-case err |
4063 (progn (byte-compile-file file) t) | 4078 (progn (byte-compile-file file) t) |
4064 (error | 4079 (error |