git.fiddlerwoaroof.com
Browse code

refactor(emacs): fix load-package-configuration

Edward Langley authored on 04/05/2021 01:21:42
Showing 1 changed files
... ...
@@ -37,11 +37,61 @@
37 37
 (set-exec-path-from-shell-PATH)
38 38
 (cold-boot)
39 39
 
40
-(use-package keyfreq
41
-  :ensure t
42
-  :config
43
-  (keyfreq-mode 1)
44
-  (keyfreq-autosave-mode 1))
40
+(eval-and-compile
41
+  (defvar *fwoar-git-repos*
42
+    (file-name-as-directory
43
+     (expand-file-name (car (file-expand-wildcards "~/git*_repos"))
44
+                       "~"))))
45
+
46
+(eval-and-compile
47
+  (defun fwoar-git-repo (name ssh-remote http-remote)
48
+    (let ((dir-name (file-name-as-directory (expand-file-name name *fwoar-git-repos*))))
49
+      (unless (file-exists-p dir-name)
50
+        (ecase fwoar-git-mode
51
+          (:ssh (magit-run-git-with-input "clone" ssh-remote dir-name))
52
+          (:http (magit-run-git-with-input "clone" http-remote dir-name))))
53
+      dir-name)))
54
+
55
+(defvar *dotfiles-repo*
56
+  (fwoar-git-repo "dotfiles"
57
+                  "git@git.fiddlerwoaroof.com:dotfiles.git"
58
+                  "https://git.fiddlerwoaroof.com/git/dotfiles.git"))
59
+
60
+(defun fwoar/setup-load-path ()
61
+  (let* ((new-load-path (cl-adjoin "~/.emacs.d/lisp/configurations/"
62
+                                   load-path
63
+                                   :test 'equal))
64
+         (new-load-path (cl-adjoin (concat *dotfiles-repo*
65
+                                           "emacs.d/lisp/configurations/")
66
+                                   new-load-path
67
+                                   :test 'equal))
68
+         (new-load-path (cl-adjoin (concat *dotfiles-repo*
69
+                                           "emacs.d/packages/")
70
+                                   new-load-path
71
+                                   :test 'equal)))
72
+    (setq load-path new-load-path)))
73
+
74
+(fwoar/setup-load-path)
75
+
76
+
77
+(defun fwoar/package-configuration (package)
78
+  (fwoar/setup-load-path)
79
+  (let* ((local-configs)
80
+         (git-configs (concat *dotfiles-repo*
81
+                              "emacs.d/lisp/configurations/"))
82
+         (conf-file (concat (symbol-name package) "-conf.el"))
83
+         (load-path (list* local-configs git-configs load-path)))
84
+    conf-file))
85
+
86
+(defun load-package-configuration (package)
87
+  (let ((conf-file (fwoar/package-configuration package)))
88
+    (load conf-file)))
89
+
90
+(defun fwoar/load-local-packages ()
91
+  (interactive)
92
+  (mapc 'package-install-file
93
+        (directory-files (format "%s/%s" *dotfiles-repo* "emacs.d/packages/")
94
+                         t ".*[.]el")))
45 95
 
46 96
 (use-package general
47 97
   :ensure t)
... ...
@@ -166,62 +216,6 @@
166 216
   (push (cons "git.cnvrmedia.net" "stash")
167 217
         browse-at-remote-remote-type-domains))
168 218
 
169
-(eval-and-compile
170
-  (defvar *fwoar-git-repos*
171
-    (file-name-as-directory
172
-     (expand-file-name (car (file-expand-wildcards "~/git*_repos"))
173
-                       "~"))))
174
-
175
-(eval-and-compile
176
-  (defun fwoar-git-repo (name ssh-remote http-remote)
177
-    (let ((dir-name (file-name-as-directory (expand-file-name name *fwoar-git-repos*))))
178
-      (unless (file-exists-p dir-name)
179
-        (ecase fwoar-git-mode
180
-          (:ssh (magit-run-git-with-input "clone" ssh-remote dir-name))
181
-          (:http (magit-run-git-with-input "clone" http-remote dir-name))))
182
-      dir-name)))
183
-
184
-(defvar *dotfiles-repo*
185
-  (fwoar-git-repo "dotfiles"
186
-                  "git@git.fiddlerwoaroof.com:dotfiles.git"
187
-                  "https://git.fiddlerwoaroof.com/git/dotfiles.git"))
188
-
189
-(defun fwoar/setup-load-path ()
190
-  (let* ((new-load-path (cl-adjoin "~/.emacs.d/lisp/configurations/"
191
-                                   load-path
192
-                                   :test 'equal))
193
-         (new-load-path (cl-adjoin (concat *dotfiles-repo*
194
-                                           "emacs.d/lisp/configurations/")
195
-                                   new-load-path
196
-                                   :test 'equal))
197
-         (new-load-path (cl-adjoin (concat *dotfiles-repo*
198
-                                           "emacs.d/packages/")
199
-                                   new-load-path
200
-                                   :test 'equal)))
201
-    (setq load-path new-load-path)))
202
-
203
-(fwoar/setup-load-path)
204
-
205
-
206
-(defun fwoar/package-configuration (package)
207
-  (fwoar/setup-load-path)
208
-  (let* ((local-configs)
209
-         (git-configs (concat *dotfiles-repo*
210
-                              "emacs.d/lisp/configurations/"))
211
-         (conf-file (concat (symbol-name package) "-conf.el"))
212
-         (load-path (list* local-configs git-configs load-path)))
213
-    conf-file))
214
-
215
-(defun load-package-configuration (package)
216
-  (let ((conf-file (fwoar/package-configuration package)))
217
-    (load conf-file)))
218
-
219
-(defun fwoar/load-local-packages ()
220
-  (interactive)
221
-  (mapc 'package-install-file
222
-        (directory-files (format "%s/%s" *dotfiles-repo* "emacs.d/packages/")
223
-                         t ".*[.]el")))
224
-
225 219
 (unless (package-installed-p 'fwoar-functional-utils)
226 220
   (fwoar/load-local-packages))
227 221
 
... ...
@@ -255,7 +249,7 @@
255 249
 
256 250
 ;; slime depends on fwoar-git-repo
257 251
 (load-package-configuration 'slime)
258
-(load-package-configuration 'cider)
252
+(comment (load-package-configuration 'cider))
259 253
 
260 254
 (global-company-mode 1)
261 255