From 887d87d6e05be297fec5674a798a6a2484100804 Mon Sep 17 00:00:00 2001 From: Case Duckworth Date: Thu, 28 Jan 2021 08:13:31 -0600 Subject: Tweak expand-file-name calls and acdw/reload --- config.org | 25 +++++++++++++------------ 1 file changed, 13 insertions(+), 12 deletions(-) diff --git a/config.org b/config.org index 906eaad..88ca3bd 100644 --- a/config.org +++ b/config.org @@ -2623,8 +2623,7 @@ my config here /logically/, while keeping the generated file organized (defun acdw/find-config () "Find `config.org'." (interactive) - (find-file (expand-file-name "config.org" - user-emacs-directory))) + (find-file (locate-user-emacs-file "config.org"))) #+end_src Bind it to =C-z i= because =C-z C-c= is taken for capture. @@ -2642,19 +2641,22 @@ Bind it to =C-z i= because =C-z C-c= is taken for capture. (defun acdw/reload () "Tangle and reload Emacs configuration." (interactive) - (let ((config (expand-file-name "config.org" - user-emacs-directory))) + (let ((config (locate-user-emacs-file "config.org"))) ;; tangle (with-current-buffer (find-file-noselect config) - (let ((prog-mode-hook nil)) - (add-to-list 'load-path (expand-file-name "straight/build/org/" - user-emacs-directory)) + (message "Tangling config.org...") + (let ((prog-mode-hook nil) + (inhibit-redisplay t) + (inhibit-message t)) + (add-to-list 'load-path (locate-user-emacs-file + "straight/build/org/")) (require 'org) (org-babel-tangle))) + (message "Tangling config.org... Done.") ;; load init files - (load (expand-file-name "early-init.el" user-emacs-directory)) - (byte-compile-file (expand-file-name "init.el" user-emacs-directory) :load) - (byte-compile-file (expand-file-name "config.el" user-emacs-directory) + (load (locate-user-emacs-file "early-init.el")) + (byte-compile-file (locate-user-emacs-file "init.el") :load) + (byte-compile-file (locate-user-emacs-file "config.el") :load))) #+end_src @@ -2700,8 +2702,7 @@ the needed boolean expression to tangle config.org. Booleans, yall! user-emacs-directory)) (config.el (concat config ".el")) (config.org (concat config ".org")) - (straight-org-dir (expand-file-name "straight/build/org" - user-emacs-directory))) + (straight-org-dir (locate-user-emacs-file "straight/build/org"))) ;; Okay, let's figure this out. ;; `and' evaluates each form, and returns nil on the first that ;; returns nil. `unless' only executes its body if the test -- cgit 1.4.1-21-gabe81