]> code.delx.au - gnu-emacs/blobdiff - lisp/emacs-lisp/bytecomp.el
* lisp/emacs-lisp/bytecomp.el (byte-compile-file): Use let.
[gnu-emacs] / lisp / emacs-lisp / bytecomp.el
index f5861550c9a79082fbdd44933c07bab53accfc41..5db1793a4077fe46e7007fd6d6b610656bb42f0c 100644 (file)
@@ -1594,7 +1594,9 @@ that already has a `.elc' file."
                    (setq directories (nconc directories (list source))))
                ;; It is an ordinary file.  Decide whether to compile it.
                (if (and (string-match emacs-lisp-file-regexp source)
+                       ;; The next 2 tests avoid compiling lock files
                         (file-readable-p source)
+                       (not (string-match "\\`\\.#" file))
                         (not (auto-save-file-name-p source))
                         (not (string-equal dir-locals-file
                                            (file-name-nondirectory source))))
@@ -1779,15 +1781,13 @@ The value is non-nil if there were no errors, nil if errors."
       (when byte-compile-verbose
        (message "Compiling %s..." filename))
       (setq byte-compiler-error-flag nil)
-      (setq byte-compile-level (1+ byte-compile-level))
       ;; It is important that input-buffer not be current at this call,
       ;; so that the value of point set in input-buffer
       ;; within byte-compile-from-buffer lingers in that buffer.
       (setq output-buffer
            (save-current-buffer
-             (unwind-protect
-                 (byte-compile-from-buffer input-buffer)
-               (setq byte-compile-level (1- byte-compile-level)))))
+             (let ((byte-compile-level (1+ byte-compile-level)))
+                (byte-compile-from-buffer input-buffer))))
       (if byte-compiler-error-flag
          nil
        (when byte-compile-verbose