about summary refs log tree commit diff
path: root/tools/emacs/config
diff options
context:
space:
mode:
authorVincent Ambo <tazjin@google.com>2019-12-16T13·33+0000
committerVincent Ambo <tazjin@google.com>2019-12-16T13·33+0000
commit99909ddd043554347dae0583d4096cbfc5880041 (patch)
tree9b21dadc1e5cc05f329b1263a54efaa0d3e20595 /tools/emacs/config
parent0e5da6c34cc83a5f992bc3f3a2611b377ac5add3 (diff)
feat(emacs): Add `withLocalConfig` override function r/167
This function makes it possible to pass in a folder with additional
local configuration from somewhere downstream.
Diffstat (limited to 'tools/emacs/config')
-rw-r--r--tools/emacs/config/init.el11
1 files changed, 6 insertions, 5 deletions
diff --git a/tools/emacs/config/init.el b/tools/emacs/config/init.el
index a23a16fca5..83621a99f9 100644
--- a/tools/emacs/config/init.el
+++ b/tools/emacs/config/init.el
@@ -170,10 +170,11 @@
 (telephone-line-setup)
 (ace-window-display-mode)
 
-;; If a local configuration file exists, it should be loaded. No
-;; other configuration comes from `user-emacs-directory'.
-(let ((local-file (expand-file-name (f-join user-emacs-directory "local.el"))))
-  (when (f-exists? local-file)
-    (load local-file)))
+;; If a local configuration library exists, it should be loaded.
+;;
+;; This can be provided by calling my Emacs derivation with
+;; `withLocalConfig'.
+(if-let (local-file (locate-library "local"))
+    (load local-file))
 
 (provide 'init)