General refactor for consistency & idempotency

Also updated comments
This commit is contained in:
Henrik Lissner
2018-05-18 01:21:09 +02:00
parent 50401f6c09
commit 80adb9c1f6
17 changed files with 48 additions and 40 deletions

View File

@@ -1,6 +1,5 @@
;;; core/autoload/ui.el -*- lexical-binding: t; -*-
(defvar doom--line-number-style doom-line-numbers-style)
;;;###autoload
(defun doom/toggle-line-numbers ()
"Toggle line numbers.
@@ -10,6 +9,7 @@ Cycles through regular, relative and no line numbers. The order depends on what
Uses `display-line-numbers' in Emacs 26+ and `nlinum-mode' everywhere else."
(interactive)
(defvar doom--line-number-style doom-line-numbers-style)
(let* ((styles '(t relative nil))
(order (cons doom-line-numbers-style (delq doom-line-numbers-style styles)))
(queue (memq doom--line-number-style order))

View File

@@ -225,7 +225,7 @@ Body forms can access the hook's arguments through the let-bound variable
(,mode 1)))
,@(if (and modes (listp modes))
(cl-loop for hook in (doom--resolve-hook-forms modes)
collect `(add-hook ',hook ',hook-name))
collect `(add-hook ',hook #',hook-name))
`((add-hook 'after-change-major-mode-hook ',hook-name))))))
(match
`(map-put doom-auto-minor-mode-alist ,match ',mode))

View File

@@ -419,11 +419,17 @@ added, if the file exists."
;;
;; Module config macros
;; Use-package modifications
;;
(autoload 'use-package "use-package" nil nil 'macro)
;;
;; Module config macros
;;
(defmacro doom! (&rest modules)
"Bootstraps DOOM Emacs and its modules.

View File

@@ -67,8 +67,7 @@ XDG directory conventions if ~/.config/doom exists.")
(setq-default
ad-redefinition-action 'accept ; silence advised function warnings
apropos-do-all t ; make `apropos' more useful
debug-on-error (and (not noninteractive) doom-debug-mode)
load-prefer-newer noninteractive
debug-on-error doom-debug-mode
ffap-machine-p-known 'reject ; don't ping things that look like domain names
idle-update-delay 2 ; update ui less often
;; keep the point out of the minibuffer
@@ -83,8 +82,9 @@ XDG directory conventions if ~/.config/doom exists.")
auto-save-list-file-name (concat doom-cache-dir "autosave")
backup-directory-alist (list (cons "." (concat doom-cache-dir "backup/")))
custom-file (concat doom-etc-dir "custom.el")
pcache-directory (concat doom-cache-dir "pcache/")
mc/list-file (concat doom-etc-dir "mc-lists.el")
pcache-directory (concat doom-cache-dir "pcache/")
request-storage-directory (concat doom-cache-dir "request")
server-auth-dir (concat doom-cache-dir "server/")
shared-game-score-directory (concat doom-etc-dir "shared-game-score/")
tramp-auto-save-directory (concat doom-cache-dir "tramp-auto-save/")