From 4c6931bc07da7b0a5fd2c9eb092eebf90c75e31f Mon Sep 17 00:00:00 2001 From: Marc Date: Sun, 4 Feb 2024 08:14:07 +0100 Subject: [PATCH] changed config tangling --- config.org | 38 ++++++++++++++++++++++++-------------- early-init.el | 7 +++++++ 2 files changed, 31 insertions(+), 14 deletions(-) diff --git a/config.org b/config.org index 3d9c6ac..a741fc1 100644 --- a/config.org +++ b/config.org @@ -44,9 +44,9 @@ These functions updates config.el whenever changes in config.org are made. The u (lambda () (or (not (process-live-p (get-process "tangle-process"))) (y-or-n-p "\"my/tangle-config\" is running; kill it? ")))) - (org-babel-tangle-file config-org config-el) + (org-babel-tangle-file config-org init-el) (message "reloading user-init-file") - (load-file config-el)) + (load-file init-el)) (add-hook 'org-mode-hook (lambda () @@ -57,20 +57,20 @@ These functions updates config.el whenever changes in config.org are made. The u "Add buffer-local hook." (add-hook hook function :local t)) -(defun my/async-process (command &optional name filter) - "Start an async process by running the COMMAND string with bash. Return the -process object for it. +;; (defun my/async-process (command &optional name filter) +;; "Start an async process by running the COMMAND string with bash. Return the +;; process object for it. -NAME is name for the process. Default is \"async-process\". +;; NAME is name for the process. Default is \"async-process\". -FILTER is function that runs after the process is finished, its args should be -\"(process output)\". Default is just messages the output." - (make-process - :command `("bash" "-c" ,command) - :name (if name name - "async-process") - :filter (if filter filter - (lambda (process output) (message output))))) +;; FILTER is function that runs after the process is finished, its args should be +;; \"(process output)\". Default is just messages the output." +;; (make-process +;; :command `("bash" "-c" ,command) +;; :name (if name name +;; "async-process") +;; :filter (if filter filter +;; (lambda (process output) (message output))))) #+END_SRC A small function to measure start up time. @@ -2000,3 +2000,13 @@ Maybe a problem on Windows? #+begin_src emacs-lisp ;(setq gc-cons-threshold (* 2 1000 1000)) #+end_src + +Rest of early-init.el +#+begin_src emacs-lisp :tangle early-init.el +(defconst config-org (expand-file-name "config.org" user-emacs-directory)) +(defconst init-el (expand-file-name "init.el" user-emacs-directory)) + +(unless (file-exists-p init-el) + (require 'org) + (org-babel-tangle-file config-org init-el)) +#+end_src diff --git a/early-init.el b/early-init.el index 5f7847d..c3a2f00 100644 --- a/early-init.el +++ b/early-init.el @@ -15,3 +15,10 @@ (menu-bar-mode -1) ;; disable menu bar (tool-bar-mode -1) ;; disable tool bar (scroll-bar-mode -1) ;; disable scroll bar + +(defconst config-org (expand-file-name "config.org" user-emacs-directory)) +(defconst init-el (expand-file-name "init.el" user-emacs-directory)) + +(unless (file-exists-p init-el) + (require 'org) + (org-babel-tangle-file config-org init-el))