From 832d146adb888974ed181147ca87bb49f371e79a Mon Sep 17 00:00:00 2001 From: jao Date: Mon, 24 May 2021 06:37:46 +0100 Subject: lexical tangling and optional loading --- readme.org | 16 ++++++++++------ 1 file changed, 10 insertions(+), 6 deletions(-) (limited to 'readme.org') diff --git a/readme.org b/readme.org index 3a09675..4e0add8 100644 --- a/readme.org +++ b/readme.org @@ -1,5 +1,5 @@ #+title: Emacs configuration and personal packages -#+property: header-args :tangle ~/.emacs.d/init.el :comments yes :results silent +#+property: header-args :tangle ~/.emacs.d/init.el :comments no :results silent #+auto_tangle: t * Bootstrap @@ -34,7 +34,7 @@ (package-initialize) #+end_src - and a tangling helper: + and a couple of tangling helper: #+begin_src emacs-lisp (defun jao-maybe-tangle (basename) @@ -44,15 +44,20 @@ (require 'ob-tangle) (org-babel-tangle-file org el)) el)) + + (defun jao-load-org (file) + (let ((b (file-name-sans-extension file))) + (if (require 'literate-elisp nil t) + (let ((file (format "%s.org" b))) + (literate-elisp-load-file (expand-file-name file jao-emacs-dir))) + (load-file (jao-maybe-tangle b))))) #+end_src Finally, we load either init.org or its tangled version from ~jao-emacs-dir~: #+begin_src emacs-lisp - (if (require 'literate-elisp nil t) - (literate-elisp-load-file (expand-file-name "init.org" jao-emacs-dir)) - (load-file (jao-maybe-tangle "init"))) + (jao-load-org "init") #+end_src You can tangle this readme to generate the minimal init.el file above. @@ -68,7 +73,6 @@ - [[./email.org][email.org]]: generic email handling in emacs. - [[./gnus.org][gnus.org]]: tangled to gnus.el automatically by init.org, so that it's ready for loading by Gnus. -- [[./w3m.org][w3m.org]]: browsing with emacs-w3m. - [[./eww.org][eww.org]]: browsing with eww. - [[./exwm.org][exwm.org]]: configuration for exwm, loaded when ~jao-exwmn-enable~ is called. -- cgit v1.2.3