Revise and update docstrings and comments

This commit is contained in:
Henrik Lissner 2019-05-01 19:12:52 -04:00
parent 4aa65aa019
commit 6d314c2795
No known key found for this signature in database
GPG key ID: 5F6C0EA160557395
17 changed files with 276 additions and 189 deletions

View file

@ -6,15 +6,17 @@
emacs-version)))
(defvar doom-debug-mode (or (getenv "DEBUG") init-file-debug)
"If non-nil, all doom functions will be verbose. Set DEBUG=1 in the command
line or use --debug-init to enable this.")
"If non-nil, Doom will log more.
Use `doom/toggle-debug-mode' to toggle it. The --debug-init flag and setting the
DEBUG envvar will enable this at startup.")
;;
;;; Constants
(defconst doom-version "2.0.9"
"Current version of DOOM emacs.")
"Current version of Doom Emacs.")
(defconst EMACS26+ (> emacs-major-version 25))
(defconst EMACS27+ (> emacs-major-version 26))
@ -28,35 +30,39 @@ line or use --debug-init to enable this.")
;;
(defvar doom-emacs-dir
(eval-when-compile (file-truename user-emacs-directory))
"The path to this emacs.d directory. Must end in a slash.")
"The path to the currently loaded .emacs.d directory. Must end with a slash.")
(defvar doom-core-dir (concat doom-emacs-dir "core/")
"The root directory of core Doom files.")
"The root directory of Doom's core files. Must end with a slash.")
(defvar doom-modules-dir (concat doom-emacs-dir "modules/")
"The root directory for Doom's modules.")
"The root directory for Doom's modules. Must end with a slash.")
(defvar doom-local-dir (concat doom-emacs-dir ".local/")
"Root directory for local Emacs files. Use this as permanent storage for files
that are safe to share across systems (if this config is symlinked across
several computers).")
"Root directory for local storage.
Use this as a storage location for this system's installation of Doom Emacs.
These files should not be shared across systems. By default, it is used by
`doom-etc-dir' and `doom-cache-dir'. Must end with a slash.")
(defvar doom-etc-dir (concat doom-local-dir "etc/")
"Directory for non-volatile storage.
"Directory for non-volatile local storage.
Use this for files that don't change much, like servers binaries, external
dependencies or long-term shared data.")
Use this for files that don't change much, like server binaries, external
dependencies or long-term shared data. Must end with a slash.")
(defvar doom-cache-dir (concat doom-local-dir "cache/")
"Directory for volatile storage.
"Directory for volatile local storage.
Use this for files that change often, like cache files.")
Use this for files that change often, like cache files. Must end with a slash.")
(defvar doom-packages-dir (concat doom-local-dir "packages/")
"Where package.el and quelpa plugins (and their caches) are stored.")
"Where package.el and quelpa plugins (and their caches) are stored.
Must end with a slash.")
(defvar doom-docs-dir (concat doom-emacs-dir "docs/")
"Where the Doom manual is stored.")
"Where Doom's documentation files are stored. Must end with a slash.")
(defvar doom-private-dir
(or (getenv "DOOMDIR")
@ -66,37 +72,44 @@ Use this for files that change often, like cache files.")
"~/.config"))))
(if (file-directory-p xdg-path) xdg-path))
"~/.doom.d/")
"Where your private customizations are placed. Must end in a slash. Respects
XDG directory conventions if ~/.config/doom exists.")
"Where your private configuration is placed.
Defaults to ~/.config/doom, ~/.doom.d or the value of the DOOMDIR envvar;
whichever is found first. Must end in a slash.")
(defvar doom-autoload-file (concat doom-local-dir "autoloads.el")
"Where `doom-reload-doom-autoloads' will generate its core autoloads file.")
"Where `doom-reload-doom-autoloads' stores its core autoloads.
This file is responsible for informing Emacs where to find all of Doom's
autoloaded core functions (in core/autoload/*.el).")
(defvar doom-package-autoload-file (concat doom-local-dir "autoloads.pkg.el")
"Where `doom-reload-package-autoloads' will generate its package.el autoloads
file.")
"Where `doom-reload-package-autoloads' stores its package.el autoloads.
This file is compiled from the autoloads files of all installed packages
combined.")
(defvar doom-env-file (concat doom-local-dir "env")
"The location of your env file, generated by `doom env refresh`.
"The location of your envvar file, generated by `doom env refresh`.
This file contains environment variables scraped from your non and interactive
shell environment, and is loaded at startup (if it exist)s. This is helpful if
Emacs can't (easily) be launched from the correct shell session (particular for
MacOS users).")
This file contains environment variables scraped from your shell environment,
which is loaded at startup (if it exists). This is helpful if Emacs can't
(easily) be launched from the correct shell session (particularly for MacOS
users).")
;;
;;; Doom core variables
(defvar doom-init-p nil
"Non-nil if `doom-initialize' has run.")
"Non-nil if Doom has been initialized.")
(defvar doom-init-time nil
"The time it took, in seconds, for DOOM Emacs to initialize.")
"The time it took, in seconds, for Doom Emacs to initialize.")
(defvar doom-emacs-changed-p nil
"If non-nil, the running version of Emacs is different from the first time
Doom was setup, which can cause problems.")
Doom was setup, which may cause problems.")
(defvar doom-site-load-path (cons doom-core-dir load-path)
"The initial value of `load-path', before it was altered by
@ -251,9 +264,10 @@ original value of `symbol-file'."
#'doom-try-run-hook))
(add-hook 'hack-local-variables-hook #'doom|run-local-var-hooks)
;; If `enable-local-variables' is disabled, then `hack-local-variables-hook' is
;; never triggered.
(defun doom|run-local-var-hooks-if-necessary ()
"If `enable-local-variables' is disabled, then `hack-local-variables-hook' is
never triggered."
"Run `doom|run-local-var-hooks' if `enable-local-variables' is disabled."
(unless enable-local-variables
(doom|run-local-var-hooks)))
(add-hook 'after-change-major-mode-hook #'doom|run-local-var-hooks-if-necessary)
@ -265,7 +279,8 @@ never triggered."
(defvar doom-incremental-packages '(t)
"A list of packages to load incrementally after startup. Any large packages
here may cause noticable pauses, so it's recommended you break them up into
sub-packages. For example, `org' is comprised of many packages, and can be broken up into:
sub-packages. For example, `org' is comprised of many packages, and can be
broken up into:
(doom-load-packages-incrementally
'(calendar find-func format-spec org-macs org-compat
@ -507,7 +522,7 @@ to least)."
(doom-initialize noninteractive)
(unless noninteractive
(doom-initialize-modules))
(after! package
(with-eval-after-load 'package
(require 'core-packages)
(doom-initialize-packages))