Start work on early-init.el

Commit
ee826b2e1d84f35406b3885607caa13e143ec482
Author
Blendoit <blendoit@gmail.com>
Author date
Committer
Blendoit <blendoit@gmail.com>
Committer date
Changed files
.gitignore
index 29d95903..d7dc875d 100644..100644
@@ -18,3 +18,5 @@
18 18 # Tangled config .el file from .org
19 19 smart-documents.el
20 20
21 Added: # Misc
22 Added: .org-id-locations
init-custom.el
index 4aab2a2d..3cbdb6ef 100644..100644
@@ -15,7 +15,7 @@
15 15 '(company-quickhelp-color-foreground "#DCDCCC")
16 16 '(custom-enabled-themes nil)
17 17 '(custom-safe-themes
18 Removed: '("5c32236ef318adafe4102f627f330fa8f448046dfd838eef5cc09c7f682cf71f" "e343fecfb8d681186d594002c9b44ce48c2061599d7e4ec635cf1ca2a277a47a" "302dc61dc55600c7424f945dce9e74fba7df19f4a7bfb72aefd93193fa82ede4" "58f1f85248ba913387d1e7ed02a867161b315cfb5acff0c234e013ffd2577d22" "a256abf590bbc3257cc11d91a312e9fe8487dc1b95a5b7b732dd2f96a7fe5a45" "30368d6195cae9298304e6ac0534b90c85b1655965f1206c5c624270f0f46002" "311aa5df3223b5b4a7c638aad3befb4de9c7f46360d52acd1fa2cd2232b1dcbd" default))
18 Added: '("6495716176be0ced4142593b94a410135e0b373b686a869637824260d2f1ca11" "4467b1c8d7cc78fe98345c9c63eb62cf37844dc6868630add365494bde455715" "faeef63cb31f796b4bdf22f38e614934ab34d7deacaeb89b3e9cccf70aac5a85" "370fb305168fea1614535dc9ca30f496918eaca754b6c8969dd77fa872bec695" "e9f0c0c3397d07eb1c6c3551d67fd151e24bc6d72ec678841623ed572677c97a" "5c32236ef318adafe4102f627f330fa8f448046dfd838eef5cc09c7f682cf71f" "e343fecfb8d681186d594002c9b44ce48c2061599d7e4ec635cf1ca2a277a47a" "302dc61dc55600c7424f945dce9e74fba7df19f4a7bfb72aefd93193fa82ede4" "58f1f85248ba913387d1e7ed02a867161b315cfb5acff0c234e013ffd2577d22" "a256abf590bbc3257cc11d91a312e9fe8487dc1b95a5b7b732dd2f96a7fe5a45" "30368d6195cae9298304e6ac0534b90c85b1655965f1206c5c624270f0f46002" "311aa5df3223b5b4a7c638aad3befb4de9c7f46360d52acd1fa2cd2232b1dcbd" default))
19 19 '(fci-rule-color "#383838")
20 20 '(fringe-mode 0 nil (fringe))
21 21 '(indicate-empty-lines t)
init.el
index 9f56fa4f..228062c7 100644..100644
@@ -1,19 +1,23 @@
1 Removed: ;;; init.el --- bootstrap main Emacs config from USB drive.
1 Added: ;;; init.el --- Load literate configuration file, smart-documents.org.
2 2
3 3 ;;; Commentary:
4 Removed: ;; This package enables bootstrapping a full `.emacs.d/' configuration
5 Removed: ;; residing on a removable drive. It is copied over from
6 Removed: ;; init-bootstrap.el to init.el, at a location the OS expects to find
7 Removed: ;; that file. Then, every time Emacs is started, it will scan the top
8 Removed: ;; level of all typical mount points in an effort to detect an
9 Removed: ;; existing `.emacs.d/'.
4 Added: ;; This file's sole purpose is to load our literate configuration file.
10 5
11 6 ;;; Code:
12 7
13 Removed: (org-babel-load-file "~/.emacs.d/smart-documents.org")
14 8
15 Removed: (setq my/literate-config (concat user-emacs-directory "smart-documents.org"))
16 Removed: ;; (setq my/literate-config-compiled (concat user-emacs-directory "blendoit-init.elc"))
9 Added: ;; First of all, we indicate the path to our literate configuration file.
10 Added: (setq my/literate-config (concat user-emacs-directory "smart-documents"))
11 Added:
12 Added: ;; Emacs will startup faster next time, because it will load
13 Added: ;; a byte-compiled version of our literate configuration file.
14 Added: (cond ((file-exists-p (concat my/literate-config ".elc"))
15 Added: (load (concat my/literate-config ".elc")))
16 Added: ((file-exists-p (concat my/literate-config ".el"))
17 Added: (load (concat my/literate-config ".el")))
18 Added: ((file-exists-p (concat my/literate-config ".org"))
19 Added: (org-babel-load-file (concat my/literate-config ".org")))
20 Added: (t (message "There appears to be no literate configuration file. Reinstall?")))
17 21
18 22 (provide 'init)
19 23
smart-documents.org
index dc3cf69e..843b6789 100644..100644
@@ -12,9 +12,8 @@
12 12
13 13 #+LATEX: \begin{abstract}
14 14 The idea of /Smart Documents/ came to me as I was reflecting on how to improve
15 Removed: the document production process in my workplace. So much time was wasted on
16 Removed: formatting; output PDFs were awfully inconsistent, and conveyed poor brand
17 Removed: awareness from a typographical standpoint.
15 Added: the document production process in my workplace. I really wanted to improve the
16 Added: way we produced documents.
18 17
19 18 #+LATEX: \end{abstract}
20 19
@@ -26,10 +25,10 @@
26 25 inception in 1984, GNU Emacs has grown to be much more than a full-featured,
27 26 high-productivity text editor---new /modes/ have been written to interact with
28 27 hundreds of file formats, including =.txt=, =.pdf=, =.jpg=, =.csv=, and =.zip=
29 Removed: just to name a few. This configuration file itself was written in /Org mode/, a
30 Removed: collection of functions enabling the harmonious mixing of code and comments in
31 Removed: view of publication: this is the endgame of /literate programming/, and the
32 Removed: basis of my vision for /Smart Documents/.
28 Added: just to name a few. This paper itself was written in /Org mode/, a collection
29 Added: of functions enabling the harmonious mixing of code and comments in view of
30 Added: publication: this is the endgame of /literate programming/, and the basis of my
31 Added: vision for /Smart Documents/.
33 32
34 33 The following sections were laid out very deliberately. When we start Emacs,
35 34 the source code blocks contained in this document are evaluated
@@ -40,29 +39,16 @@
40 39 [[https://www.gnu.org/software/emacs/manual/html_node/elisp/Startup-Summary.html]].]
41 40
42 41 Customizing Emacs goes far, far beyond this document---feel free to experiment
43 Removed: and discover.
42 Added: and discover. Here are three commands that will help you understand all the
43 Added: symbols in this file, if you are browsing this paper within Emacs itself:
44 44
45 45 - ~C-h f~ describe function
46 46 - ~C-h v~ describe variable
47 47 - ~C-h k~ describe key
48 48
49 Removed: These three commands will attempt to describe the element currently under our
50 Removed: cursor, however one can start typing to search for another symbol.
51 Removed:
52 Removed: ** =init.el=
53 Removed:
54 49 When Emacs first starts up, it looks for the following files in order and
55 50 attempts to load the contents of the first existing file. From the manual:
56 51
57 Removed: #+BEGIN_QUOTE
58 Removed: Traditionally, file =~/.emacs= is used as the init file, although Emacs also
59 Removed: looks at =~/.emacs.el=, =~/.emacs.d/init.el=, =~/.config/emacs/init.el=, or
60 Removed: other
61 Removed: locations.[fn::[[https://www.gnu.org/software/emacs/manual/html_node/emacs/Init-File.html]]]
62 Removed: #+END_QUOTE
63 Removed:
64 Removed: If no file is found, Emacs then loads in its purely vanilla state.
65 Removed:
66 52 * TODO First-time setup
67 53
68 54 ** TODO User details
@@ -87,8 +73,6 @@
87 73 (append-to-file "Foobar\n" nil "~/.emacs.d/meta/foobar"))
88 74 #+END_SRC
89 75
90 Removed:
91 Removed:
92 76 ** File system paths
93 77
94 78 In this subsection, we tell Emacs about relevant paths to resources.
@@ -103,16 +87,50 @@
103 87
104 88 * Early setup
105 89
106 Removed: ** Garbage collection
90 Added: ** The first file to load, =early-init.el=
107 91
108 Removed: First, we increase the RAM threshold beyond which the garbage collector is
109 Removed: activated.
92 Added: This is the very first user-writable file loaded by Emacs.[fn::This feature
93 Added: became available in version 27.1.] In it, we disable GUI elements that would
94 Added: otherwise be loaded and displayed once Emacs is ready to accept user input.
110 95
111 Removed: #+NAME: garbage-collection
112 96 #+BEGIN_SRC emacs-lisp
113 Removed: (setq gc-cons-threshold 100000000)
97 Added: (setq my/early-init-file (concat user-emacs-directory "early-init.el"))
98 Added:
99 Added: (unless (file-exists-p my/early-init-file)
100 Added: (write-region
101 Added: "(menu-bar-mode -1)
102 Added: (tool-bar-mode -1)
103 Added: (menu-bar-bottom-and-right-window-divider)
104 Added: (setq gc-cons-threshold 100000000)" nil my/early-init-file)
105 Added: (menu-bar-mode -1)
106 Added: (tool-bar-mode -1)
107 Added: (menu-bar-bottom-and-right-window-divider)
108 Added: (setq gc-cons-threshold 100000000))
114 109 #+END_SRC
115 110
111 Added: ** The second file to load, =init.el=
112 Added:
113 Added: #+BEGIN_QUOTE
114 Added: Traditionally, file =~/.emacs= is used as the init file, although Emacs also
115 Added: looks at =~/.emacs.el=, =~/.emacs.d/init.el=, =~/.config/emacs/init.el=, or
116 Added: other
117 Added: locations.[fn::[[https://www.gnu.org/software/emacs/manual/html_node/emacs/Init-File.html]]]
118 Added: #+END_QUOTE
119 Added:
120 Added: #+BEGIN_SRC emacs-lisp
121 Added: (setq my/init-file (concat user-emacs-directory "init.el"))
122 Added:
123 Added: (unless (file-exists-p my/init-file)
124 Added: (write-region
125 Added: "(menu-bar-mode -1)
126 Added: (tool-bar-mode -1)
127 Added: (menu-bar-bottom-and-right-window-divider)" nil my/early-init-file)
128 Added: (menu-bar-mode -1)
129 Added: (tool-bar-mode -1)
130 Added: (menu-bar-bottom-and-right-window-divider))
131 Added: #+END_SRC
132 Added:
133 Added: If no file is found, Emacs then loads in its purely vanilla state.
116 134 ** Profiling --- start
117 135
118 136 We start the profiler now , and will interrupt it in Section [[Profiling ---
@@ -142,7 +160,7 @@
142 160 (defun my/find-literate-config ()
143 161 "Jump to this very file."
144 162 (interactive)
145 Removed: (find-file my/literate-config))
163 Added: (find-file (concat my/literate-config ".org"))
146 164
147 165 (global-set-key (kbd "C-c c") 'my/find-literate-config)
148 166 #+END_SRC
@@ -796,7 +814,6 @@
796 814 ("budget" "%(binary) -f %(ledger-file) budget --exchange USD")))
797 815 #+END_SRC
798 816
799 Removed:
800 817 *** Plotting & charting
801 818
802 819 #+BEGIN_SRC emacs-lisp
@@ -891,25 +908,6 @@
891 908
892 909 ** Frame
893 910
894 Removed: *** Clean up menus
895 Removed:
896 Removed: Originally, I wished to inhibit certain entries in the GUI menus. Not worth the
897 Removed: effort at this time.
898 Removed:
899 Removed: #+BEGIN_SRC emacs-lisp
900 Removed: (menu-bar-mode -1)
901 Removed: (tool-bar-mode -1)
902 Removed: #+END_SRC
903 Removed:
904 Removed: *** Dividers
905 Removed:
906 Removed: This ensures users can resize windows using the GUI. It also creates a useful
907 Removed: separation between the bottom of the frame and the echo area.
908 Removed:
909 Removed: #+BEGIN_SRC emacs-lisp
910 Removed: (menu-bar-bottom-and-right-window-divider)
911 Removed: #+END_SRC
912 Removed:
913 911 *** TODO Header & mode line
914 912 Complete mode line rewrite. Might require new package.
915 913
@@ -1065,8 +1063,24 @@
1065 1063 * Late setup
1066 1064
1067 1065 At this point, our editor is almost ready to run. Phew! All that's left to do
1068 Removed: is to interrupt our profiling activities, and smartly store the result of our
1069 Removed: profiling.
1066 Added: is to prepare for the next startup, interrupt our profiling activities, and
1067 Added: smartly store the result of our profiling.
1068 Added:
1069 Added: ** TODO Speeding up the next startup
1070 Added:
1071 Added: #+BEGIN_SRC emacs-lisp
1072 Added: (defun byte-compile-if-literate-config ()
1073 Added: "Byte compile the current file if it is `my/literate-config-org'."
1074 Added: (interactive)
1075 Added: (when (string-equal
1076 Added: buffer-file-name
1077 Added: "/home/blendux/.emacs.d/smart-documents.org")
1078 Added: (delete-file (concat my/literate-config ".elc"))
1079 Added: (byte-compile (concat my/literate-config ".el")))
1080 Added: (message "c'mon work fucker"))
1081 Added:
1082 Added: (add-hook 'after-save-file 'byte-compile-if-literate-config)
1083 Added: #+END_SRC
1070 1084
1071 1085 ** Profiling --- stop
1072 1086
smart-documents.pdf
index 22120d28..e9b8cece 100644..100644

Binary files differ

themes/blendoit-light-theme.el
index 0b97d462..a2e8be18 100644..100644
@@ -1,5 +1,5 @@
1 1 (deftheme blendoit-light
2 Removed: "Created 2020-10-04.")
2 Added: "Created 2020-10-05.")
3 3
4 4 (custom-theme-set-faces
5 5 'blendoit-light
@@ -56,10 +56,10 @@
56 56 '(org-document-title ((t (:weight bold :height 2.0))))
57 57 '(org-footnote ((t (:inherit link))))
58 58 '(org-document-info-keyword ((t (:inherit org-meta-line))))
59 Removed: '(org-code ((t (:background "light grey" :foreground "black" :family "Hack"))))
59 Added: '(org-code ((t (:background "light grey" :foreground "black" :height 0.9 :family "Hack"))))
60 60 '(org-checkbox-statistics-todo ((t (:inherit org-checkbox :foreground "tomato"))))
61 61 '(org-checkbox-statistics-done ((t (:inherit org-checkbox :foreground "ForestGreen"))))
62 Removed: '(org-verbatim ((t (:inherit fixed-pitch :foreground "DodgerBlue1" :foundry "Hack"))))
62 Added: '(org-verbatim ((t (:inherit fixed-pitch :height 0.9 :foreground "DodgerBlue1" :foundry "Hack"))))
63 63 '(font-lock-doc-face ((t (:inherit font-lock-string-face :Family "Liberation Sans"))))
64 64 '(org-document-info ((t (:weight bold))))
65 65 '(org-table ((t (:height 0.8 :family "Hack"))))
@@ -73,18 +73,17 @@
73 73 '(org-level-6 ((t (:inherit org-level-5))))
74 74 '(org-level-7 ((t (:inherit org-level-5))))
75 75 '(org-level-8 ((t (:inherit org-level-5))))
76 Removed: '(org-checkbox ((t (:inherit org-meta-line :weight bold))))
76 Added: '(org-checkbox ((t (:weight bold :inherit org-meta-line))))
77 77 '(org-todo ((t (:background "tomato" :foreground "White" :weight bold :height 1.2 :family "Hermit"))))
78 78 '(org-done ((t (:background "ForestGreen" :foreground "White" :weight bold :height 1.2 :family "Hermit"))))
79 79 '(org-date ((t (:inherit org-tag))))
80 80 '(Info-quoted ((t (:inherit org-block))))
81 Removed: '(org-priority ((t (:inherit org-meta-line :weight bold))))
81 Added: '(org-priority ((t (:weight bold :inherit org-meta-line))))
82 82 '(powerline-active1 ((t (:inherit mode-line :background "grey17" :foreground "white" :family "Hack"))))
83 83 '(powerline-active2 ((t (:inherit (mode-line) :foreground "white" :background "grey40"))))
84 84 '(powerline-inactive1 ((t (:inherit mode-line-inactive :background "grey11" :family "Hack"))))
85 85 '(powerline-inactive2 ((t (:inherit (mode-line-inactive) :background "grey20"))))
86 86 '(org-drawer ((t (:inherit org-meta-line))))
87 Removed: '(org-tag ((t (:inherit org-meta-line :underline t))))
88 87 '(default ((t (:background "white" :foreground "black" :height 140 :family "Hack")))))
89 88
90 89 (provide-theme 'blendoit-light)