Minor refactoring across the board

This commit is contained in:
Henrik Lissner 2021-05-23 21:48:38 -04:00
parent a8e57438dc
commit 3ba364ae10
12 changed files with 63 additions and 48 deletions

View file

@ -77,9 +77,10 @@ Detects evil visual mode as well."
"Return beginning position of selection.
Uses `evil-visual-beginning' if available."
(declare (side-effect-free t))
(if (bound-and-true-p evil-local-mode)
evil-visual-beginning
(region-beginning)))
(or (and (bound-and-true-p evil-local-mode)
(markerp evil-visual-beginning)
(marker-position evil-visual-beginning))
(region-beginning)))
;;;###autoload
(defun doom-region-end ()

View file

@ -14,7 +14,6 @@ one wants that.")
(defvar doom-autoloads-cached-vars
'(doom-modules
doom-disabled-packages
comp-deferred-compilation-deny-list
native-comp-deferred-compilation-deny-list
load-path
auto-mode-alist

View file

@ -68,7 +68,7 @@ list remains lean."
"git" "log" "--oneline" "--no-merges"
"-n" "26" end-ref (concat "^" (regexp-quote start-ref)))
(if success
(let* ((output (string-trim-right stdout))
(let* ((output (string-trim-right (or stdout "")))
(lines (split-string output "\n")))
(if (> (length lines) 25)
(concat (string-join (butlast lines 1) "\n") "\n[...]")

View file

@ -154,10 +154,19 @@ uses a straight or package.el command directly).")
(defun doom--ensure-core-packages (packages)
(doom-log "Installing core packages")
(dolist (package packages)
(let ((name (car package)))
(let* ((name (car package))
(repo (symbol-name name)))
(when-let (recipe (plist-get (cdr package) :recipe))
(straight-override-recipe (cons name recipe)))
(straight-use-package name))))
(straight-override-recipe (cons name recipe))
(when-let (local-repo (plist-get recipe :local-repo))
(setq repo local-repo)))
;; Only clone the package, don't build them. Straight hasn't been fully
;; configured by this point.
(straight-use-package name nil t)
;; In case the package hasn't been built yet.
(or (member (directory-file-name (straight--build-dir "straight"))
load-path)
(add-to-list 'load-path (directory-file-name (straight--repos-dir repo)))))))
(defun doom-initialize-core-packages (&optional force-p)
"Ensure `straight' is installed and was compiled with this version of Emacs."

View file

@ -414,8 +414,8 @@ windows, switch to `doom-fallback-buffer'. Otherwise, delegate to original
;; which users expect to control hl-line in Emacs.
(define-globalized-minor-mode global-hl-line-mode hl-line-mode
(lambda ()
(and (not hl-line-mode)
(cond ((null global-hl-line-modes) nil)
(and (cond (hl-line-mode nil)
((null global-hl-line-modes) nil)
((eq global-hl-line-modes t))
((eq (car global-hl-line-modes) 'not)
(not (derived-mode-p global-hl-line-modes)))