]> code.delx.au - gnu-emacs-elpa/commitdiff
* async-bytecomp.el: Fix callback.
authorThierry Volpiatto <thierry.volpiatto@gmail.com>
Tue, 30 Sep 2014 05:36:24 +0000 (07:36 +0200)
committerThierry Volpiatto <thierry.volpiatto@gmail.com>
Tue, 30 Sep 2014 05:36:24 +0000 (07:36 +0200)
Now we use display-buffer, the buffer is not current, so use
with-current-buffer.

async-bytecomp.el

index 5279cb77e5b3ec538aa1dd3d812b245c9c7620cd..3c25df82eece30c7cfe68ba0f2be8a8f439873d8 100644 (file)
   (let ((call-back
          `(lambda (&optional ignore)
             (if (file-exists-p async-byte-compile-log-file)
-                (progn
-                  (display-buffer (get-buffer-create
-                                   byte-compile-log-buffer))
-                  (goto-char (point-max))
-                  (let ((inhibit-read-only t))
-                    (insert-file-contents async-byte-compile-log-file)
-                    (compilation-mode))
-                  (delete-file async-byte-compile-log-file)
-                  (let ((n 0))
+                (let ((buf (get-buffer-create byte-compile-log-buffer))
+                      (n 0))
+                  (with-current-buffer buf
+                    (goto-char (point-max))
+                    (let ((inhibit-read-only t))
+                      (insert-file-contents async-byte-compile-log-file)
+                      (compilation-mode))
+                    (display-buffer buf)
+                    (delete-file async-byte-compile-log-file)
                     (save-excursion
                       (goto-char (point-min))
                       (while (re-search-forward "^.*:Error:" nil t)
-                        (incf n)))
-                    (if (> n 0)
-                        (message "Failed to compile %d files in directory `%s'" n ,directory)
-                        (message "Directory `%s' compiled asynchronously with warnings" ,directory))))
-                  (message "Directory `%s' compiled asynchronously with success" ,directory)))))
+                        (incf n))))
+                  (if (> n 0)
+                      (message "Failed to compile %d files in directory `%s'" n ,directory)
+                    (message "Directory `%s' compiled asynchronously with warnings" ,directory)))
+              (message "Directory `%s' compiled asynchronously with success" ,directory)))))
     (async-start
      `(lambda ()
         (require 'bytecomp)