diff options
| author | Richard M. Stallman | 1993-05-18 02:30:21 +0000 |
|---|---|---|
| committer | Richard M. Stallman | 1993-05-18 02:30:21 +0000 |
| commit | c76f206519f9b3039b577b581f4f1245b1ef4b66 (patch) | |
| tree | d392d8367c2e0da253523088b8302517fc881e58 | |
| parent | 874bdb5a86c148bb33ecc51b74ae743cccaf7089 (diff) | |
| download | emacs-c76f206519f9b3039b577b581f4f1245b1ef4b66.tar.gz emacs-c76f206519f9b3039b577b581f4f1245b1ef4b66.zip | |
(byte-compile-file): Don't write output if error.
| -rw-r--r-- | lisp/emacs-lisp/bytecomp.el | 70 |
1 files changed, 35 insertions, 35 deletions
diff --git a/lisp/emacs-lisp/bytecomp.el b/lisp/emacs-lisp/bytecomp.el index 76a0712dcad..7c7a2f1c13b 100644 --- a/lisp/emacs-lisp/bytecomp.el +++ b/lisp/emacs-lisp/bytecomp.el | |||
| @@ -1159,41 +1159,41 @@ With prefix arg (noninteractively: 2nd arg), load the file after compiling." | |||
| 1159 | ;; within byte-compile-from-buffer lingers in that buffer. | 1159 | ;; within byte-compile-from-buffer lingers in that buffer. |
| 1160 | (setq output-buffer (byte-compile-from-buffer input-buffer)) | 1160 | (setq output-buffer (byte-compile-from-buffer input-buffer)) |
| 1161 | (or byte-compiler-error-flag | 1161 | (or byte-compiler-error-flag |
| 1162 | (kill-buffer input-buffer)) | 1162 | (kill-buffer input-buffer) |
| 1163 | (save-excursion | 1163 | (save-excursion |
| 1164 | (set-buffer output-buffer) | 1164 | (set-buffer output-buffer) |
| 1165 | (goto-char (point-max)) | 1165 | (goto-char (point-max)) |
| 1166 | (insert "\n") ; aaah, unix. | 1166 | (insert "\n") ; aaah, unix. |
| 1167 | (let ((vms-stmlf-recfm t)) | 1167 | (let ((vms-stmlf-recfm t)) |
| 1168 | (setq target-file (byte-compile-dest-file filename)) | 1168 | (setq target-file (byte-compile-dest-file filename)) |
| 1169 | ;; (or byte-compile-overwrite-file | 1169 | ;; (or byte-compile-overwrite-file |
| 1170 | ;; (condition-case () | 1170 | ;; (condition-case () |
| 1171 | ;; (delete-file target-file) | 1171 | ;; (delete-file target-file) |
| 1172 | ;; (error nil))) | 1172 | ;; (error nil))) |
| 1173 | (if (file-writable-p target-file) | 1173 | (if (file-writable-p target-file) |
| 1174 | (let ((kanji-flag nil)) ; for nemacs, from Nakagawa Takayuki | 1174 | (let ((kanji-flag nil)) ; for nemacs, from Nakagawa Takayuki |
| 1175 | (write-region 1 (point-max) target-file)) | 1175 | (write-region 1 (point-max) target-file)) |
| 1176 | ;; This is just to give a better error message than | 1176 | ;; This is just to give a better error message than |
| 1177 | ;; write-region | 1177 | ;; write-region |
| 1178 | (signal 'file-error | 1178 | (signal 'file-error |
| 1179 | (list "Opening output file" | 1179 | (list "Opening output file" |
| 1180 | (if (file-exists-p target-file) | 1180 | (if (file-exists-p target-file) |
| 1181 | "cannot overwrite file" | 1181 | "cannot overwrite file" |
| 1182 | "directory not writable or nonexistent") | 1182 | "directory not writable or nonexistent") |
| 1183 | target-file))) | 1183 | target-file))) |
| 1184 | ;; (or byte-compile-overwrite-file | 1184 | ;; (or byte-compile-overwrite-file |
| 1185 | ;; (condition-case () | 1185 | ;; (condition-case () |
| 1186 | ;; (set-file-modes target-file (file-modes filename)) | 1186 | ;; (set-file-modes target-file (file-modes filename)) |
| 1187 | ;; (error nil))) | 1187 | ;; (error nil))) |
| 1188 | ) | 1188 | ) |
| 1189 | (kill-buffer (current-buffer))) | 1189 | (kill-buffer (current-buffer))) |
| 1190 | (if (and byte-compile-generate-call-tree | 1190 | (if (and byte-compile-generate-call-tree |
| 1191 | (or (eq t byte-compile-generate-call-tree) | 1191 | (or (eq t byte-compile-generate-call-tree) |
| 1192 | (y-or-n-p (format "Report call tree for %s? " filename)))) | 1192 | (y-or-n-p (format "Report call tree for %s? " filename)))) |
| 1193 | (save-excursion | 1193 | (save-excursion |
| 1194 | (display-call-tree filename))) | 1194 | (display-call-tree filename))) |
| 1195 | (if load | 1195 | (if load |
| 1196 | (load target-file))) | 1196 | (load target-file)))) |
| 1197 | t) | 1197 | t) |
| 1198 | 1198 | ||
| 1199 | ;;(defun byte-compile-and-load-file (&optional filename) | 1199 | ;;(defun byte-compile-and-load-file (&optional filename) |