From: Stefan Monnier Date: Wed, 14 Apr 2004 20:43:45 +0000 (+0000) Subject: (batch-byte-compile-file): Give a backtrace if requested. X-Git-Tag: ttn-vms-21-2-B4~6817 X-Git-Url: http://git.eshelyaron.com/gitweb/?a=commitdiff_plain;h=a080ff233cc81c42c70faa374ac0f016dd61db58;p=emacs.git (batch-byte-compile-file): Give a backtrace if requested. --- diff --git a/lisp/emacs-lisp/bytecomp.el b/lisp/emacs-lisp/bytecomp.el index 32d6694b060..43e0732104f 100644 --- a/lisp/emacs-lisp/bytecomp.el +++ b/lisp/emacs-lisp/bytecomp.el @@ -3966,27 +3966,29 @@ already up-to-date." (kill-emacs (if error 1 0)))) (defun batch-byte-compile-file (file) - (condition-case err + (if debug-on-error (byte-compile-file file) - (file-error - (message (if (cdr err) - ">>Error occurred processing %s: %s (%s)" + (condition-case err + (byte-compile-file file) + (file-error + (message (if (cdr err) + ">>Error occurred processing %s: %s (%s)" ">>Error occurred processing %s: %s") - file - (get (car err) 'error-message) - (prin1-to-string (cdr err))) - (let ((destfile (byte-compile-dest-file file))) - (if (file-exists-p destfile) - (delete-file destfile))) - nil) - (error - (message (if (cdr err) - ">>Error occurred processing %s: %s (%s)" + file + (get (car err) 'error-message) + (prin1-to-string (cdr err))) + (let ((destfile (byte-compile-dest-file file))) + (if (file-exists-p destfile) + (delete-file destfile))) + nil) + (error + (message (if (cdr err) + ">>Error occurred processing %s: %s (%s)" ">>Error occurred processing %s: %s") - file - (get (car err) 'error-message) - (prin1-to-string (cdr err))) - nil))) + file + (get (car err) 'error-message) + (prin1-to-string (cdr err))) + nil)))) ;;;###autoload (defun batch-byte-recompile-directory ()