2021-04-30 05:36:23 +00:00
|
|
|
|
;;; core-load-paths.el --- Spacemacs Core File -*- no-byte-compile: t; lexical-binding: t -*-
|
2015-01-23 03:26:56 +00:00
|
|
|
|
;;
|
2021-03-22 20:11:29 +00:00
|
|
|
|
;; Copyright (c) 2012-2021 Sylvain Benner & Contributors
|
2015-01-23 03:26:56 +00:00
|
|
|
|
;;
|
|
|
|
|
;; Author: Sylvain Benner <sylvain.benner@gmail.com>
|
|
|
|
|
;; URL: https://github.com/syl20bnr/spacemacs
|
|
|
|
|
;;
|
|
|
|
|
;; This file is not part of GNU Emacs.
|
|
|
|
|
;;
|
2021-03-24 03:31:44 +00:00
|
|
|
|
;; This program is free software; you can redistribute it and/or modify
|
|
|
|
|
;; it under the terms of the GNU General Public License as published by
|
|
|
|
|
;; the Free Software Foundation, either version 3 of the License, or
|
|
|
|
|
;; (at your option) any later version.
|
|
|
|
|
;;
|
|
|
|
|
;; This program is distributed in the hope that it will be useful,
|
|
|
|
|
;; but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
|
|
|
;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
|
|
|
;; GNU General Public License for more details.
|
|
|
|
|
;;
|
|
|
|
|
;; You should have received a copy of the GNU General Public License
|
|
|
|
|
;; along with this program. If not, see <http://www.gnu.org/licenses/>.
|
|
|
|
|
|
2021-04-30 05:36:23 +00:00
|
|
|
|
;;; Commentary:
|
|
|
|
|
;;
|
|
|
|
|
;; Define various PATH variables, and set up load path.
|
2015-01-23 03:26:56 +00:00
|
|
|
|
|
2021-04-30 05:36:23 +00:00
|
|
|
|
;;; Code:
|
|
|
|
|
|
|
|
|
|
;;;; PATH variables/constants
|
|
|
|
|
|
|
|
|
|
(defconst user-home-directory
|
|
|
|
|
(expand-file-name "~/")
|
|
|
|
|
"User home directory (default ~/).")
|
2016-07-06 00:28:37 +00:00
|
|
|
|
|
2021-04-30 05:36:23 +00:00
|
|
|
|
;; ~/.emacs.d
|
2016-06-23 13:35:21 +00:00
|
|
|
|
(defvar spacemacs-start-directory
|
2021-04-30 05:36:23 +00:00
|
|
|
|
(expand-file-name user-emacs-directory)
|
2016-06-23 13:35:21 +00:00
|
|
|
|
"Spacemacs start directory.")
|
2021-04-30 05:36:23 +00:00
|
|
|
|
|
|
|
|
|
;; ~/.emacs.d/assets
|
|
|
|
|
(defconst spacemacs-assets-directory
|
|
|
|
|
(concat spacemacs-start-directory "assets/")
|
|
|
|
|
"Spacemacs assets directory.")
|
|
|
|
|
|
|
|
|
|
;; ~/.emacs.d/core
|
2015-01-25 04:58:24 +00:00
|
|
|
|
(defconst spacemacs-core-directory
|
2021-04-30 05:36:23 +00:00
|
|
|
|
(concat spacemacs-start-directory "core/")
|
2015-01-25 04:58:24 +00:00
|
|
|
|
"Spacemacs core directory.")
|
2021-04-30 05:36:23 +00:00
|
|
|
|
|
|
|
|
|
;; ~/.emacs.d/core/banners
|
2015-01-25 04:58:24 +00:00
|
|
|
|
(defconst spacemacs-banner-directory
|
2021-04-30 05:36:23 +00:00
|
|
|
|
(concat spacemacs-core-directory "banners/")
|
2015-01-25 04:58:24 +00:00
|
|
|
|
"Spacemacs banners directory.")
|
2021-04-30 05:36:23 +00:00
|
|
|
|
|
2015-03-13 03:55:38 +00:00
|
|
|
|
(defconst spacemacs-banner-official-png
|
2021-04-30 05:36:23 +00:00
|
|
|
|
(concat spacemacs-banner-directory "img/spacemacs.png")
|
2015-03-13 03:55:38 +00:00
|
|
|
|
"Spacemacs official banner image.")
|
2021-04-30 05:36:23 +00:00
|
|
|
|
|
2016-06-05 04:04:53 +00:00
|
|
|
|
(defconst spacemacs-badge-official-png
|
2021-04-30 05:36:23 +00:00
|
|
|
|
(concat spacemacs-banner-directory "img/spacemacs-badge.png")
|
2016-06-05 04:04:53 +00:00
|
|
|
|
"Spacemacs official badge image.")
|
2021-04-30 05:36:23 +00:00
|
|
|
|
|
2016-06-05 04:04:53 +00:00
|
|
|
|
(defconst spacemacs-purple-heart-png
|
2021-04-30 05:36:23 +00:00
|
|
|
|
(concat spacemacs-banner-directory "img/heart.png")
|
2016-06-05 04:04:53 +00:00
|
|
|
|
"Purple heart emoji.")
|
2021-04-30 05:36:23 +00:00
|
|
|
|
|
2021-03-24 20:03:04 +00:00
|
|
|
|
(defconst spacemacs-gplv3-official-png
|
2021-04-30 05:36:23 +00:00
|
|
|
|
(concat spacemacs-banner-directory "img/gplv3.png")
|
2021-03-24 20:03:04 +00:00
|
|
|
|
"GPLv3 official badge image.")
|
2021-04-30 05:36:23 +00:00
|
|
|
|
|
|
|
|
|
;; ~/.emacs.d/core/info
|
|
|
|
|
(defconst spacemacs-info-directory
|
|
|
|
|
(concat spacemacs-core-directory "info/")
|
|
|
|
|
"Spacemacs info files directory.")
|
|
|
|
|
|
|
|
|
|
;; ~/.emacs.d/core/info/release-notes
|
|
|
|
|
(defconst spacemacs-release-notes-directory
|
|
|
|
|
(concat spacemacs-info-directory "release-notes/")
|
|
|
|
|
"Spacemacs release notes directory.")
|
|
|
|
|
|
|
|
|
|
;; ~/.emacs.d/doc
|
2015-06-06 17:24:26 +00:00
|
|
|
|
(defconst spacemacs-docs-directory
|
2021-04-30 05:36:23 +00:00
|
|
|
|
(concat spacemacs-start-directory "doc/")
|
2015-06-06 17:24:26 +00:00
|
|
|
|
"Spacemacs documentation directory.")
|
2021-04-30 05:36:23 +00:00
|
|
|
|
|
|
|
|
|
;; ~/.emacs.d/news
|
2016-10-03 02:39:22 +00:00
|
|
|
|
(defconst spacemacs-news-directory
|
2021-04-30 05:36:23 +00:00
|
|
|
|
(concat spacemacs-start-directory "news/")
|
2016-10-03 02:39:22 +00:00
|
|
|
|
"Spacemacs News directory.")
|
2021-04-30 05:36:23 +00:00
|
|
|
|
|
|
|
|
|
;; ~/.emacs.d/private
|
|
|
|
|
(defconst spacemacs-private-directory
|
|
|
|
|
(concat spacemacs-start-directory "private/")
|
|
|
|
|
"Spacemacs private directory.")
|
|
|
|
|
|
|
|
|
|
;; ~/.emacs.d/tests
|
2015-07-31 08:30:42 +00:00
|
|
|
|
(defconst spacemacs-test-directory
|
2021-04-30 05:36:23 +00:00
|
|
|
|
(concat spacemacs-start-directory "tests/")
|
2015-07-31 08:30:42 +00:00
|
|
|
|
"Spacemacs tests directory.")
|
2015-02-04 04:56:38 +00:00
|
|
|
|
|
2021-04-30 05:36:23 +00:00
|
|
|
|
;; ~/.emacs.d/.cache
|
|
|
|
|
(defconst spacemacs-cache-directory
|
|
|
|
|
(concat user-emacs-directory ".cache/")
|
|
|
|
|
"Spacemacs storage area for persistent files.")
|
|
|
|
|
|
|
|
|
|
;; ~/.emacs.d/.cache/auto-save
|
|
|
|
|
(defconst spacemacs-auto-save-directory
|
|
|
|
|
(concat spacemacs-cache-directory "auto-save/")
|
|
|
|
|
"Spacemacs auto-save directory.")
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
;;;; Setup cache directories
|
|
|
|
|
|
|
|
|
|
;; TODO: Should also catch any IO error such as permission error (Apr 25 2021 Lucius)
|
2015-01-25 04:58:24 +00:00
|
|
|
|
(unless (file-exists-p spacemacs-cache-directory)
|
2021-04-30 05:36:23 +00:00
|
|
|
|
(make-directory spacemacs-cache-directory))
|
|
|
|
|
|
|
|
|
|
(setq pcache-directory (concat spacemacs-cache-directory "pcache/"))
|
|
|
|
|
|
|
|
|
|
;;;; Load Paths
|
|
|
|
|
;; TODO: Since these functions are not called anywhere, consider to inline them (Apr 27 2021 Lucius)
|
|
|
|
|
|
|
|
|
|
(defun spacemacs//add-to-load-path (dir)
|
|
|
|
|
"Prepend DIR to `load-path'."
|
|
|
|
|
(add-to-list 'load-path dir))
|
|
|
|
|
|
|
|
|
|
;; FIXME: unused function (Apr 25 2021 Lucius)
|
|
|
|
|
(defun spacemacs//add-to-load-path-if-exists (dir)
|
|
|
|
|
"If DIR exists in the file system, prepend it to `load-path'."
|
|
|
|
|
(when (file-exists-p dir)
|
|
|
|
|
(spacemacs//add-to-load-path dir)))
|
|
|
|
|
|
|
|
|
|
(dolist (suffix '(nil "libs/" "libs/spacemacs-theme/" "libs/forks"))
|
|
|
|
|
(spacemacs//add-to-load-path (concat spacemacs-core-directory suffix)))
|
|
|
|
|
|
|
|
|
|
;;;; Themes
|
2017-01-25 05:30:31 +00:00
|
|
|
|
(add-to-list 'custom-theme-load-path (concat spacemacs-core-directory
|
|
|
|
|
"libs/spacemacs-theme/"))
|
|
|
|
|
|
2021-04-30 05:36:23 +00:00
|
|
|
|
(provide 'core-load-paths)
|
|
|
|
|
;;; core-load-paths.el ends here
|