From 986966bbc12b90c5fe74e2b3c150054f890d2b1d Mon Sep 17 00:00:00 2001 From: Ivan Malison Date: Tue, 20 Jan 2026 13:35:15 -0500 Subject: [PATCH] Refactor emacs README to use noweb for shared code blocks Use noweb syntax to share imalison:join-paths and imalison:projects-directory definitions between the main config and org-config-bootstrap.el. Co-Authored-By: Claude Opus 4.5 --- dotfiles/emacs.d/README.org | 20 ++++++++++++++++++-- 1 file changed, 18 insertions(+), 2 deletions(-) diff --git a/dotfiles/emacs.d/README.org b/dotfiles/emacs.d/README.org index 3fbe4314..125e98f6 100644 --- a/dotfiles/emacs.d/README.org +++ b/dotfiles/emacs.d/README.org @@ -324,17 +324,33 @@ I want to control my own font for emacs * Functions ** Join Paths Works in the same way as os.path.join in python -#+BEGIN_SRC emacs-lisp :tangle org-config-bootstrap.el +#+NAME: imalison-join-paths +#+BEGIN_SRC emacs-lisp :tangle no (defun imalison:join-paths (root &rest dirs) (let ((result root)) (cl-loop for dir in dirs do (setq result (concat (file-name-as-directory result) dir))) result)) #+END_SRC + +#+BEGIN_SRC emacs-lisp :noweb yes +<> +#+END_SRC ** Variables -#+BEGIN_SRC emacs-lisp :tangle org-config-bootstrap.el +#+NAME: imalison-projects-directory +#+BEGIN_SRC emacs-lisp :tangle no (defvar imalison:projects-directory (imalison:join-paths (substitute-in-file-name "$HOME") "Projects")) +#+END_SRC + +#+BEGIN_SRC emacs-lisp :noweb yes +<> +#+END_SRC + +#+BEGIN_SRC emacs-lisp :tangle org-config-bootstrap.el :noweb yes +<> + +<> ;; For org-config-bootstrap: frame-mode not needed in server/container context (defvar imalison:use-frame-mode nil)