Browse Source

some cleanup

master
Marc 3 years ago
parent
commit
7753d3d9a8
1 changed files with 4 additions and 23 deletions
  1. 27
      config.org

27
config.org

@ -41,30 +41,9 @@ Emacs variables are dynamically scoped. That's unusual for most languages, so di
:PROPERTIES:
:ID: 1c24d48e-0124-4a0b-8e78-82e4c531e818
:END:
When pulling the repository the first time, an initial init.el needs to be setup. After start it will replace itself with the configuration from init.org
#+BEGIN_SRC emacs-lisp :tangle no
(require 'org')
(find-file (concat user-emacs-directory "init.org"))
(org-babel-tangle)
(load-file (concat user-emacs-directory "init.el"))
(byte-compile-file (concat user-emacs-directory "init.el"))
#+END_SRC
This function updates init.el whenever changes in init.org are made. The update will be active after saving.
These functions updates config.el whenever changes in config.org are made. The update will be active after saving.
#+BEGIN_SRC emacs-lisp
;(defun me/tangle-init ()
; "If the current buffer is 'init.org', the code blocks are tangled, and the tangled file is compiled."
; (when (equal (buffer-file-name)
; (expand-file-name (concat user-emacs-directory "init.org")))
; ;; avoid running hooks
; (let ((prog-mode-hook nil))
; (org-babel-tangle)
; (byte-compile-file (concat user-emacs-directory "init.el"))
; (load-file user-init-file))))
;(add-hook 'after-save-hook 'me/tangle-init)
(defun me/tangle-config ()
"Export code blocks from the literate config file
asynchronously."
@ -77,7 +56,9 @@ asynchronously."
;; tangle config asynchronously
(me/async-process
(format "emacs %s --batch --eval '(org-babel-tangle nil \"%s\")'" config-org config-el)
"tangle-process"))
"tangle-process")
(message "reloading user-init-file")
(load-file config-el))
(add-hook 'org-mode-hook
(lambda ()

Loading…
Cancel
Save