diff options
author | Richard M. Stallman <rms@gnu.org> | 1993-05-18 03:32:00 +0000 |
---|---|---|
committer | Richard M. Stallman <rms@gnu.org> | 1993-05-18 03:32:00 +0000 |
commit | 189db1529013817757006e693d11062e77454bdd (patch) | |
tree | 505f81642a70d06400e2d2826703bafa422fe4f7 /lisp/emacs-lisp | |
parent | 31c0dbab9216b93c4ac4a5b01460a1e806351f1a (diff) | |
download | emacs-189db1529013817757006e693d11062e77454bdd.tar.gz emacs-189db1529013817757006e693d11062e77454bdd.tar.bz2 emacs-189db1529013817757006e693d11062e77454bdd.zip |
(byte-compile-file): Don't write output if error.
Diffstat (limited to 'lisp/emacs-lisp')
-rw-r--r-- | lisp/emacs-lisp/bytecomp.el | 73 |
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." ;; 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) |