Skip to content

Commit

Permalink
got it working again by moving the hook to inner block
Browse files Browse the repository at this point in the history
  • Loading branch information
Unknown committed Jan 21, 2021
1 parent bebfd65 commit 1588422
Showing 1 changed file with 7 additions and 8 deletions.
15 changes: 7 additions & 8 deletions org-auto-tangle.el
Original file line number Diff line number Diff line change
Expand Up @@ -83,14 +83,13 @@
"Automatically tangle org-mode files with the option #+auto_tangle: t."
:lighter "org-auto-tangle"

(add-hook 'org-mode-hook
(lambda ()
(when org-auto-tangle-mode
(add-hook 'after-save-hook
(lambda () (when (and (org-auto-tangle-find-value (current-buffer))
(not (string= (org-auto-tangle-find-value(current-buffer)) "nil")))
(org-auto-tangle-async (buffer-file-name))))
nil 'local)))))
(when org-auto-tangle-mode
(add-hook 'org-mode-hook
(add-hook 'after-save-hook
(lambda () (when (and (org-auto-tangle-find-value (current-buffer))
(not (string= (org-auto-tangle-find-value(current-buffer)) "nil")))
(org-auto-tangle-async (buffer-file-name)))))
nil 'local)))

(provide 'org-auto-tangle)

Expand Down

0 comments on commit 1588422

Please sign in to comment.