General refactor & cleanup
This commit is contained in:
parent
633e693cab
commit
816df321a5
15 changed files with 34 additions and 41 deletions
|
@ -212,13 +212,12 @@ Body forms can access the hook's arguments through the let-bound variable
|
|||
mode modes match files))))))
|
||||
|
||||
|
||||
;; Provides a centralized configuration system that a) won't evaluate its
|
||||
;; arguments if it doesn't need to (performance), b) won't complain if the
|
||||
;; setting doesn't exist and c) is more elegant than a bunch of `after!' blocks,
|
||||
;; which can cause intermittent stuttering in large quantities. I'm a fan of
|
||||
;; concise, do-what-I-mean front-facing configuration, believe it or not.
|
||||
;; I'm a fan of concise, hassle-free front-facing configuration. Rather than
|
||||
;; littering my config with `after!' blocks, these two macros offer a faster and
|
||||
;; more robust alternative. The motivation: to facilitate concise cross-module
|
||||
;; configuration.
|
||||
;;
|
||||
;; Plus, it can benefit from byte-compilation.
|
||||
;; It also benefits from byte-compilation.
|
||||
(defvar doom-settings nil)
|
||||
|
||||
(defmacro def-setting! (keyword arglist &optional docstring &rest forms)
|
||||
|
|
|
@ -260,8 +260,8 @@ include all modules, enabled or otherwise."
|
|||
(error "doom-modules is uninitialized")))
|
||||
|
||||
(defun doom--module-paths (&optional append-file)
|
||||
"Returns a list of absolute file paths to modules, with APPEND-FILE added, if
|
||||
the file exists."
|
||||
"Returns a list of absolute file paths to activated modules, with APPEND-FILE
|
||||
added, if the file exists."
|
||||
(let (paths)
|
||||
(dolist (pair (doom--module-pairs) (nreverse paths))
|
||||
(let ((path (doom-module-path (car pair) (cdr pair) append-file)))
|
||||
|
|
|
@ -38,11 +38,9 @@
|
|||
|
||||
(fset #'yes-or-no-p #'y-or-n-p) ; y/n instead of yes/no
|
||||
|
||||
;; Ask for confirmation when trying to kill emacs or close a frame that has real
|
||||
;; buffers open in it.
|
||||
(defun doom-quit-p (&optional prompt)
|
||||
"Return t if this session should be killed; prompts the user for
|
||||
confirmation."
|
||||
"Return t if this session should be killed, but not before it prompts the user
|
||||
for confirmation."
|
||||
(interactive)
|
||||
(if (ignore-errors (doom-real-buffers-list))
|
||||
(or (yes-or-no-p (format "››› %s" (or prompt "Quit Emacs?")))
|
||||
|
@ -62,7 +60,7 @@ confirmation."
|
|||
;; A minor mode for toggling the mode-line
|
||||
(defvar-local doom--modeline-format nil
|
||||
"The modeline format to use when `doom-hide-modeline-mode' is active. Don't
|
||||
set this directly. Bind it in `let' instead.")
|
||||
set this directly. Let-bind it instead.")
|
||||
(defvar-local doom--old-modeline-format nil
|
||||
"The old modeline format, so `doom-hide-modeline-mode' can revert when it's
|
||||
disabled.")
|
||||
|
@ -141,10 +139,8 @@ mode is detected.")
|
|||
;; draw me like one of your French editors
|
||||
(tooltip-mode -1) ; relegate tooltips to echo area only
|
||||
(menu-bar-mode -1)
|
||||
(when (fboundp 'tool-bar-mode)
|
||||
(tool-bar-mode -1))
|
||||
(when (fboundp 'scroll-bar-mode)
|
||||
(scroll-bar-mode -1))
|
||||
(if (fboundp 'tool-bar-mode) (tool-bar-mode -1))
|
||||
(if (fboundp 'scroll-bar-mode) (scroll-bar-mode -1))
|
||||
|
||||
;; buffer name in frame title
|
||||
(setq-default frame-title-format '("DOOM Emacs"))
|
||||
|
|
|
@ -165,7 +165,7 @@ enable multiple minor modes for the same regexp.")
|
|||
(string-match-p (regexp-quote remote-id) name))
|
||||
(setq name (substring name (match-end 0))))
|
||||
(while (and alist (caar alist) (cdar alist))
|
||||
(if (string-match (caar alist) name)
|
||||
(if (string-match-p (caar alist) name)
|
||||
(funcall (cdar alist) 1))
|
||||
(setq alist (cdr alist))))))
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue