emacs-diffs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Emacs-diffs] /srv/bzr/emacs/emacs-24 r108311: * lisp/emacs-lisp/bytecom


From: Stefan Monnier
Subject: [Emacs-diffs] /srv/bzr/emacs/emacs-24 r108311: * lisp/emacs-lisp/bytecomp.el (byte-compile-root-dir): New var.
Date: Fri, 02 Nov 2012 02:21:14 -0000
User-agent: Bazaar (2.5.0)

------------------------------------------------------------
revno: 108311
committer: Stefan Monnier <address@hidden>
branch nick: trunk
timestamp: Sat 2012-05-19 14:28:32 -0400
message:
  * lisp/emacs-lisp/bytecomp.el (byte-compile-root-dir): New var.
  (byte-compile-warning-prefix, batch-byte-compile-file): Use it.
modified:
  lisp/ChangeLog
  lisp/emacs-lisp/bytecomp.el
=== modified file 'lisp/ChangeLog'
--- a/lisp/ChangeLog    2012-05-19 03:00:48 +0000
+++ b/lisp/ChangeLog    2012-05-19 18:28:32 +0000
@@ -1,3 +1,8 @@
+2012-05-19  Stefan Monnier  <address@hidden>
+
+       * emacs-lisp/bytecomp.el (byte-compile-root-dir): New var.
+       (byte-compile-warning-prefix, batch-byte-compile-file): Use it.
+
 2012-05-19  Jay Belanger  <address@hidden>
 
        * calc/calc.el (calc-ensure-consistent-units): New variable.

=== modified file 'lisp/emacs-lisp/bytecomp.el'
--- a/lisp/emacs-lisp/bytecomp.el       2012-05-03 02:39:23 +0000
+++ b/lisp/emacs-lisp/bytecomp.el       2012-05-19 18:28:32 +0000
@@ -1002,12 +1002,14 @@
 
 (defvar byte-compile-last-warned-form nil)
 (defvar byte-compile-last-logged-file nil)
+(defvar byte-compile-root-dir nil
+  "Directory relative to which file names in error messages are written.")
 
 ;; This is used as warning-prefix for the compiler.
 ;; It is always called with the warnings buffer current.
 (defun byte-compile-warning-prefix (level entry)
   (let* ((inhibit-read-only t)
-        (dir default-directory)
+        (dir (or byte-compile-root-dir default-directory))
         (file (cond ((stringp byte-compile-current-file)
                      (format "%s:" (file-relative-name
                                      byte-compile-current-file dir)))
@@ -4515,29 +4517,30 @@
     (kill-emacs (if error 1 0))))
 
 (defun batch-byte-compile-file (file)
-  (if debug-on-error
-      (byte-compile-file file)
-    (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)"
-                 ">>Error occurred processing %s: %s")
-               file
-               (get (car err) 'error-message)
-               (prin1-to-string (cdr err)))
-       nil))))
+  (let ((byte-compile-root-dir (or byte-compile-root-dir default-directory)))
+    (if debug-on-error
+        (byte-compile-file file)
+      (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)"
+                    ">>Error occurred processing %s: %s")
+                  file
+                  (get (car err) 'error-message)
+                  (prin1-to-string (cdr err)))
+         nil)))))
 
 (defun byte-compile-refresh-preloaded ()
   "Reload any Lisp file that was changed since Emacs was dumped.


reply via email to

[Prev in Thread] Current Thread [Next in Thread]