From 1032b2cbd99208a097d2660a2ffe3147faaeee2c Mon Sep 17 00:00:00 2001 From: Case Duckworth Date: Mon, 26 Apr 2021 15:27:50 -0500 Subject: Change `:mode' to `:file-match' Turns out setup.el has a local macro to deal with setting up modes. --- init.el | 28 +++++++++++----------------- 1 file changed, 11 insertions(+), 17 deletions(-) diff --git a/init.el b/init.el index 3ff41b4..7af2e3e 100644 --- a/init.el +++ b/init.el @@ -49,12 +49,6 @@ :documentation "Bind KEY to COMMAND in `acdw/leader' (C-z) map." :repeatable t) -(setup-define :mode - (lambda (ext) - `(add-to-list 'auto-mode-alist (cons ,ext setup-mode))) - :documentation "Add SETUP-MODE to `auto-mode-alist' for EXTENSION." - :repeatable t) - ;;; `no-littering' (setup (:straight no-littering) (:option no-littering-etc-directory (acdw/dir) @@ -495,7 +489,7 @@ (setup (:straight (gemini-mode :host nil :repo "https://git.carcosa.net/jmcbray/gemini.el.git")) - (:mode "\\.\\(gemini\\|gmi\\)\\'")) + (:file-match "\\.\\(gemini\\|gmi\\)\\'")) (setup dired (setq-default dired-recursive-copies 'always @@ -549,7 +543,7 @@ (setup (:straight nov) (:option nov-text-width fill-column) - (:mode "\\.epub\\'")) + (:file-match "\\.epub\\'")) (setup gnus (:option gnus-home-directory (expand-file-name "gnus" user-emacs-directory) @@ -909,10 +903,10 @@ if ripgrep is installed, otherwise `consult-grep'." (when (executable-find "fennel") (setup (:straight fennel-mode) (autoload 'fennel-repl "fennel-mode" nil t) - (:mode "\\.fnl\\'"))) + (:file-match "\\.fnl\\'"))) (setup (:straight lua-mode) - (:mode "\\.lua\\'")) + (:file-match "\\.lua\\'")) (setup sh-mode (:option sh-basic-offset tab-width @@ -935,13 +929,13 @@ if ripgrep is installed, otherwise `consult-grep'." (:option css-level-offset 2 js-indent-level 2 sgml-indent-offset 2) - (:mode "\\.\\(p\\|dj\\)?html\\'" - "\\.html?\\'" - "\\.\\(tpl\\.\\)?php\\'" - "\\.[agj]sp\\'" - "\\.as[cp]x\\'" - "\\.erb\\'" - "\\.mustache\\'")) + (:file-match "\\.\\(p\\|dj\\)?html\\'" + "\\.html?\\'" + "\\.\\(tpl\\.\\)?php\\'" + "\\.[agj]sp\\'" + "\\.as[cp]x\\'" + "\\.erb\\'" + "\\.mustache\\'")) (when (locate-library "gforth") (autoload 'forth-mode "gforth") -- cgit 1.4.1-21-gabe81