I have an org-file called Emacs.org which tangles to an init.el. I notice that if I take an installed package and set the elisp code to tangle: no
, it disappears from the init.el. However the package still exists in my elpa directory and it is accessible to me through M-x
. Doesn’t work, but it shows up in the command-list. Annoying. I have to delete the package from the elpa directory myself. Is this normal behavior or is my configuration missing something? Any help would be appreciated.
This is the code I am using for auto-tangling the org file on save. It is from the Emacs from Scratch series at System Crafters.
#+begin_src emacs-lisp
;; Automatically tangle our Emacs.org config file when we save it
(defun efs/org-babel-tangle-config ()
(when (string-equal (file-name-directory (buffer-file-name))
(expand-file-name user-emacs-directory))
;; Dynamic scoping to the rescue
(let ((org-confirm-babel-evaluate nil))
(org-babel-tangle))))
(add-hook 'org-mode-hook (lambda () (add-hook 'after-save-hook #'efs/org-babel-tangle-config)))
#+end_src