Move load-path manipulation to the beginning of the configuration

This commit is contained in:
Gergely Polonkai 2019-10-22 10:27:25 +02:00
parent f97a40dcee
commit 885219a7ac
No known key found for this signature in database
GPG Key ID: 38F402C8471DDE93

View File

@ -1,3 +1,28 @@
* Add some directories to ~load-path~
** My own (version controlled) ~lisp~ directory
#+BEGIN_SRC emacs-lisp
(add-to-list 'load-path (expand-file-name
(convert-standard-filename "lisp/")
user-emacs-directory))
(add-to-list 'load-path (expand-file-name
(convert-standard-filename "lisp/nyan-prompt")
user-emacs-directory))
#+END_SRC
** The local site-lisp
…if it exists.
#+BEGIN_SRC emacs-lisp
(let ((site-lisp-dir "/usr/local/share/emacs/site-lisp"))
(when (file-directory-p site-lisp-dir)
(dolist (elt (directory-files site-lisp-dir))
(unless (or (string= elt ".") (string= elt ".."))
(add-to-list 'load-path (expand-file-name elt site-lisp-dir))))))
#+END_SRC
* Emacs configuration * Emacs configuration
** Set up the package archives ** Set up the package archives
@ -69,31 +94,6 @@ Just to make sure, although most Linux DE does this for me.
(set-default-coding-systems 'utf-8) (set-default-coding-systems 'utf-8)
#+END_SRC #+END_SRC
* Add some directories to ~load-path~
** My own (version controlled) ~lisp~ directory
#+BEGIN_SRC emacs-lisp
(add-to-list 'load-path (expand-file-name
(convert-standard-filename "lisp/")
user-emacs-directory))
(add-to-list 'load-path (expand-file-name
(convert-standard-filename "lisp/nyan-prompt")
user-emacs-directory))
#+END_SRC
** The local site-lisp
…if it exists.
#+BEGIN_SRC emacs-lisp
(let ((site-lisp-dir "/usr/local/share/emacs/site-lisp"))
(when (file-directory-p site-lisp-dir)
(dolist (elt (directory-files site-lisp-dir))
(unless (or (string= elt ".") (string= elt ".."))
(add-to-list 'load-path (expand-file-name elt site-lisp-dir))))))
#+END_SRC
* Load some prerequisites * Load some prerequisites
** Load ~xdg-paths~ ** Load ~xdg-paths~