Improve idempotency of Doom config (in case of reloading)

This commit is contained in:
Henrik Lissner 2018-05-14 20:54:57 +02:00
parent 48cb10a9cc
commit 67dab98859
No known key found for this signature in database
GPG key ID: 5F6C0EA160557395
4 changed files with 18 additions and 17 deletions

View file

@ -1020,7 +1020,7 @@ Do not use this for configuring Doom core."
(defun ,fn ,arglist (defun ,fn ,arglist
,docstring ,docstring
,@forms) ,@forms)
(cl-pushnew ',(cons keyword fn) doom-settings :test #'eq :key #'car)))) (map-put doom-settings ,keyword #',fn))))
(defmacro set! (keyword &rest values) (defmacro set! (keyword &rest values)
"Set an option defined by `def-setting!'. Skip if doesn't exist. See "Set an option defined by `def-setting!'. Skip if doesn't exist. See

View file

@ -15,7 +15,7 @@
:config :config
(helm-mode +1) (helm-mode +1)
;; helm is too heavy for find-file-at-point ;; helm is too heavy for find-file-at-point
(add-to-list 'helm-completing-read-handlers-alist '(find-file-at-point . nil))) (map-put helm-completing-read-handlers-alist 'find-file-at-point nilk))
(def-package! helm (def-package! helm

View file

@ -48,7 +48,7 @@ immediately runs it on the current candidate (ending the ivy session)."
ivy-use-selectable-prompt t) ivy-use-selectable-prompt t)
(after! magit (setq magit-completing-read-function #'ivy-completing-read)) (after! magit (setq magit-completing-read-function #'ivy-completing-read))
(after! yasnippet (push #'+ivy-yas-prompt yas-prompt-functions)) (after! yasnippet (cl-pushnew #'+ivy-yas-prompt yas-prompt-functions :test #'eq))
(map! [remap switch-to-buffer] #'ivy-switch-buffer (map! [remap switch-to-buffer] #'ivy-switch-buffer
[remap persp-switch-to-buffer] #'+ivy/switch-workspace-buffer [remap persp-switch-to-buffer] #'+ivy/switch-workspace-buffer
@ -202,13 +202,13 @@ immediately runs it on the current candidate (ending the ivy session)."
'ivy-posframe-display-at-window-bottom-left 'ivy-posframe-display-at-window-bottom-left
'ivy-posframe-display-at-window-center 'ivy-posframe-display-at-window-center
'+ivy-display-at-frame-center-near-bottom)) '+ivy-display-at-frame-center-near-bottom))
(push (list fn :cleanup 'ivy-posframe-cleanup) ivy-display-functions-props)) (map-put ivy-display-functions-props fn '(:cleanup ivy-posframe-cleanup)))
(push '(t . +ivy-display-at-frame-center-near-bottom) ivy-display-functions-alist) (map-put ivy-display-functions-alist 't '+ivy-display-at-frame-center-near-bottom)
;; posframe doesn't work well with async sources ;; posframe doesn't work well with async sources
(dolist (fn '(swiper counsel-rg counsel-ag counsel-pt counsel-grep counsel-git-grep)) (dolist (fn '(swiper counsel-rg counsel-ag counsel-pt counsel-grep counsel-git-grep))
(push (cons fn nil) ivy-display-functions-alist)) (map-put ivy-display-functions-alist fn nil))
(setq ivy-height 16 (setq ivy-height 16
ivy-fixed-height-minibuffer nil ivy-fixed-height-minibuffer nil

View file

@ -220,12 +220,12 @@
(cons (format "(%s " (or (read-string "(") "")) ")")) (cons (format "(%s " (or (read-string "(") "")) ")"))
;; Add escaped-sequence support to embrace ;; Add escaped-sequence support to embrace
(push (cons ?\\ (make-embrace-pair-struct (map-put (default-value 'embrace--pairs-list)
?\\ (make-embrace-pair-struct
:key ?\\ :key ?\\
:read-function #'+evil--embrace-escaped :read-function #'+evil--embrace-escaped
:left-regexp "\\[[{(]" :left-regexp "\\[[{(]"
:right-regexp "\\[]})]")) :right-regexp "\\[]})]")))
(default-value 'embrace--pairs-list)))
(def-package! evil-escape (def-package! evil-escape
@ -307,11 +307,11 @@ the new algorithm is confusing, like in python or ruby."
;; Add custom commands to whitelisted commands ;; Add custom commands to whitelisted commands
(dolist (fn '(doom/backward-to-bol-or-indent doom/forward-to-last-non-comment-or-eol (dolist (fn '(doom/backward-to-bol-or-indent doom/forward-to-last-non-comment-or-eol
doom/backward-kill-to-bol-and-indent)) doom/backward-kill-to-bol-and-indent))
(push (cons fn '((:default . evil-mc-execute-default-call))) (map-put evil-mc-custom-known-commands
evil-mc-custom-known-commands)) fn '((:default . evil-mc-execute-default-call))))
;; disable evil-escape in evil-mc; causes unwanted text on invocation ;; disable evil-escape in evil-mc; causes unwanted text on invocation
(push 'evil-escape-mode evil-mc-incompatible-minor-modes) (cl-pushnew 'evil-escape-mode evil-mc-incompatible-minor-modes :test #'eq)
(defun +evil|escape-multiple-cursors () (defun +evil|escape-multiple-cursors ()
"Clear evil-mc cursors and restore state." "Clear evil-mc cursors and restore state."
@ -380,8 +380,9 @@ the new algorithm is confusing, like in python or ruby."
evil-forward-arg evil-backward-arg evil-forward-arg evil-backward-arg
evil-jump-out-args) evil-jump-out-args)
:config :config
(unless (member "<" evil-args-openers)
(push "<" evil-args-openers) (push "<" evil-args-openers)
(push ">" evil-args-closers)) (push ">" evil-args-closers)))
(def-package! evil-indent-plus (def-package! evil-indent-plus