Stop relying on "~/.emacs.d"

This commit is contained in:
Benson Chu 2023-03-01 10:58:45 -06:00
parent 519321f6c4
commit 33561250d4
8 changed files with 20 additions and 16 deletions

View file

@ -272,7 +272,7 @@
(setq epg-gpg-program "gpg2") (setq epg-gpg-program "gpg2")
;; (setq auth-source-debug t) ;; (setq auth-source-debug t)
(setq auth-sources '((:source "~/.emacs.d/secrets/.authinfo.gpg"))) (setq auth-sources `((:source ,(ef "secrets/.authinfo.gpg"))))
#+end_src #+end_src
** debbugs ** debbugs
#+begin_src emacs-lisp #+begin_src emacs-lisp
@ -322,7 +322,7 @@
))) )))
(defun get-authinfo (host port) (defun get-authinfo (host port)
(let* ((netrc (netrc-parse (expand-file-name "~/.emacs.d/secrets/.authinfo.gpg"))) (let* ((netrc (netrc-parse (ef "secrets/.authinfo.gpg")))
(hostentry (netrc-machine netrc host port))) (hostentry (netrc-machine netrc host port)))
(when hostentry (netrc-get hostentry "password")))) (when hostentry (netrc-get hostentry "password"))))
@ -440,7 +440,7 @@
#+end_src #+end_src
* auto-save files in same directory * auto-save files in same directory
#+begin_src emacs-lisp #+begin_src emacs-lisp
(setq backup-directory-alist `(("." . "~/.emacs.d/backups/"))) (setq backup-directory-alist `(("." . ,(ef "backups/"))))
(setq make-backup-files t ; backup of a file the first time it is saved. (setq make-backup-files t ; backup of a file the first time it is saved.
backup-by-copying t ; don't clobber symlinks backup-by-copying t ; don't clobber symlinks

View file

@ -129,7 +129,7 @@
#+end_src #+end_src
* exwm-background * exwm-background
#+begin_src emacs-lisp #+begin_src emacs-lisp
(add-to-list 'load-path "~/.emacs.d/submodule/exwm-background/") (add-to-list 'load-path (ef "submodule/exwm-background/"))
(require 'exwm-background) (require 'exwm-background)
(let ((wm (shell-command-to-string "wmctrl -m"))) (let ((wm (shell-command-to-string "wmctrl -m")))

View file

@ -47,7 +47,7 @@
(setq beacon-color "#006400") (setq beacon-color "#006400")
;; Use my fork of chinese-etzy ;; Use my fork of chinese-etzy
(load-file "~/.emacs.d/my-etzy.el") (load-file (ef "my-etzy.el"))
;; If I ever decide to turn on display-lines-mode, use relative line ;; If I ever decide to turn on display-lines-mode, use relative line
;; numbering ;; numbering
@ -1049,7 +1049,7 @@
(modus-themes-load-themes) (modus-themes-load-themes)
(load-theme 'modus-operandi nil t) (load-theme 'modus-operandi nil t)
(add-to-list 'custom-theme-load-path "~/.emacs.d/lisp/themes") (add-to-list 'custom-theme-load-path (ef "lisp/themes"))
(require 'light-default-theme) (require 'light-default-theme)
(load-theme 'light-default nil t) (load-theme 'light-default nil t)
(require 'dark-default-theme) (require 'dark-default-theme)

View file

@ -9,7 +9,7 @@
** fstree ** fstree
#+BEGIN_SRC emacs-lisp #+BEGIN_SRC emacs-lisp
(add-to-list 'load-path (add-to-list 'load-path
"~/.emacs.d/submodule/org-fstree") (ef "submodule/org-fstree"))
(require 'org-fstree) (require 'org-fstree)
#+END_SRC #+END_SRC
** org-bullets ** org-bullets
@ -43,7 +43,7 @@
(setq plstore-cache-passphrase-for-symmetric-encryption t) (setq plstore-cache-passphrase-for-symmetric-encryption t)
(save-excursion (save-excursion
(let ((filename "~/.emacs.d/google-calendar-secret.el")) (let ((filename (ef "google-calendar-secret.el")))
(when (file-exists-p filename) (when (file-exists-p filename)
(set-buffer (find-file-noselect filename)) (set-buffer (find-file-noselect filename))
(let ((var (eval (read (buffer-string))))) (let ((var (eval (read (buffer-string)))))
@ -88,7 +88,7 @@
*** Old ox-reveal package *** Old ox-reveal package
#+BEGIN_SRC #+BEGIN_SRC
(add-to-list 'load-path (add-to-list 'load-path
"~/.emacs.d/submodule/org-reveal") (ef "submodule/org-reveal"))
(require 'ox-reveal) (require 'ox-reveal)
(setq org-reveal-root "file:///home/benson/.reveal.js") (setq org-reveal-root "file:///home/benson/.reveal.js")
(setq org-structure-template-alist (remove-if (lambda (c) (string= (car c) "n")) org-structure-template-alist)) (setq org-structure-template-alist (remove-if (lambda (c) (string= (car c) "n")) org-structure-template-alist))
@ -192,7 +192,7 @@
(evil-set-initial-state 'org-brain-visualize-mode 'emacs)) (evil-set-initial-state 'org-brain-visualize-mode 'emacs))
:config :config
(setq org-id-track-globally t) (setq org-id-track-globally t)
(setq org-id-locations-file "~/.emacs.d/.org-id-locations") (setq org-id-locations-file (ef ".org-id-locations"))
(push '("b" "Brain" plain (function org-brain-goto-end) (push '("b" "Brain" plain (function org-brain-goto-end)
"* %i%?" :empty-lines 1) "* %i%?" :empty-lines 1)
org-capture-templates) org-capture-templates)
@ -218,7 +218,7 @@
#+END_SRC #+END_SRC
** org-now ** org-now
#+begin_src emacs-lisp #+begin_src emacs-lisp
(add-to-list 'load-path "~/.emacs.d/submodule/org-now") (add-to-list 'load-path (ef "submodule/org-now"))
(require 'org-now) (require 'org-now)
(setq org-now-location (setq org-now-location
nil) nil)
@ -782,7 +782,7 @@
#+end_src #+end_src
* elgantt * elgantt
#+begin_src emacs-lisp #+begin_src emacs-lisp
(add-to-list 'load-path "~/.emacs.d/submodule/elgantt") (add-to-list 'load-path (ef "submodule/elgantt"))
(require 'elgantt) (require 'elgantt)
#+end_src #+end_src
* org-kanban * org-kanban

View file

@ -10,7 +10,7 @@
* Youtube-dl * Youtube-dl
#+BEGIN_SRC emacs-lisp #+BEGIN_SRC emacs-lisp
(when (executable-find "youtube-dl") (when (executable-find "youtube-dl")
(add-to-list 'load-path "~/.emacs.d/submodule/youtube-dl-emacs/") (add-to-list 'load-path (ef "submodule/youtube-dl-emacs/"))
(require 'youtube-dl) (require 'youtube-dl)
(defun youtube-dl-song (url) (defun youtube-dl-song (url)

View file

@ -201,9 +201,9 @@
(use-package erlang) (use-package erlang)
(add-to-list 'load-path (add-to-list 'load-path
"~/.emacs.d/submodule/erlang_ls/") (ef "submodule/erlang_ls/"))
(setq lsp-erlang-server-install-dir "~/.emacs.d/submodule/erlang_ls") (setq lsp-erlang-server-install-dir (ef "submodule/erlang_ls"))
(defun my/erlang-keymap-hook () (defun my/erlang-keymap-hook ()
(local-set-key (kbd "C-c C-c") 'erlang-compile)) (local-set-key (kbd "C-c C-c") 'erlang-compile))

View file

@ -25,8 +25,9 @@
;;; Code: ;;; Code:
(require 'mmt) (require 'mmt)
(require 'cl) (require 'cl)
(require 'libs)
(setq custom-file "~/.emacs.d/customize.el") (setq custom-file (ef "customize.el"))
(load custom-file 'noerror) (load custom-file 'noerror)
(defvar ec/my-variables-list '()) (defvar ec/my-variables-list '())

View file

@ -18,4 +18,7 @@
;; Register my own rx forms ;; Register my own rx forms
(require 'my-rx-forms) (require 'my-rx-forms)
(defmacro ef (path)
`(expand-file-name ,path user-emacs-directory))
(provide 'libs) (provide 'libs)