diff --git a/docs/.dir-locals.el b/docs/.dir-locals.el index 95c3727..a1a020d 100644 --- a/docs/.dir-locals.el +++ b/docs/.dir-locals.el @@ -2,5 +2,4 @@ ;;; For more information see (info "(emacs) Directory Variables") ((org-mode . ((org-list-allow-alphabetical . nil) - (org-confirm-babel-evaluate . nil) - (eval . (add-hook 'after-save-hook #'org-babel-tangle))))) + (org-confirm-babel-evaluate . nil)))) diff --git a/docs/emacs/packages/org.org b/docs/emacs/packages/org.org index b087bb6..248d74d 100644 --- a/docs/emacs/packages/org.org +++ b/docs/emacs/packages/org.org @@ -1245,6 +1245,18 @@ which is really nice! However, most of my configuration will be stolen (org-present-mode-quit . my/org-present-quit))) #+end_src +** Tangle config org files on save +Something really, really useful is tangling all my configuration files +on save. For this, a dedicated function will do the trick. +#+begin_src emacs-lisp +(defun my/tangle-config-file () + (when (and (eq major-mode 'org-mode) + (f-ancestor-of-p (f-full "~/.nosync/org/config") default-directory)) + (org-babel-tangle))) + +(add-hook 'after-save-hook #'my/tangle-config-file) +#+end_src + ** Visual Configuration While most modes of Emacs are dedicated to development, and therefore are much more comfortable with a fixed-pitch font, more literary modes