diff --git a/core/core-lib.el b/core/core-lib.el index d11674f8b..445efc706 100644 --- a/core/core-lib.el +++ b/core/core-lib.el @@ -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) diff --git a/core/core-packages.el b/core/core-packages.el index fd8131ef9..393d74549 100644 --- a/core/core-packages.el +++ b/core/core-packages.el @@ -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))) diff --git a/core/core-ui.el b/core/core-ui.el index 3265775b9..6253a8173 100644 --- a/core/core-ui.el +++ b/core/core-ui.el @@ -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")) diff --git a/core/core.el b/core/core.el index 0cb83ee6e..7b72c15f1 100644 --- a/core/core.el +++ b/core/core.el @@ -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)))))) diff --git a/modules/feature/evil/config.el b/modules/feature/evil/config.el index 557953bc2..559c8e81f 100644 --- a/modules/feature/evil/config.el +++ b/modules/feature/evil/config.el @@ -25,7 +25,8 @@ (autoload 'goto-last-change "goto-chg") (autoload 'goto-last-change-reverse "goto-chg") -(def-package! evil :demand t +(def-package! evil + :demand t :init (setq evil-want-C-u-scroll t evil-want-visual-char-semi-exclusive t diff --git a/modules/feature/workspaces/config.el b/modules/feature/workspaces/config.el index 58ce7ea11..d90b139e1 100644 --- a/modules/feature/workspaces/config.el +++ b/modules/feature/workspaces/config.el @@ -1,16 +1,16 @@ ;;; feature/workspaces/config.el -*- lexical-binding: t; -*- ;; `persp-mode' gives me workspaces, a workspace-restricted `buffer-list', and -;; file-based session persistence. I had used workgroups2 before this, but -;; abandoned it because of its instability and impact on performance. -;; `persp-mode' has proven faster and more reliable (and it's still maintained). +;; file-based session persistence. I used workgroups2 before this, but abandoned +;; it because it was unstable and slow; `persp-mode' is neither (and still +;; maintained). ;; -;; By default, sessions are auto-saved, but not auto-loaded. Use :ss or +;; By default, sessions are autosaved, but not autoloaded. Use :ss or ;; `+workspace/save-session' to save, and :sl or `+workspace/load-session' to ;; load the last autosaved session. You can give sessions a custom name so they -;; can be loaded much later. +;; can be loaded later. ;; -;; Note: persp-mode requires `workgroups' for file persistence in Emacs 24.4. +;; FYI persp-mode requires `workgroups' for file persistence in Emacs 24.4. (defvar +workspaces-load-session-hook nil "A hook that runs when persp loads a new session.") diff --git a/modules/lang/org/autoload/attach.el b/modules/lang/org/autoload/attach.el index 43922f212..2655de513 100644 --- a/modules/lang/org/autoload/attach.el +++ b/modules/lang/org/autoload/attach.el @@ -26,8 +26,7 @@ (user-error "Not an org buffer")) (org-save-outline-visibility nil (let ((attachments '()) - element - file) + element) (when (and (file-directory-p org-attach-directory) (> (length (file-expand-wildcards (expand-file-name "*" org-attach-directory))) 0)) (save-excursion diff --git a/modules/lang/org/autoload/evil.el b/modules/lang/org/autoload/evil.el index f487c1192..7787b95cd 100644 --- a/modules/lang/org/autoload/evil.el +++ b/modules/lang/org/autoload/evil.el @@ -1,10 +1,10 @@ ;;; lang/org/autoload/evil.el -*- lexical-binding: t; -*- ;;;###autoload (autoload '+org:capture "lang/org/autoload/evil" nil t) -(evil-define-operator +org:capture (&optional beg end bang) +(evil-define-operator +org:capture (&optional beg end) "Send a selection to `doom/org-capture'." :move-point nil :type inclusive - (interactive "") + (interactive "") (org-capture-string (when (and (evil-visual-state-p) beg end) (buffer-substring beg end)))) diff --git a/modules/lang/org/autoload/org.el b/modules/lang/org/autoload/org.el index 8f0563633..d62258553 100644 --- a/modules/lang/org/autoload/org.el +++ b/modules/lang/org/autoload/org.el @@ -155,8 +155,7 @@ fragments, opening links, or refreshing images." (interactive) (let* ((scroll-pt (window-start)) (context (org-element-context)) - (type (org-element-type context)) - (value (org-element-property :value context))) + (type (org-element-type context))) (cond ((memq type '(planning timestamp)) (org-follow-timestamp-link)) diff --git a/modules/lang/org/autoload/util.el b/modules/lang/org/autoload/util.el index adcd5fa07..71c155380 100644 --- a/modules/lang/org/autoload/util.el +++ b/modules/lang/org/autoload/util.el @@ -1,7 +1,7 @@ ;;; lang/org/autoload/util.el -*- lexical-binding: t; -*- ;;;###autoload -(defun +org-get-property (name &optional file) +(defun +org-get-property (name &optional _file) ; TODO Add FILE "Get a propery from an org file." (save-excursion (goto-char 1) diff --git a/modules/lang/org/config.el b/modules/lang/org/config.el index dcb338410..11c4a03cf 100644 --- a/modules/lang/org/config.el +++ b/modules/lang/org/config.el @@ -388,7 +388,7 @@ (IS-LINUX "xdg-open \"%s\""))))) ;; Remove highlights on ESC - (defun +org|remove-occur-highlights (&rest args) + (defun +org|remove-occur-highlights () (when (derived-mode-p 'org-mode) (org-remove-occur-highlights) t)) diff --git a/modules/private/hlissner/+bindings.el b/modules/private/hlissner/+bindings.el index 61fe11755..780988de9 100644 --- a/modules/private/hlissner/+bindings.el +++ b/modules/private/hlissner/+bindings.el @@ -631,7 +631,7 @@ :n "SPC" #'vc-annotate-show-log-revision-at-line :n "]]" #'vc-annotate-next-revision :n "[[" #'vc-annotate-prev-revision - :n [tab] #'vc-annotate-toggle-annotation-visibility + :n "TAB" #'vc-annotate-toggle-annotation-visibility :n "RET" #'vc-annotate-find-revision-at-line)) diff --git a/modules/tools/password-store/autoload.el b/modules/tools/password-store/autoload.el index 5324fafaa..6cb829860 100644 --- a/modules/tools/password-store/autoload.el +++ b/modules/tools/password-store/autoload.el @@ -10,7 +10,6 @@ (t (pass)))) - ;;;###autoload (defun +pass-get-field (entry fields) (if-let (data (if (listp entry) entry (auth-pass-parse-entry entry))) @@ -25,12 +24,11 @@ ;;;###autoload (defun +pass-get-secret (entry) - (password-store-get entry)) + (+pass-get-field entry 'secret)) (defun +pass-ivy-action--open-url (entry) (if-let (url (+pass-get-field entry +pass-url-fields)) - (and (or (string-prefix-p "http://" url) - (string-prefix-p "https://" url) + (and (or (string-match-p "https?://" url) (error "Field for %s doesn't look like an url" item)) (browse-url url)) (error "Username not found."))) diff --git a/modules/ui/doom-dashboard/config.el b/modules/ui/doom-dashboard/config.el index fd2ea728e..dcfdfc400 100644 --- a/modules/ui/doom-dashboard/config.el +++ b/modules/ui/doom-dashboard/config.el @@ -103,8 +103,9 @@ whose dimensions may not be fully initialized by the time this is run." (with-current-buffer (doom-fallback-buffer) (read-only-mode +1) (+doom-dashboard-mode) - (setq fringe-indicator-alist (cl-loop for (car . _cdr) in fringe-indicator-alist - collect (cons car nil))) + (setq fringe-indicator-alist + (cl-loop for (car . _cdr) in fringe-indicator-alist + collect (cons car nil))) (erase-buffer) (let* ((window (get-buffer-window (doom-fallback-buffer))) (+doom-dashboard--width (window-width window)) diff --git a/modules/ui/doom/config.el b/modules/ui/doom/config.el index 9a2f7f35f..c389b9643 100644 --- a/modules/ui/doom/config.el +++ b/modules/ui/doom/config.el @@ -71,7 +71,7 @@ "Ensure the fringe settings are maintained on popup restore." (neo-global--when-window (doom--neotree-no-fringes))) - (add-hook 'doom-popup-mode-hook #'+doom|neotree-fix-popup nil t))) + (add-hook 'doom-popup-mode-hook #'+doom|neotree-fix-popup))) (def-package! solaire-mode