# HG changeset patch # User Richard M. Stallman # Date 737695920 0 # Node ID b858b91dff3442bb9daf6514bc97e83b35c37197 # Parent 6ed299f80cbb5f4db80beb3e6da684212766d877 (byte-compile-file): Don't write output if error. diff -r 6ed299f80cbb -r b858b91dff34 lisp/emacs-lisp/bytecomp.el --- a/lisp/emacs-lisp/bytecomp.el Tue May 18 03:19:14 1993 +0000 +++ b/lisp/emacs-lisp/bytecomp.el Tue May 18 03:32:00 1993 +0000 @@ -1158,42 +1158,43 @@ ;; so that the value of point set in input-buffer ;; within byte-compile-from-buffer lingers in that buffer. (setq output-buffer (byte-compile-from-buffer input-buffer)) - (or byte-compiler-error-flag - (kill-buffer input-buffer) - (save-excursion - (set-buffer output-buffer) - (goto-char (point-max)) - (insert "\n") ; aaah, unix. - (let ((vms-stmlf-recfm t)) - (setq target-file (byte-compile-dest-file filename)) - ;; (or byte-compile-overwrite-file - ;; (condition-case () - ;; (delete-file target-file) - ;; (error nil))) - (if (file-writable-p target-file) - (let ((kanji-flag nil)) ; for nemacs, from Nakagawa Takayuki - (write-region 1 (point-max) target-file)) - ;; This is just to give a better error message than - ;; write-region - (signal 'file-error - (list "Opening output file" - (if (file-exists-p target-file) - "cannot overwrite file" - "directory not writable or nonexistent") - target-file))) - ;; (or byte-compile-overwrite-file - ;; (condition-case () - ;; (set-file-modes target-file (file-modes filename)) - ;; (error nil))) - ) - (kill-buffer (current-buffer))) - (if (and byte-compile-generate-call-tree - (or (eq t byte-compile-generate-call-tree) - (y-or-n-p (format "Report call tree for %s? " filename)))) - (save-excursion - (display-call-tree filename))) - (if load - (load target-file)))) + (if byte-compiler-error-flag + nil + (kill-buffer input-buffer) + (save-excursion + (set-buffer output-buffer) + (goto-char (point-max)) + (insert "\n") ; aaah, unix. + (let ((vms-stmlf-recfm t)) + (setq target-file (byte-compile-dest-file filename)) +;;; (or byte-compile-overwrite-file +;;; (condition-case () +;;; (delete-file target-file) +;;; (error nil))) + (if (file-writable-p target-file) + (let ((kanji-flag nil)) ; for nemacs, from Nakagawa Takayuki + (write-region 1 (point-max) target-file)) + ;; This is just to give a better error message than + ;; write-region + (signal 'file-error + (list "Opening output file" + (if (file-exists-p target-file) + "cannot overwrite file" + "directory not writable or nonexistent") + target-file))) +;;; (or byte-compile-overwrite-file +;;; (condition-case () +;;; (set-file-modes target-file (file-modes filename)) +;;; (error nil))) + ) + (kill-buffer (current-buffer))) + (if (and byte-compile-generate-call-tree + (or (eq t byte-compile-generate-call-tree) + (y-or-n-p (format "Report call tree for %s? " filename)))) + (save-excursion + (display-call-tree filename))) + (if load + (load target-file)))) t) ;;(defun byte-compile-and-load-file (&optional filename)