~protesilaos/basic-emacs

aeca20c17a1de45bd6c6e84099ed54c3a944604f — Protesilaos Stavrou 5 months ago b02f3ed
Arrange to auto-delete basic-emacs.el
1 files changed, 12 insertions(+), 0 deletions(-)

M init.el
M init.el => init.el +12 -0
@@ 2,3 2,15 @@
;; contains the actual configurations.  We thus empower the user to
;; manager their own setup.
(org-babel-load-file (locate-user-emacs-file "basic-emacs.org"))
    
(defun basic-emacs-remove-tangled-org-config ()
  "Delete basic-emacs.el.
Add this to the `kill-emacs-hook' so that the tangled file is
deleted after Emacs shuts down.  We do this to be sure that next
time we start Emacs, we have the Org file as the source of
truth (so possible errors/edits do not persist)."
  (when-let* ((file (locate-user-emacs-file "basic-emacs.el"))
              ((file-exists-p file)))
    (delete-file file)))

(add-hook 'kill-emacs-hook #'basic-emacs-remove-tangled-org-config)