Browse Source

changed config tangling

master
Marc 7 months ago
parent
commit
4c6931bc07
2 changed files with 31 additions and 14 deletions
  1. 38
      config.org
  2. 7
      early-init.el

38
config.org

@ -44,9 +44,9 @@ These functions updates config.el whenever changes in config.org are made. The u
(lambda () (lambda ()
(or (not (process-live-p (get-process "tangle-process"))) (or (not (process-live-p (get-process "tangle-process")))
(y-or-n-p "\"my/tangle-config\" is running; kill it? ")))) (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") (message "reloading user-init-file")
(load-file config-el))
(load-file init-el))
(add-hook 'org-mode-hook (add-hook 'org-mode-hook
(lambda () (lambda ()
@ -57,20 +57,20 @@ These functions updates config.el whenever changes in config.org are made. The u
"Add buffer-local hook." "Add buffer-local hook."
(add-hook hook function :local t)) (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 #+END_SRC
A small function to measure start up time. A small function to measure start up time.
@ -2000,3 +2000,13 @@ Maybe a problem on Windows?
#+begin_src emacs-lisp #+begin_src emacs-lisp
;(setq gc-cons-threshold (* 2 1000 1000)) ;(setq gc-cons-threshold (* 2 1000 1000))
#+end_src #+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

7
early-init.el

@ -15,3 +15,10 @@
(menu-bar-mode -1) ;; disable menu bar (menu-bar-mode -1) ;; disable menu bar
(tool-bar-mode -1) ;; disable tool bar (tool-bar-mode -1) ;; disable tool bar
(scroll-bar-mode -1) ;; disable scroll 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))
Loading…
Cancel
Save