diff options
| author | Richard M. Stallman | 1995-10-30 18:01:22 +0000 |
|---|---|---|
| committer | Richard M. Stallman | 1995-10-30 18:01:22 +0000 |
| commit | 9742dbc0eaf8d533c82850945e8b440b8ab752a0 (patch) | |
| tree | 1376bfd82cb4f0816b9221919bfa36b116553b31 | |
| parent | be010748989d2be1af4eaa5e602f4cf49d37bf26 (diff) | |
| download | emacs-9742dbc0eaf8d533c82850945e8b440b8ab752a0.tar.gz emacs-9742dbc0eaf8d533c82850945e8b440b8ab752a0.zip | |
(byte-recompile-directory): New arg FORCE.
(byte-force-recompile): New function.
| -rw-r--r-- | lisp/emacs-lisp/bytecomp.el | 19 |
1 files changed, 16 insertions, 3 deletions
diff --git a/lisp/emacs-lisp/bytecomp.el b/lisp/emacs-lisp/bytecomp.el index 3a52413ecc6..f323d8262dc 100644 --- a/lisp/emacs-lisp/bytecomp.el +++ b/lisp/emacs-lisp/bytecomp.el | |||
| @@ -1122,7 +1122,13 @@ otherwise pop it") | |||
| 1122 | 1122 | ||
| 1123 | 1123 | ||
| 1124 | ;;;###autoload | 1124 | ;;;###autoload |
| 1125 | (defun byte-recompile-directory (directory &optional arg) | 1125 | (defun byte-force-recompile (directory) |
| 1126 | "Recompile every `.el' file in DIRECTORY that already has a `.elc' file. | ||
| 1127 | Files in subdirectories of DIRECTORY are processed also." | ||
| 1128 | (byte-recompile-directory directory nil t)) | ||
| 1129 | |||
| 1130 | ;;;###autoload | ||
| 1131 | (defun byte-recompile-directory (directory &optional arg force) | ||
| 1126 | "Recompile every `.el' file in DIRECTORY that needs recompilation. | 1132 | "Recompile every `.el' file in DIRECTORY that needs recompilation. |
| 1127 | This is if a `.elc' file exists but is older than the `.el' file. | 1133 | This is if a `.elc' file exists but is older than the `.el' file. |
| 1128 | Files in subdirectories of DIRECTORY are processed also. | 1134 | Files in subdirectories of DIRECTORY are processed also. |
| @@ -1132,7 +1138,10 @@ But a prefix argument (optional second arg) means ask user, | |||
| 1132 | for each such `.el' file, whether to compile it. Prefix argument 0 means | 1138 | for each such `.el' file, whether to compile it. Prefix argument 0 means |
| 1133 | don't ask and compile the file anyway. | 1139 | don't ask and compile the file anyway. |
| 1134 | 1140 | ||
| 1135 | A nonzero prefix argument also means ask about each subdirectory." | 1141 | A nonzero prefix argument also means ask about each subdirectory. |
| 1142 | |||
| 1143 | If the third argument FORCE is non-nil, | ||
| 1144 | recompile every `.el' file that already has a `.elc' file." | ||
| 1136 | (interactive "DByte recompile directory: \nP") | 1145 | (interactive "DByte recompile directory: \nP") |
| 1137 | (if arg | 1146 | (if arg |
| 1138 | (setq arg (prefix-numeric-value arg))) | 1147 | (setq arg (prefix-numeric-value arg))) |
| @@ -1155,16 +1164,20 @@ A nonzero prefix argument also means ask about each subdirectory." | |||
| 1155 | (if (and (not (member (car files) '("." ".." "RCS" "CVS"))) | 1164 | (if (and (not (member (car files) '("." ".." "RCS" "CVS"))) |
| 1156 | (file-directory-p source) | 1165 | (file-directory-p source) |
| 1157 | (not (file-symlink-p source))) | 1166 | (not (file-symlink-p source))) |
| 1167 | ;; This file is a subdirectory. Handle them differently. | ||
| 1158 | (if (or (null arg) | 1168 | (if (or (null arg) |
| 1159 | (eq 0 arg) | 1169 | (eq 0 arg) |
| 1160 | (y-or-n-p (concat "Check " source "? "))) | 1170 | (y-or-n-p (concat "Check " source "? "))) |
| 1161 | (setq directories | 1171 | (setq directories |
| 1162 | (nconc directories (list source)))) | 1172 | (nconc directories (list source)))) |
| 1173 | ;; It is an ordinary file. Decide whether to compile it. | ||
| 1163 | (if (and (string-match emacs-lisp-file-regexp source) | 1174 | (if (and (string-match emacs-lisp-file-regexp source) |
| 1164 | (not (auto-save-file-name-p source)) | 1175 | (not (auto-save-file-name-p source)) |
| 1165 | (setq dest (byte-compile-dest-file source)) | 1176 | (setq dest (byte-compile-dest-file source)) |
| 1166 | (if (file-exists-p dest) | 1177 | (if (file-exists-p dest) |
| 1167 | (file-newer-than-file-p source dest) | 1178 | ;; File was already compiled. |
| 1179 | (or force (file-newer-than-file-p source dest)) | ||
| 1180 | ;; No compiled file exists yet. | ||
| 1168 | (and arg | 1181 | (and arg |
| 1169 | (or (eq 0 arg) | 1182 | (or (eq 0 arg) |
| 1170 | (y-or-n-p (concat "Compile " source "? ")))))) | 1183 | (y-or-n-p (concat "Compile " source "? ")))))) |