aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRichard M. Stallman1993-05-18 03:32:00 +0000
committerRichard M. Stallman1993-05-18 03:32:00 +0000
commit189db1529013817757006e693d11062e77454bdd (patch)
tree505f81642a70d06400e2d2826703bafa422fe4f7
parent31c0dbab9216b93c4ac4a5b01460a1e806351f1a (diff)
downloademacs-189db1529013817757006e693d11062e77454bdd.tar.gz
emacs-189db1529013817757006e693d11062e77454bdd.zip
(byte-compile-file): Don't write output if error.
-rw-r--r--lisp/emacs-lisp/bytecomp.el73
1 files changed, 37 insertions, 36 deletions
diff --git a/lisp/emacs-lisp/bytecomp.el b/lisp/emacs-lisp/bytecomp.el
index 7c7a2f1c13b..93641897318 100644
--- a/lisp/emacs-lisp/bytecomp.el
+++ b/lisp/emacs-lisp/bytecomp.el
@@ -1158,42 +1158,43 @@ With prefix arg (noninteractively: 2nd arg), load the file after compiling."
1158 ;; so that the value of point set in input-buffer 1158 ;; so that the value of point set in input-buffer
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 (if byte-compiler-error-flag
1162 (kill-buffer input-buffer) 1162 nil
1163 (save-excursion 1163 (kill-buffer input-buffer)
1164 (set-buffer output-buffer) 1164 (save-excursion
1165 (goto-char (point-max)) 1165 (set-buffer output-buffer)
1166 (insert "\n") ; aaah, unix. 1166 (goto-char (point-max))
1167 (let ((vms-stmlf-recfm t)) 1167 (insert "\n") ; aaah, unix.
1168 (setq target-file (byte-compile-dest-file filename)) 1168 (let ((vms-stmlf-recfm t))
1169 ;; (or byte-compile-overwrite-file 1169 (setq target-file (byte-compile-dest-file filename))
1170 ;; (condition-case () 1170;;; (or byte-compile-overwrite-file
1171 ;; (delete-file target-file) 1171;;; (condition-case ()
1172 ;; (error nil))) 1172;;; (delete-file target-file)
1173 (if (file-writable-p target-file) 1173;;; (error nil)))
1174 (let ((kanji-flag nil)) ; for nemacs, from Nakagawa Takayuki 1174 (if (file-writable-p target-file)
1175 (write-region 1 (point-max) target-file)) 1175 (let ((kanji-flag nil)) ; for nemacs, from Nakagawa Takayuki
1176 ;; This is just to give a better error message than 1176 (write-region 1 (point-max) target-file))
1177 ;; write-region 1177 ;; This is just to give a better error message than
1178 (signal 'file-error 1178 ;; write-region
1179 (list "Opening output file" 1179 (signal 'file-error
1180 (if (file-exists-p target-file) 1180 (list "Opening output file"
1181 "cannot overwrite file" 1181 (if (file-exists-p target-file)
1182 "directory not writable or nonexistent") 1182 "cannot overwrite file"
1183 target-file))) 1183 "directory not writable or nonexistent")
1184 ;; (or byte-compile-overwrite-file 1184 target-file)))
1185 ;; (condition-case () 1185;;; (or byte-compile-overwrite-file
1186 ;; (set-file-modes target-file (file-modes filename)) 1186;;; (condition-case ()
1187 ;; (error nil))) 1187;;; (set-file-modes target-file (file-modes filename))
1188 ) 1188;;; (error nil)))
1189 (kill-buffer (current-buffer))) 1189 )
1190 (if (and byte-compile-generate-call-tree 1190 (kill-buffer (current-buffer)))
1191 (or (eq t byte-compile-generate-call-tree) 1191 (if (and byte-compile-generate-call-tree
1192 (y-or-n-p (format "Report call tree for %s? " filename)))) 1192 (or (eq t byte-compile-generate-call-tree)
1193 (save-excursion 1193 (y-or-n-p (format "Report call tree for %s? " filename))))
1194 (display-call-tree filename))) 1194 (save-excursion
1195 (if load 1195 (display-call-tree filename)))
1196 (load target-file)))) 1196 (if load
1197 (load target-file))))
1197 t) 1198 t)
1198 1199
1199;;(defun byte-compile-and-load-file (&optional filename) 1200;;(defun byte-compile-and-load-file (&optional filename)