diff options
author | Case Duckworth | 2021-03-12 17:32:13 -0600 |
---|---|---|
committer | Case Duckworth | 2021-03-12 17:32:13 -0600 |
commit | 884343deb4c9c7837356b27968c1e594d8730d49 (patch) | |
tree | 2005cf04dfdb5ae5a947cf4de79cd462932507d7 | |
parent | Change `acdw/hooks' form (diff) | |
download | emacs-884343deb4c9c7837356b27968c1e594d8730d49.tar.gz emacs-884343deb4c9c7837356b27968c1e594d8730d49.zip |
Add `:set', `:local', `:require' keywords to `acdw/pkg'
-rw-r--r-- | init.el | 51 | ||||
-rw-r--r-- | lisp/acdw.el | 27 |
2 files changed, 40 insertions, 38 deletions
diff --git a/init.el b/init.el index 6940b6c..c4d8664 100644 --- a/init.el +++ b/init.el | |||
@@ -199,7 +199,7 @@ | |||
199 | (icomplete-with-buffer-completion-tables t) | 199 | (icomplete-with-buffer-completion-tables t) |
200 | (icomplete-in-buffer t))) | 200 | (icomplete-in-buffer t))) |
201 | (acdw/pkg orderless | 201 | (acdw/pkg orderless |
202 | :now ((acdw/set '((completion-styles (orderless)))))) | 202 | :set '((completion-styles (orderless)))) |
203 | (acdw/pkg icomplete-vertical | 203 | (acdw/pkg icomplete-vertical |
204 | :binds (("<down>" icomplete-forward-completions | 204 | :binds (("<down>" icomplete-forward-completions |
205 | :map icomplete-minibuffer-map) | 205 | :map icomplete-minibuffer-map) |
@@ -247,15 +247,15 @@ | |||
247 | ("M-y" consult-yank-pop) | 247 | ("M-y" consult-yank-pop) |
248 | ("<f1> a" consult-apropos) | 248 | ("<f1> a" consult-apropos) |
249 | ("C-h a" consult-apropos)) | 249 | ("C-h a" consult-apropos)) |
250 | :now ((autoload 'consult-register-preview "consult") | 250 | :now ((autoload 'consult-register-preview "consult")) |
251 | (acdw/set '((register-preview-delay 0) | 251 | :set '((register-preview-delay 0) |
252 | (register-preview-function #'consult-register-preview))))) | 252 | (register-preview-function #'consult-register-preview))) |
253 | 253 | ||
254 | ;; Marginalia | 254 | ;; Marginalia |
255 | (acdw/pkg marginalia | 255 | (acdw/pkg marginalia |
256 | :now ((acdw/set '((marginalia-annotators (marginalia-annotators-heavy | 256 | :set '((marginalia-annotators (marginalia-annotators-heavy |
257 | marginalia-annotators-light)))) | 257 | marginalia-annotators-light))) |
258 | (marginalia-mode +1))) | 258 | :now ((marginalia-mode +1))) |
259 | 259 | ||
260 | ;; Imenu | 260 | ;; Imenu |
261 | (when (require 'imenu) | 261 | (when (require 'imenu) |
@@ -268,36 +268,25 @@ | |||
268 | :binds (("C-/" undo-fu-only-undo) | 268 | :binds (("C-/" undo-fu-only-undo) |
269 | ("C-?" undo-fu-only-redo))) | 269 | ("C-?" undo-fu-only-redo))) |
270 | (acdw/pkg undo-fu-session | 270 | (acdw/pkg undo-fu-session |
271 | :now ((acdw/set `((undo-fu-session-incompatible-files ("/COMMIT_EDITMSG\\'" | 271 | :set `((undo-fu-session-incompatible-files ("/COMMIT_EDITMSG\\'" |
272 | "/git-rebase-todo\\'")) | 272 | "/git-rebase-todo\\'")) |
273 | (undo-fu-session-directory ,(acdw/in-dir "undo/" t))))) | 273 | (undo-fu-session-directory ,(acdw/in-dir "undo/" t))) |
274 | :then ((global-undo-fu-session-mode +1))) | 274 | :then ((global-undo-fu-session-mode +1))) |
275 | 275 | ||
276 | ;; Modus themes | 276 | ;; Modus themes |
277 | (acdw/pkg (modus-themes | 277 | (acdw/pkg (modus-themes |
278 | :host gitlab | 278 | :host gitlab |
279 | :repo "protesilaos/modus-themes") | 279 | :repo "protesilaos/modus-themes") |
280 | :now ((acdw/set `((modus-themes-slanted-constructs t) | 280 | :set `((modus-themes-slanted-constructs t) |
281 | (modus-themes-bold-constructs t) | 281 | (modus-themes-bold-constructs t) |
282 | (modus-themes-region 'bg-only) | 282 | (modus-themes-region 'bg-only) |
283 | (modus-themes-org-blocks 'grayscale) | 283 | (modus-themes-org-blocks 'grayscale) |
284 | (modus-themes-headings ((1 . section) | 284 | (modus-themes-headings ((1 . section) |
285 | (t . no-color))) | 285 | (t . no-color))) |
286 | (modus-themes-scale-headings nil) | 286 | (modus-themes-scale-headings nil) |
287 | (modus-themes-mode-line nil))) | 287 | (modus-themes-mode-line nil)) |
288 | (acdw/sunrise-sunset #'modus-themes-load-operandi | 288 | :now ((acdw/sunrise-sunset #'modus-themes-load-operandi |
289 | #'modus-themes-load-vivendi)) | 289 | #'modus-themes-load-vivendi))) |
290 | :then | ||
291 | ((dolist (face '(modus-theme-heading-1 | ||
292 | modus-theme-heading-2 | ||
293 | modus-theme-heading-3 | ||
294 | modus-theme-heading-4 | ||
295 | modus-theme-heading-5 | ||
296 | modus-theme-heading-6 | ||
297 | modus-theme-heading-7 | ||
298 | modus-theme-heading-8)) | ||
299 | (acdw/set-face face | ||
300 | `((t (:inherit (fixed-pitch bold)))))))) | ||
301 | 290 | ||
302 | ;;; Mode line | 291 | ;;; Mode line |
303 | 292 | ||
diff --git a/lisp/acdw.el b/lisp/acdw.el index 6641e9b..002f8f6 100644 --- a/lisp/acdw.el +++ b/lisp/acdw.el | |||
@@ -191,13 +191,21 @@ KEYMAP can be nil." | |||
191 | 191 | ||
192 | ARGS can include the following keywords: | 192 | ARGS can include the following keywords: |
193 | 193 | ||
194 | :now FORMS .. run forms immediately. | 194 | :local BOOL .. if BOOL is non-nil, don't run `straight-use-package' on |
195 | Good for settings and auxiliary functions. | 195 | PACKAGE. Good for using `acdw/pkg' on local features. |
196 | :then FORMS .. run forms after loading PACKAGE, using `with-eval-after-load'. | 196 | :require BOOL .. if BOOL is non-nil, run `require' on PACKAGE before anything. |
197 | :binds BINDS .. run `acdw/bind-after-map' on BINDS. | 197 | :now FORMS .. run FORMS immediately. |
198 | :hooks HOOKS .. run `acdw/hooks-after' on HOOKS." | 198 | :then FORMS .. run FORMS after loading PACKAGE, using `with-eval-after-load'. |
199 | :set SETTINGS .. pass SETTINGS to `acdw/set', right after `:now' forms. | ||
200 | SETTINGS should be properly quoted, just like they'd be passed | ||
201 | to the function. | ||
202 | :binds BINDS .. run `acdw/bind-after-map' on BINDS. | ||
203 | :hooks HOOKS .. run `acdw/hooks' on HOOKS." | ||
199 | (declare (indent 1)) | 204 | (declare (indent 1)) |
200 | (let ((now-forms (plist-get args :now)) | 205 | (let ((local-pkg (plist-get args :local)) |
206 | (require-pkg (plist-get args :require)) | ||
207 | (now-forms (plist-get args :now)) | ||
208 | (settings (plist-get args :set)) | ||
201 | (binds (plist-get args :binds)) | 209 | (binds (plist-get args :binds)) |
202 | (hooks (plist-get args :hooks)) | 210 | (hooks (plist-get args :hooks)) |
203 | (then-forms (plist-get args :then)) | 211 | (then-forms (plist-get args :then)) |
@@ -212,9 +220,14 @@ ARGS can include the following keywords: | |||
212 | (when binds | 220 | (when binds |
213 | (push `(acdw/bind-after-map ,(symbol-name requirement) nil ,binds) | 221 | (push `(acdw/bind-after-map ,(symbol-name requirement) nil ,binds) |
214 | final-form)) | 222 | final-form)) |
223 | (when settings | ||
224 | (push `(acdw/set ,settings) final-form)) | ||
215 | (when now-forms | 225 | (when now-forms |
216 | (push `(progn ,@now-forms) final-form)) | 226 | (push `(progn ,@now-forms) final-form)) |
217 | (push `(straight-use-package ',package) final-form) | 227 | (unless local-pkg |
228 | (push `(straight-use-package ',package) final-form)) | ||
229 | (when require-pkg | ||
230 | (push `(require ',requirement) final-form)) | ||
218 | `(progn | 231 | `(progn |
219 | ,@final-form))) | 232 | ,@final-form))) |
220 | 233 | ||