jwiegley / emacs-async

Simple library for asynchronous processing in Emacs
GNU General Public License v3.0
832 stars 68 forks source link

cannot byte-compile file synchronically #49

Closed bixuanzju closed 9 years ago

bixuanzju commented 9 years ago

I have the following code in my emacs setup, which will regenerate .el file after saving:

  (defun my/init-hook ()
    "If the current buffer is 'emacs-init.org' the code-blocks
are tangled, and the tangled file is compiled."
    (when (equal (buffer-file-name) my-org-file)
      (async-start
       `(lambda ()
          (require 'org)
          (org-babel-tangle-file ,my-org-file)
          (byte-compile-file ,my-init-file))
       (lambda (result)
         (message "Tangled file compiled.")))))
  (add-hook 'after-save-hook 'my/init-hook))

The problem is, it never byte-compiles the generated file even though I have (byte-compile-file ,my-init-file) in the code.

jwiegley commented 9 years ago

What makes you think this is a problem with emacs-async? Have you tried doing other things in your async handler, like writing a debug string to a file?

bixuanzju commented 9 years ago

@jwiegley My bad. I have some problems in my setup.