Minor refactor & reformatting across the board

This commit is contained in:
Henrik Lissner 2020-02-23 15:41:49 -05:00
parent 80c827119d
commit b30f38ac06
No known key found for this signature in database
GPG key ID: 5F6C0EA160557395
8 changed files with 49 additions and 50 deletions

View file

@ -100,6 +100,15 @@ ready to be pasted in a bug report on github."
"package!")) "package!"))
(error (format "<%S>" e))) (error (format "<%S>" e)))
'("n/a"))) '("n/a")))
(unpin
,@(or (condition-case e
(mapcan #'identity
(mapcar
#'cdr (doom--collect-forms-in
(doom-path doom-private-dir "packages.el")
"unpin!")))
(error (format "<%S>" e)))
'("n/a")))
(elpa (elpa
,@(or (condition-case e ,@(or (condition-case e
(progn (progn
@ -107,14 +116,6 @@ ready to be pasted in a bug report on github."
(cl-loop for (name . _) in package-alist (cl-loop for (name . _) in package-alist
collect (format "%s" name))) collect (format "%s" name)))
(error (format "<%S>" e))) (error (format "<%S>" e)))
'("n/a")))
(unpin ,@(or (condition-case e
(mapcan #'identity
(mapcar
#'cdr (doom--collect-forms-in
(doom-path doom-private-dir "packages.el")
"unpin!")))
(error (format "<%S>" e)))
'("n/a")))))))) '("n/a"))))))))
@ -216,7 +217,7 @@ markdown and copies it to your clipboard, ready to be pasted into bug reports!"
(prin1-to-string (prin1-to-string
(macroexp-progn (macroexp-progn
(append `((setq noninteractive nil (append `((setq noninteractive nil
doom-debug-mode t init-file-debug t
load-path ',load-path load-path ',load-path
package--init-file-ensured t package--init-file-ensured t
package-user-dir ,package-user-dir package-user-dir ,package-user-dir

View file

@ -411,7 +411,7 @@
"C-S-h" #'company-show-doc-buffer "C-S-h" #'company-show-doc-buffer
"C-s" #'company-search-candidates "C-s" #'company-search-candidates
"M-s" #'company-filter-candidates "M-s" #'company-filter-candidates
"<C-tab>" #'company-complete-common-or-cycle [C-tab] #'company-complete-common-or-cycle
[tab] #'company-complete-common-or-cycle [tab] #'company-complete-common-or-cycle
[backtab] #'company-select-previous [backtab] #'company-select-previous
"C-RET" #'counsel-company "C-RET" #'counsel-company

View file

@ -126,17 +126,26 @@ directives. By default, this only recognizes C directives.")
(count-lines (point-min) (point-max)) (count-lines (point-min) (point-max))
(buffer-size))))) (buffer-size)))))
;; '=' moves the cursor to the beginning of selection. Disable this, since ;; HACK '=' moves the cursor to the beginning of selection. Disable this,
;; it's more disruptive than helpful. ;; since it's more disruptive than helpful.
(defadvice! +evil--dont-move-cursor-a (orig-fn &rest args) (defadvice! +evil--dont-move-cursor-a (orig-fn &rest args)
:around #'evil-indent :around #'evil-indent
(save-excursion (apply orig-fn args))) (save-excursion (apply orig-fn args)))
;; In evil, registers 2-9 are buffer-local. In vim, they're global, so... ;; REVIEW In evil, registers 2-9 are buffer-local. In vim, they're global,
;; so... Perhaps this should be PRed upstream?
(defadvice! +evil--make-numbered-markers-global-a (char) (defadvice! +evil--make-numbered-markers-global-a (char)
:after-until #'evil-global-marker-p :after-until #'evil-global-marker-p
(and (>= char ?2) (<= char ?9))) (and (>= char ?2) (<= char ?9)))
;; REVIEW Fix #2493: dir-locals cannot target fundamental-mode when evil-mode
;; is active. See https://github.com/hlissner/doom-emacs/issues/2493.
;; Revert this if this is ever fixed upstream.
(defadvice! +evil--fix-local-vars-a (&rest _)
:before #'turn-on-evil-mode
(when (eq major-mode 'fundamental-mode)
(hack-local-variables)))
;; Make ESC (from normal mode) the universal escaper. See `doom-escape-hook'. ;; Make ESC (from normal mode) the universal escaper. See `doom-escape-hook'.
(advice-add #'evil-force-normal-state :after #'+evil-escape-a) (advice-add #'evil-force-normal-state :after #'+evil-escape-a)
@ -156,14 +165,6 @@ directives. By default, this only recognizes C directives.")
(advice-add #'evil-open-above :around #'+evil--insert-newline-above-and-respect-comments-a) (advice-add #'evil-open-above :around #'+evil--insert-newline-above-and-respect-comments-a)
(advice-add #'evil-open-below :around #'+evil--insert-newline-below-and-respect-comments-a) (advice-add #'evil-open-below :around #'+evil--insert-newline-below-and-respect-comments-a)
;; REVIEW Fix #2493: dir-locals cannot target fundamental-mode when evil-mode
;; is active. See https://github.com/hlissner/doom-emacs/issues/2493.
;; Revert this if this is ever fixed upstream.
(defadvice! +evil--fix-local-vars-a (&rest _)
:before #'turn-on-evil-mode
(when (eq major-mode 'fundamental-mode)
(hack-local-variables)))
;; Recenter screen after most searches ;; Recenter screen after most searches
(dolist (fn '(evil-visualstar/begin-search-forward (dolist (fn '(evil-visualstar/begin-search-forward
evil-visualstar/begin-search-backward evil-visualstar/begin-search-backward
@ -404,11 +405,11 @@ To change these keys see `+evil-repeat-keys'."
;; `evil-collection' ;; `evil-collection'
(when (featurep! +everywhere) (when (featurep! +everywhere)
(setq evil-collection-company-use-tng (featurep! :completion company +tng))
(unless doom-reloading-p (unless doom-reloading-p
(load! "+everywhere")) (load! "+everywhere"))
(setq evil-collection-company-use-tng (featurep! :completion company +tng))
;; Don't let evil-collection interfere with certain keys ;; Don't let evil-collection interfere with certain keys
(appendq! evil-collection-key-blacklist (appendq! evil-collection-key-blacklist
(append (when (featurep! :tools lookup) (append (when (featurep! :tools lookup)

View file

@ -29,7 +29,7 @@
hs-set-up-overlay #'+fold-hideshow-set-up-overlay-fn) hs-set-up-overlay #'+fold-hideshow-set-up-overlay-fn)
(defadvice! +fold--hideshow-ensure-mode-a (&rest _) (defadvice! +fold--hideshow-ensure-mode-a (&rest _)
"Ensure `hs-minor-mode' is enabled." "Ensure `hs-minor-mode' is enabled when we need it, no sooner or later."
:before '(hs-toggle-hiding hs-hide-block hs-hide-level hs-show-all hs-hide-all) :before '(hs-toggle-hiding hs-hide-block hs-hide-level hs-show-all hs-hide-all)
(unless (bound-and-true-p hs-minor-mode) (unless (bound-and-true-p hs-minor-mode)
(hs-minor-mode +1))) (hs-minor-mode +1)))

View file

@ -16,8 +16,7 @@
(use-package! cider (use-package! cider
;; NOTE: if you don't have an org directory set (the dir doesn't exist), cider ;; NOTE if `org-directory' doesn't exist, `cider-jack' in won't work
;; jack in won't work.
:hook (clojure-mode-local-vars . cider-mode) :hook (clojure-mode-local-vars . cider-mode)
:init :init
(after! clojure-mode (after! clojure-mode

View file

@ -8,19 +8,22 @@
;; ;;
;; packages ;; packages
;;;###package lisp-mode
(defvar inferior-lisp-program "sbcl") (defvar inferior-lisp-program "sbcl")
(add-hook 'lisp-mode-hook #'rainbow-delimiters-mode)
(after! lisp-mode
(use-package! sly
:defer t
:init
(after! lisp-mode
(set-repl-handler! 'lisp-mode #'sly-mrepl) (set-repl-handler! 'lisp-mode #'sly-mrepl)
(set-eval-handler! 'lisp-mode #'sly-eval-region) (set-eval-handler! 'lisp-mode #'sly-eval-region)
(set-lookup-handlers! 'lisp-mode (set-lookup-handlers! 'lisp-mode
:definition #'sly-edit-definition :definition #'sly-edit-definition
:documentation #'sly-describe-symbol) :documentation #'sly-describe-symbol))
(add-hook 'lisp-mode-hook #'rainbow-delimiters-mode)) :config
(after! sly
(setq sly-mrepl-history-file-name (concat doom-cache-dir "sly-mrepl-history") (setq sly-mrepl-history-file-name (concat doom-cache-dir "sly-mrepl-history")
sly-kill-without-query-p t sly-kill-without-query-p t
sly-net-coding-system 'utf-8-unix sly-net-coding-system 'utf-8-unix
@ -133,4 +136,4 @@
(use-package! sly-repl-ansi-color (use-package! sly-repl-ansi-color
:defer t :defer t
:init :init
(add-to-list 'sly-contribs 'sly-repl-ansi-color nil #'eq)) (add-to-list 'sly-contribs 'sly-repl-ansi-color))

View file

@ -52,10 +52,6 @@ Is relative to `org-directory', unless it is absolute. Is used in Doom's default
(defvar +org-initial-fold-level 2 (defvar +org-initial-fold-level 2
"The initial fold level of org files when no #+STARTUP options for it.") "The initial fold level of org files when no #+STARTUP options for it.")
(defvar +org-export-directory ".export/"
"Where to store exported files relative to `org-directory'. Can be an absolute
path too.")
(defvar +org-habit-graph-padding 2 (defvar +org-habit-graph-padding 2
"The padding added to the end of the consistency graph") "The padding added to the end of the consistency graph")
@ -238,8 +234,7 @@ path too.")
:override #'org-babel-do-load-languages :override #'org-babel-do-load-languages
(message (message
(concat "`org-babel-do-load-languages' is redundant with Doom's lazy loading mechanism for babel " (concat "`org-babel-do-load-languages' is redundant with Doom's lazy loading mechanism for babel "
"packages. There is no need to use it, so it has been disabled"))) "packages. There is no need to use it, so it has been disabled"))))
)
(defun +org-init-capture-defaults-h () (defun +org-init-capture-defaults-h ()

View file

@ -11,9 +11,9 @@
diffing, even for unsaved buffers.") diffing, even for unsaved buffers.")
(defvar +vc-gutter-default-style t (defvar +vc-gutter-default-style t
"If non-nil, enable the default look of the vc gutter. This means subtle thin "If non-nil, enable the default look of the vc gutter.
bitmaps on the left, an arrow bitmap for flycheck, and flycheck indicators moved This means subtle thin bitmaps on the left, an arrow bitmap for flycheck, and
to the right fringe.") flycheck indicators moved to the right fringe.")
;; ;;
@ -58,9 +58,6 @@ is deferred until the file is saved. Respects `git-gutter:disabled-modes'."
;; assigned. I don't know why this is the case, but adding `fundamental-mode' ;; assigned. I don't know why this is the case, but adding `fundamental-mode'
;; here fixes the issue. ;; here fixes the issue.
(setq git-gutter:disabled-modes '(fundamental-mode image-mode pdf-view-mode)) (setq git-gutter:disabled-modes '(fundamental-mode image-mode pdf-view-mode))
;; standardize default fringe width
(if (fboundp 'fringe-mode) (fringe-mode '4))
:config :config
(set-popup-rule! "^\\*git-gutter" :select nil :size '+popup-shrink-to-fit) (set-popup-rule! "^\\*git-gutter" :select nil :size '+popup-shrink-to-fit)
@ -93,6 +90,9 @@ is deferred until the file is saved. Respects `git-gutter:disabled-modes'."
;; subtle diff indicators in the fringe ;; subtle diff indicators in the fringe
(when +vc-gutter-default-style (when +vc-gutter-default-style
;; standardize default fringe width
(if (fboundp 'fringe-mode) (fringe-mode '4))
(after! git-gutter-fringe (after! git-gutter-fringe
;; places the git gutter outside the margins. ;; places the git gutter outside the margins.
(setq-default fringes-outside-margins t) (setq-default fringes-outside-margins t)