diff options
author | Case Duckworth | 2021-10-05 14:22:18 -0500 |
---|---|---|
committer | Case Duckworth | 2021-10-05 14:22:18 -0500 |
commit | 66ecd92944d7d169c0760402f7b8fd0a2f255958 (patch) | |
tree | ca4613eab72d785aa8fe1e3eac320a6867c2e593 | |
parent | Don't pulse line (diff) | |
download | emacs-66ecd92944d7d169c0760402f7b8fd0a2f255958.tar.gz emacs-66ecd92944d7d169c0760402f7b8fd0a2f255958.zip |
Change `:straight-if` to `:straight-when`
`:straight-when` is a more accurate representation of what it's doing. I also found out that I could change its indentation, which I did.
-rw-r--r-- | init.el | 124 | ||||
-rw-r--r-- | lisp/acdw-setup.el | 3 | ||||
-rw-r--r-- | lisp/acdw.el | 2 |
3 files changed, 66 insertions, 63 deletions
diff --git a/init.el b/init.el index 83486c8..32f48fb 100644 --- a/init.el +++ b/init.el | |||
@@ -974,18 +974,18 @@ specific to most general, they are these: | |||
974 | :repo "willvaughn/emacs-0x0")) | 974 | :repo "willvaughn/emacs-0x0")) |
975 | (:option 0x0-default-server 'ttm)) | 975 | (:option 0x0-default-server 'ttm)) |
976 | 976 | ||
977 | (setup (:straight-if affe | 977 | (setup (:straight-when affe |
978 | (and (or (executable-find "fd") | 978 | (and (or (executable-find "fd") |
979 | (executable-find "find")) | 979 | (executable-find "find")) |
980 | (executable-find "rg"))) | 980 | (executable-find "rg"))) |
981 | ;; Keys are bound in `acdw/sensible-grep' and `acdw/sensible-find' | 981 | ;; Keys are bound in `acdw/sensible-grep' and `acdw/sensible-find' |
982 | (:option affe-regexp-compiler | 982 | (:option affe-regexp-compiler |
983 | (defun affe-orderless-regexp-compiler (input _type) | 983 | (defun affe-orderless-regexp-compiler (input _type) |
984 | (setq input (orderless-pattern-compiler input)) | 984 | (setq input (orderless-pattern-compiler input)) |
985 | (cons input (lambda (str) (orderless--highlight input str)))))) | 985 | (cons input (lambda (str) (orderless--highlight input str)))))) |
986 | 986 | ||
987 | (setup (:straight-if ahk-mode | 987 | (setup (:straight-when ahk-mode |
988 | (acdw/system :work))) | 988 | (acdw/system :work))) |
989 | 989 | ||
990 | (setup (:straight alert) | 990 | (setup (:straight alert) |
991 | (:option alert-default-style (acdw/system | 991 | (:option alert-default-style (acdw/system |
@@ -1221,10 +1221,10 @@ specific to most general, they are these: | |||
1221 | 1221 | ||
1222 | (crux-reopen-as-root-mode +1)) | 1222 | (crux-reopen-as-root-mode +1)) |
1223 | 1223 | ||
1224 | (setup (:straight-if (define-repeat-map | 1224 | (setup (:straight-when (define-repeat-map |
1225 | :host nil | 1225 | :host nil |
1226 | :repo "https://tildegit.org/acdw/define-repeat-map.el") | 1226 | :repo "https://tildegit.org/acdw/define-repeat-map.el") |
1227 | (acdw/system :home)) | 1227 | (acdw/system :home)) |
1228 | 1228 | ||
1229 | (require 'define-repeat-map ; just for me | 1229 | (require 'define-repeat-map ; just for me |
1230 | (acdw/dir | 1230 | (acdw/dir |
@@ -1448,8 +1448,8 @@ specific to most general, they are these: | |||
1448 | (add-hook hook #'epithet-rename-buffer))) | 1448 | (add-hook hook #'epithet-rename-buffer))) |
1449 | 1449 | ||
1450 | ;; TODO: look into emms or something related for this | 1450 | ;; TODO: look into emms or something related for this |
1451 | (setup (:straight-if eradio | 1451 | (setup (:straight-when eradio |
1452 | (executable-find "mpv")) | 1452 | (executable-find "mpv")) |
1453 | (:option | 1453 | (:option |
1454 | eradio-player '("mpv" "--no-video" "--no-terminal") | 1454 | eradio-player '("mpv" "--no-video" "--no-terminal") |
1455 | eradio-channels `(("KLSU" . | 1455 | eradio-channels `(("KLSU" . |
@@ -1491,16 +1491,16 @@ specific to most general, they are these: | |||
1491 | (:hook-into emacs-lisp-mode | 1491 | (:hook-into emacs-lisp-mode |
1492 | lisp-interaction-mode)) | 1492 | lisp-interaction-mode)) |
1493 | 1493 | ||
1494 | (setup (:straight-if exec-path-from-shell | 1494 | (setup (:straight-when exec-path-from-shell |
1495 | (acdw/system :home)) | 1495 | (acdw/system :home)) |
1496 | (when (daemonp) | 1496 | (when (daemonp) |
1497 | (exec-path-from-shell-initialize))) | 1497 | (exec-path-from-shell-initialize))) |
1498 | 1498 | ||
1499 | (setup (:straight expand-region) | 1499 | (setup (:straight expand-region) |
1500 | (:global "C-=" #'er/expand-region)) | 1500 | (:global "C-=" #'er/expand-region)) |
1501 | 1501 | ||
1502 | (setup (:straight-if fennel-mode | 1502 | (setup (:straight-when fennel-mode |
1503 | (executable-find "fennel")) | 1503 | (executable-find "fennel")) |
1504 | (:autoload (fennel-repl :interactive t)) | 1504 | (:autoload (fennel-repl :interactive t)) |
1505 | (:file-match (rx ".fnl" eos))) | 1505 | (:file-match (rx ".fnl" eos))) |
1506 | 1506 | ||
@@ -1517,8 +1517,8 @@ specific to most general, they are these: | |||
1517 | (flyspell-correct-move 0 :forward :rapid)))) | 1517 | (flyspell-correct-move 0 :forward :rapid)))) |
1518 | (:unbind "C-;" "C-," "C-." "C-M-i"))) | 1518 | (:unbind "C-;" "C-," "C-." "C-M-i"))) |
1519 | 1519 | ||
1520 | (setup (:straight-if forge | 1520 | (setup (:straight-when forge |
1521 | (acdw/system :home)) | 1521 | (acdw/system :home)) |
1522 | ;; make sure to read Info manual with Forge (and Ghub) for setup | 1522 | ;; make sure to read Info manual with Forge (and Ghub) for setup |
1523 | ;; instructions. | 1523 | ;; instructions. |
1524 | (with-eval-after-load 'magit | 1524 | (with-eval-after-load 'magit |
@@ -1531,26 +1531,26 @@ specific to most general, they are these: | |||
1531 | (:option gcmh-idle-delay 'auto) | 1531 | (:option gcmh-idle-delay 'auto) |
1532 | (gcmh-mode +1)) | 1532 | (gcmh-mode +1)) |
1533 | 1533 | ||
1534 | (setup (:straight-if geiser | 1534 | (setup (:straight-when geiser |
1535 | (progn | 1535 | (progn |
1536 | (defvar acdw/schemes | 1536 | (defvar acdw/schemes |
1537 | (let (schemes) | 1537 | (let (schemes) |
1538 | (dolist (scheme '(("scheme" . geiser-chez) ; chez | 1538 | (dolist (scheme '(("scheme" . geiser-chez) ; chez |
1539 | ("petite" . geiser-chez) ; petite | 1539 | ("petite" . geiser-chez) ; petite |
1540 | ("csi" . geiser-chez) ; chicken | 1540 | ("csi" . geiser-chez) ; chicken |
1541 | ("gsi" . geiser-gambit) | 1541 | ("gsi" . geiser-gambit) |
1542 | ("gosh" . geiser-gauche) | 1542 | ("gosh" . geiser-gauche) |
1543 | ("guile" . geiser-guile) | 1543 | ("guile" . geiser-guile) |
1544 | ("kawa" . geiser-kawa) | 1544 | ("kawa" . geiser-kawa) |
1545 | ("mit-scheme" . geiser-mit) | 1545 | ("mit-scheme" . geiser-mit) |
1546 | ("racket" . geiser-racket) | 1546 | ("racket" . geiser-racket) |
1547 | ("stklos" . geiser-stklos))) | 1547 | ("stklos" . geiser-stklos))) |
1548 | (when-let (binary (executable-find (car scheme))) | 1548 | (when-let (binary (executable-find (car scheme))) |
1549 | (push binary schemes) | 1549 | (push binary schemes) |
1550 | ;; and install the proper helper package | 1550 | ;; and install the proper helper package |
1551 | (straight-use-package (cdr scheme)))) | 1551 | (straight-use-package (cdr scheme)))) |
1552 | (nreverse schemes))) | 1552 | (nreverse schemes))) |
1553 | acdw/schemes)) | 1553 | acdw/schemes)) |
1554 | (:file-match (rx ".rkt" eos) | 1554 | (:file-match (rx ".rkt" eos) |
1555 | (rx ".scm" eos))) | 1555 | (rx ".scm" eos))) |
1556 | 1556 | ||
@@ -1637,8 +1637,8 @@ specific to most general, they are these: | |||
1637 | (setup (:straight lacarte) | 1637 | (setup (:straight lacarte) |
1638 | (:global "<f10>" #'lacarte-execute-menu-command)) | 1638 | (:global "<f10>" #'lacarte-execute-menu-command)) |
1639 | 1639 | ||
1640 | (setup (:straight-if ledger-mode | 1640 | (setup (:straight-when ledger-mode |
1641 | (executable-find "ledger"))) | 1641 | (executable-find "ledger"))) |
1642 | 1642 | ||
1643 | (setup (:straight link-hint) | 1643 | (setup (:straight link-hint) |
1644 | ;; Browse web URLs with a browser with a prefix argument. | 1644 | ;; Browse web URLs with a browser with a prefix argument. |
@@ -2110,10 +2110,10 @@ the default is \"/\"." | |||
2110 | lisp-interaction-mode | 2110 | lisp-interaction-mode |
2111 | scheme-mode)) | 2111 | scheme-mode)) |
2112 | 2112 | ||
2113 | (setup (:straight-if (pdf-tools | 2113 | (setup (:straight-when (pdf-tools |
2114 | :host github | 2114 | :host github |
2115 | :repo "vedang/pdf-tools") | 2115 | :repo "vedang/pdf-tools") |
2116 | (acdw/system :home)) | 2116 | (acdw/system :home)) |
2117 | (:file-match (rx ".pdf" eos)) | 2117 | (:file-match (rx ".pdf" eos)) |
2118 | (pdf-loader-install)) | 2118 | (pdf-loader-install)) |
2119 | 2119 | ||
@@ -2200,16 +2200,16 @@ the default is \"/\"." | |||
2200 | 2200 | ||
2201 | (simple-modeline-mode +1)) | 2201 | (simple-modeline-mode +1)) |
2202 | 2202 | ||
2203 | (setup (:straight-if sly | 2203 | (setup (:straight-when sly |
2204 | (progn | 2204 | (progn |
2205 | (defvar acdw/lisps | 2205 | (defvar acdw/lisps |
2206 | (let (lisps) | 2206 | (let (lisps) |
2207 | (dolist (lisp '("sbcl" ; TODO: add more lisps | 2207 | (dolist (lisp '("sbcl" ; TODO: add more lisps |
2208 | "clisp")) | 2208 | "clisp")) |
2209 | (when-let (binary (executable-find lisp)) | 2209 | (when-let (binary (executable-find lisp)) |
2210 | (push binary lisps))) | 2210 | (push binary lisps))) |
2211 | (nreverse lisps))) | 2211 | (nreverse lisps))) |
2212 | acdw/lisps)) | 2212 | acdw/lisps)) |
2213 | (:also-load sly-autoloads) | 2213 | (:also-load sly-autoloads) |
2214 | (:straight clhs) | 2214 | (:straight clhs) |
2215 | 2215 | ||
@@ -2289,8 +2289,8 @@ the default is \"/\"." | |||
2289 | (auto-save-visited-mode -1) | 2289 | (auto-save-visited-mode -1) |
2290 | (super-save-mode +1)) | 2290 | (super-save-mode +1)) |
2291 | 2291 | ||
2292 | (setup (:straight-if systemd | 2292 | (setup (:straight-when systemd |
2293 | (executable-find "systemd"))) | 2293 | (executable-find "systemd"))) |
2294 | 2294 | ||
2295 | (setup (:straight (topsy | 2295 | (setup (:straight (topsy |
2296 | :host github | 2296 | :host github |
@@ -2404,8 +2404,8 @@ If used with a numeric prefix argument N, N backticks will be inserted." | |||
2404 | (setup (:straight visual-regexp) | 2404 | (setup (:straight visual-regexp) |
2405 | (:global "M-%" #'vr/query-replace)) | 2405 | (:global "M-%" #'vr/query-replace)) |
2406 | 2406 | ||
2407 | (setup (:straight-if vterm | 2407 | (setup (:straight-when vterm |
2408 | (acdw/system :home)) | 2408 | (acdw/system :home)) |
2409 | (:straight (eshell-vterm | 2409 | (:straight (eshell-vterm |
2410 | :host github | 2410 | :host github |
2411 | :repo "iostapyshyn/eshell-vterm")) | 2411 | :repo "iostapyshyn/eshell-vterm")) |
@@ -2461,11 +2461,13 @@ If used with a numeric prefix argument N, N backticks will be inserted." | |||
2461 | 2461 | ||
2462 | (setup (:straight xr)) | 2462 | (setup (:straight xr)) |
2463 | 2463 | ||
2464 | (setup (:straight-if ytel | 2464 | (setup (:straight-when ytel |
2465 | (executable-find "mpv")) | 2465 | (executable-find "mpv")) |
2466 | (:also-load acdw-ytel) | ||
2466 | ;; This might need to be changed depending on whether the instance goes down. | 2467 | ;; This might need to be changed depending on whether the instance goes down. |
2467 | (:option ytel-invidious-api-url "https://invidious.snopyta.org") | 2468 | (:option ytel-invidious-api-url "https://invidious.snopyta.org") |
2468 | (:bind "v" #'acdw/ytel-current-video-link | 2469 | (:hook #'hl-line-mode) |
2470 | (:bind "v" #'acdw/ytel-watch | ||
2469 | "w" #'acdw/ytel-copy-link)) | 2471 | "w" #'acdw/ytel-copy-link)) |
2470 | 2472 | ||
2471 | (setup (:straight zzz-to-char) | 2473 | (setup (:straight zzz-to-char) |
diff --git a/lisp/acdw-setup.el b/lisp/acdw-setup.el index eb4d12b..33ab835 100644 --- a/lisp/acdw-setup.el +++ b/lisp/acdw-setup.el | |||
@@ -72,7 +72,7 @@ first RECIPE's package." | |||
72 | (car recipe) | 72 | (car recipe) |
73 | recipe)))) | 73 | recipe)))) |
74 | 74 | ||
75 | (setup-define :straight-if | 75 | (setup-define :straight-when |
76 | (lambda (recipe condition) | 76 | (lambda (recipe condition) |
77 | `(if ,condition | 77 | `(if ,condition |
78 | (straight-use-package ',recipe) | 78 | (straight-use-package ',recipe) |
@@ -83,6 +83,7 @@ If CONDITION is false, stop evaluating the body. This macro can | |||
83 | be used as HEAD, and will replace itself with the RECIPE's | 83 | be used as HEAD, and will replace itself with the RECIPE's |
84 | package. This macro is not repeatable." | 84 | package. This macro is not repeatable." |
85 | :repeatable nil | 85 | :repeatable nil |
86 | :indent 1 | ||
86 | :shorthand (lambda (sexp) | 87 | :shorthand (lambda (sexp) |
87 | (let ((recipe (cadr sexp))) | 88 | (let ((recipe (cadr sexp))) |
88 | (if (consp recipe) (car recipe) recipe)))) | 89 | (if (consp recipe) (car recipe) recipe)))) |
diff --git a/lisp/acdw.el b/lisp/acdw.el index e013fbc..969b6c8 100644 --- a/lisp/acdw.el +++ b/lisp/acdw.el | |||
@@ -352,7 +352,7 @@ In short, DO NOT USE THIS FUNCTION!!!" | |||
352 | (cond | 352 | (cond |
353 | ;; Straight forms require some weirdness | 353 | ;; Straight forms require some weirdness |
354 | ((and s1-straight s2-straight) | 354 | ((and s1-straight s2-straight) |
355 | (let* ((r (rx ":straight" (? "-if") (* space) (? "("))) | 355 | (let* ((r (rx ":straight" (? "-when") (* space) (? "("))) |
356 | (s1 (replace-regexp-in-string r "" s1)) | 356 | (s1 (replace-regexp-in-string r "" s1)) |
357 | (s2 (replace-regexp-in-string r "" s2))) | 357 | (s2 (replace-regexp-in-string r "" s2))) |
358 | (string< s1 s2))) | 358 | (string< s1 s2))) |