diff --git a/core/core-ui.el b/core/core-ui.el index 6dd2f1fed..324bf815d 100644 --- a/core/core-ui.el +++ b/core/core-ui.el @@ -669,7 +669,7 @@ startup (or theme switch) time, so long as `doom--prefer-theme-elc' is non-nil." ;; doesn't exist in terminal Emacs; we define it to prevent errors (unless (fboundp 'define-fringe-bitmap) - (defun define-fringe-bitmap (&rest _))) + (fset 'define-fringe-bitmap #'ignore)) (after! whitespace (defun doom-disable-whitespace-mode-in-childframes-a (orig-fn) diff --git a/modules/config/default/+evil.el b/modules/config/default/+evil.el index e1c7eddb6..afb67451d 100644 --- a/modules/config/default/+evil.el +++ b/modules/config/default/+evil.el @@ -1,9 +1,9 @@ ;;; config/default/+evil.el -*- lexical-binding: t; -*- -(defun +default|disable-delete-selection-mode () +(defun +default-disable-delete-selection-mode-h () (delete-selection-mode -1)) (add-hook 'evil-insert-state-entry-hook #'delete-selection-mode) -(add-hook 'evil-insert-state-exit-hook #'+default|disable-delete-selection-mode) +(add-hook 'evil-insert-state-exit-hook #'+default-disable-delete-selection-mode-h) ;; diff --git a/modules/config/default/autoload/default.el b/modules/config/default/autoload/default.el index 89fa2f4dd..5e2a3aabc 100644 --- a/modules/config/default/autoload/default.el +++ b/modules/config/default/autoload/default.el @@ -109,7 +109,7 @@ If ARG (universal argument), runs `compile' from the current directory." ((error "No kill-ring search backend available. Enable ivy or helm!"))))) ;;;###autoload -(defun +default*newline-indent-and-continue-comments () +(defun +default--newline-indent-and-continue-comments-a () "A replacement for `newline-and-indent'. Continues comments if executed from a commented line, with special support for @@ -159,7 +159,7 @@ possible, or just one char if that's not possible." ((delete-char -1))))) ;;;###autoload -(defun +default*delete-backward-char (n &optional killflag) +(defun +default--delete-backward-char-a (n &optional killflag) "Same as `delete-backward-char', but preforms these additional checks: + If point is surrounded by (balanced) whitespace and a brace delimiter ({} [] diff --git a/modules/config/default/config.el b/modules/config/default/config.el index e261cd65a..92d0fa84e 100644 --- a/modules/config/default/config.el +++ b/modules/config/default/config.el @@ -195,10 +195,10 @@ ;; e) properly delete smartparen pairs when they are encountered, without ;; the need for strict mode. ;; f) do none of this when inside a string - (advice-add #'delete-backward-char :override #'+default*delete-backward-char)) + (advice-add #'delete-backward-char :override #'+default--delete-backward-char-a)) ;; Makes `newline-and-indent' continue comments (and more reliably) - (advice-add #'newline-and-indent :override #'+default*newline-indent-and-continue-comments)) + (advice-add #'newline-and-indent :override #'+default--newline-indent-and-continue-comments-a)) ;; diff --git a/modules/input/japanese/config.el b/modules/input/japanese/config.el index 985db25b2..407c029e3 100644 --- a/modules/input/japanese/config.el +++ b/modules/input/japanese/config.el @@ -22,7 +22,7 @@ (after! helm (helm-migemo-mode +1))))) -(use-package pangu-spacing +(use-package! pangu-spacing :hook (text-mode . pangu-spacing-mode) :init ;; replacing `chinese-two-byte' by `japanese' diff --git a/modules/lang/csharp/config.el b/modules/lang/csharp/config.el index 960b4b943..2441b2ac9 100644 --- a/modules/lang/csharp/config.el +++ b/modules/lang/csharp/config.el @@ -56,9 +56,10 @@ "b" #'omnisharp-unit-test-buffer))) +;;;###package shader-mode (when (featurep! +unity) - ;; `shader-mode' --- unity shaders - (add-to-list 'auto-mode-alist '("\\.shader$" . shader-mode)) + ;; Unity shaders + (add-to-list 'auto-mode-alist '("\\.shader\\'" . shader-mode)) (def-project-mode! +csharp-unity-mode :modes '(csharp-mode shader-mode) diff --git a/modules/lang/elixir/config.el b/modules/lang/elixir/config.el index b6750c24c..04d78ad5f 100644 --- a/modules/lang/elixir/config.el +++ b/modules/lang/elixir/config.el @@ -32,18 +32,6 @@ (when (featurep! +lsp) (add-hook 'elixir-mode-local-vars-hook #'lsp!)) - (use-package! alchemist-company - :when (featurep! :completion company) - :commands alchemist-company - :init - (set-company-backend! 'elixir-mode '(alchemist-company company-yasnippet)) - :config - ;; Alchemist doesn't use hook symbols to add these backends, so we have to - ;; use the entire closure to get rid of it. - (let ((fn (byte-compile (lambda () (add-to-list (make-local-variable 'company-backends) 'alchemist-company))))) - (remove-hook 'alchemist-mode-hook fn) - (remove-hook 'alchemist-iex-mode-hook fn))) - (use-package! flycheck-credo :when (featurep! :tools flycheck) :config (flycheck-credo-setup))) @@ -51,9 +39,24 @@ (use-package! alchemist :hook (elixir-mode . alchemist-mode) + :init + (after! elixir-mode + (set-lookup-handlers! 'elixir-mode + :definition #'alchemist-goto-definition-at-point + :documentation #'alchemist-help-search-at-point) + (set-eval-handler! 'elixir-mode #'alchemist-eval-region) + (set-repl-handler! 'elixir-mode #'alchemist-iex-project-run))) + + +(use-package! alchemist-company + :when (featurep! :completion company) + :commands alchemist-company + :init + (after! elixir-mode + (set-company-backend! 'elixir-mode '(alchemist-company company-yasnippet))) :config - (set-lookup-handlers! 'elixir-mode - :definition #'alchemist-goto-definition-at-point - :documentation #'alchemist-help-search-at-point) - (set-eval-handler! 'elixir-mode #'alchemist-eval-region) - (set-repl-handler! 'elixir-mode #'alchemist-iex-project-run)) + ;; Alchemist doesn't use hook symbols to add these backends, so we have to use + ;; the entire closure to get rid of it. + (let ((fn (byte-compile (lambda () (add-to-list (make-local-variable 'company-backends) 'alchemist-company))))) + (remove-hook 'alchemist-mode-hook fn) + (remove-hook 'alchemist-iex-mode-hook fn))) diff --git a/modules/lang/elm/config.el b/modules/lang/elm/config.el index c96baafb4..479800eed 100644 --- a/modules/lang/elm/config.el +++ b/modules/lang/elm/config.el @@ -1,8 +1,5 @@ ;;; lang/elm/config.el -*- lexical-binding: t; -*- -;; `elm-mode' -(setq elm-format-on-save t) - (after! elm-mode (add-hook 'elm-mode-hook #'rainbow-delimiters-mode) diff --git a/modules/lang/erlang/config.el b/modules/lang/erlang/config.el index 7e748fbba..6324785fc 100644 --- a/modules/lang/erlang/config.el +++ b/modules/lang/erlang/config.el @@ -1,9 +1,9 @@ ;;; lang/erlang/config.el -*- lexical-binding: t; -*- (use-package! erlang - :mode ("\\.erlang$" . erlang-mode) - :mode ("/rebar\\.config\\(?:\\.script\\)?$" . erlang-mode) - :mode ("/\\(?:app\\|sys\\)\\.config$" . erlang-mode)) + :mode ("\\.erlang\\'" . erlang-mode) + :mode ("/rebar\\.config\\(?:\\.script\\)?\\'" . erlang-mode) + :mode ("/\\(?:app\\|sys\\)\\.config\\'" . erlang-mode)) (use-package! flycheck-rebar3 diff --git a/modules/lang/go/config.el b/modules/lang/go/config.el index 9a26f42db..eaa37e862 100644 --- a/modules/lang/go/config.el +++ b/modules/lang/go/config.el @@ -1,7 +1,7 @@ ;;; lang/go/config.el -*- lexical-binding: t; -*- ;; -;; Packages +;;; Packages (after! go-mode (set-docsets! 'go-mode "Go") @@ -59,8 +59,8 @@ (use-package! company-go - :when (and (featurep! :completion company) - (not (featurep! +lsp))) + :when (featurep! :completion company) + :unless (featurep! +lsp) :after go-mode :config (set-company-backend! 'go-mode 'company-go) diff --git a/modules/lang/julia/config.el b/modules/lang/julia/config.el index 385b49b7a..fa5944f31 100644 --- a/modules/lang/julia/config.el +++ b/modules/lang/julia/config.el @@ -1,6 +1,6 @@ ;;; lang/julia/config.el -*- lexical-binding: t; -*- -(use-package julia-mode +(use-package! julia-mode :interpreter "julia" :config (set-repl-handler! 'julia-mode #'+julia/repl) diff --git a/modules/lang/kotlin/config.el b/modules/lang/kotlin/config.el index d1b2ac1ab..06a1588b8 100644 --- a/modules/lang/kotlin/config.el +++ b/modules/lang/kotlin/config.el @@ -10,7 +10,7 @@ :desc "gradlew build" "b" (λ! (+kotlin/run-gradlew "build")) :desc "gradlew test" "t" (λ! (+kotlin/run-gradlew "test")))) + (use-package! flycheck-kotlin :when (featurep! :tools flycheck) - :after kotlin-mode - :config (add-hook 'kotlin-mode-hook #'flycheck-kotlin-setup)) + :hook (kotlin-mode . flycheck-kotlin-setup)) diff --git a/modules/lang/ledger/config.el b/modules/lang/ledger/config.el index d520a4d4e..35f6b83dd 100644 --- a/modules/lang/ledger/config.el +++ b/modules/lang/ledger/config.el @@ -1,14 +1,14 @@ ;;; lang/ledger/config.el -*- lexical-binding: t; -*- -;; `ledger-mode' +;;;###package ledger-mode (setq ledger-clear-whole-transactions 1) -(defun +ledger*check-version (orig-fn) +(defadvice! +ledger--check-version-a (orig-fn) "Fail gracefully if ledger binary isn't available." + :around #'ledger-check-version (if (executable-find ledger-binary-path) (funcall orig-fn) (message "Couldn't find '%s' executable" ledger-binary-path))) -(advice-add #'ledger-check-version :around #'+ledger*check-version) ;; Restore leader key in ledger reports (map! :after ledger-mode @@ -51,7 +51,8 @@ (:prefix "g" "s" #'ledger-display-ledger-stats "b" #'ledger-display-balance-at-point)) - ;; Fix inaccurate keybind message - (defun +ledger*fix-key-help (&rest _) - (message "q to quit; gr to redo; RET to edit; C-c C-s to save")) - (advice-add #'ledger-report :after #'+ledger*fix-key-help)) + + (defadvice! +ledger--fix-key-help-a (&rest _) + "Fix inaccurate keybind message." + :after #'ledger-report + (message "q to quit; gr to redo; RET to edit; C-c C-s to save"))) diff --git a/modules/lang/nim/config.el b/modules/lang/nim/config.el index 02b81aba3..2435c93d0 100644 --- a/modules/lang/nim/config.el +++ b/modules/lang/nim/config.el @@ -1,14 +1,14 @@ ;;; lang/nim/config.el -*- lexical-binding: t; -*- (after! nim-mode - (defun +nim|init-nimsuggest-mode () - "Conditionally load `nimsuggest-mode', instead of clumsily erroring out if + (add-hook! 'nim-mode-hook + (defun +nim-init-nimsuggest-mode-h () + "Conditionally load `nimsuggest-mode', instead of clumsily erroring out if nimsuggest isn't installed." - (unless (stringp nimsuggest-path) - (setq nimsuggest-path (executable-find "nimsuggest"))) - (when (and nimsuggest-path (file-executable-p nimsuggest-path)) - (nimsuggest-mode))) - (add-hook 'nim-mode-hook #'+nim|init-nimsuggest-mode) + (unless (stringp nimsuggest-path) + (setq nimsuggest-path (executable-find "nimsuggest"))) + (when (and nimsuggest-path (file-executable-p nimsuggest-path)) + (nimsuggest-mode)))) (when IS-WINDOWS ;; TODO File PR/report upstream (https://github.com/nim-lang/nim-mode) diff --git a/modules/lang/ocaml/config.el b/modules/lang/ocaml/config.el index 3394fa4f6..25b7d0cad 100644 --- a/modules/lang/ocaml/config.el +++ b/modules/lang/ocaml/config.el @@ -28,20 +28,20 @@ (use-package! utop :when (featurep! :tools eval) - :hook (tuareg-mode . +ocaml|init-utop) + :hook (tuareg-mode . +ocaml-init-utop-h) :init (set-repl-handler! 'tuareg-mode #'utop) (set-eval-handler! 'tuareg-mode #'utop-eval-region) - (defun +ocaml|init-utop () + (defun +ocaml-init-utop-h () (when (executable-find "utop") (utop-minor-mode))))) (use-package! merlin :unless (featurep! +lsp) - :hook (tuareg-mode . +ocaml|init-merlin) + :hook (tuareg-mode . +ocaml-init-merlin-h) :init - (defun +ocaml|init-merlin () + (defun +ocaml-init-merlin-h () "Activate `merlin-mode' if the ocamlmerlin executable exists." (when (executable-find "ocamlmerlin") (merlin-mode))) @@ -62,9 +62,9 @@ (use-package! flycheck-ocaml :when (featurep! :tools flycheck) - :hook (merlin-mode . +ocaml|init-flycheck) + :hook (merlin-mode . +ocaml-init-flycheck-h) :config - (defun +ocaml|init-flycheck () + (defun +ocaml-init-flycheck-h () "Activate `flycheck-ocaml` if the current project possesses a .merlin file." (when (projectile-locate-dominating-file default-directory ".merlin") ;; Disable Merlin's own error checking @@ -90,9 +90,9 @@ (use-package! ocp-indent ;; must be careful to always defer this, it has autoloads that adds hooks ;; which we do not want if the executable can't be found - :hook (tuareg-mode . +ocaml|init-ocp-indent) + :hook (tuareg-mode . +ocaml-init-ocp-indent-h) :config - (defun +ocaml|init-ocp-indent () + (defun +ocaml-init-ocp-indent-h () "Run `ocp-setup-indent', so long as the ocp-indent binary exists." (when (executable-find "ocp-indent") (ocp-setup-indent)))) @@ -101,12 +101,12 @@ (use-package! ocamlformat :when (featurep! :editor format) :commands ocamlformat - :hook (tuareg-mode . +ocaml|init-ocamlformat) + :hook (tuareg-mode . +ocaml-init-ocamlformat-h) :config (set-formatter! 'ocamlformat #'ocamlformat :modes '(caml-mode tuareg-mode)) ;; TODO Fix region-based formatting support - (defun +ocaml|init-ocamlformat () + (defun +ocaml-init-ocamlformat-h () (setq +format-with 'ocp-indent) (when (and (executable-find "ocamlformat") (locate-dominating-file default-directory ".ocamlformat")) diff --git a/modules/lang/org/autoload/contrib-present.el b/modules/lang/org/autoload/contrib-present.el index cd50de4f5..1d16d5d61 100644 --- a/modules/lang/org/autoload/contrib-present.el +++ b/modules/lang/org/autoload/contrib-present.el @@ -31,7 +31,7 @@ (+org-present--make-invisible (match-beginning 1) (match-end 1))))) ;;;###autoload -(defun +org-present|remove-overlays () +(defun +org-present-remove-overlays-h () (mapc #'delete-overlay +org-present--overlays) (remove-from-invisibility-spec '(+org-present))) @@ -66,7 +66,7 @@ (text-scale-set 0) (org-remove-latex-fragment-image-overlays) (set-face-attribute 'org-level-2 nil :height 1.0) - (+org-present|remove-overlays) + (+org-present-remove-overlays-h) (org-remove-inline-images))))) diff --git a/modules/lang/php/autoload.el b/modules/lang/php/autoload.el index 0cd8a68a5..5da10009b 100644 --- a/modules/lang/php/autoload.el +++ b/modules/lang/php/autoload.el @@ -24,14 +24,3 @@ ignore the cache." (require 'json) (json-read-file package-file))) (puthash project-root data +php-composer-conf)))))) - -;;;###autoload -(defun +php|init-ac-php-core-eldoc () - "Initialize eldoc support for `php-mode' with `ac-php-core'. Fails gracefully -if phpctags isn't installed." - (require 'ac-php-core) - (cond ((not ac-php-ctags-executable)) - ((not (file-exists-p ac-php-ctags-executable)) - (message "Could not find phpctags executable, eldoc support is disabled") - (message "To disable these warnings, set ac-php-ctags-executable to nil")) - ((ac-php-core-eldoc-setup)))) diff --git a/modules/lang/plantuml/config.el b/modules/lang/plantuml/config.el index 31d00feeb..1daf6eba3 100644 --- a/modules/lang/plantuml/config.el +++ b/modules/lang/plantuml/config.el @@ -14,17 +14,12 @@ :after plantuml-mode :config (flycheck-plantuml-setup)) -;; -;; 1. Add `:cmdline -charset utf-8' to org-src-block:plantuml -;; -;; 2. Fix `@start' prefix execute error -;; When `C-c C-c' is executed in org-src-block:plantuml, if the code starts with -;; `@', execution will go wrong. Must be preceded by `\' or `,' to execute -;; normally. This code is automatically added `\' before `@start' when `C-c C-c' -;; is executed, so that the execution can be carried out normally. -;; + (after! ob-plantuml (defadvice! +plantuml--fix-atstart-in-org-src-blocks-a (args) + "Fix error when executing plantuml src blocks in org-mode for code that +begins with '@'. This character needs to be escaped with a backslash or comma +for the block to execute correctly, so we do it automatically." :filter-args #'org-babel-execute:plantuml (cl-destructuring-bind (body params) args (let* ((origin-body body) @@ -34,5 +29,6 @@ "\\\\\\1" origin-body))) (list fix-body params)))) + (add-to-list 'org-babel-default-header-args:plantuml '(:cmdline . "-charset utf-8"))) diff --git a/modules/lang/racket/config.el b/modules/lang/racket/config.el index 12d9994ad..891df7709 100644 --- a/modules/lang/racket/config.el +++ b/modules/lang/racket/config.el @@ -19,7 +19,6 @@ (add-hook! 'racket-mode-hook #'rainbow-delimiters-mode #'highlight-quoted-mode) - (set-lookup-handlers! 'racket-mode :definition #'racket-visit-definition) (map! :map (racket-mode-map racket-repl-mode-map) :i "[" #'racket-smart-open-bracket) diff --git a/modules/lang/rest/config.el b/modules/lang/rest/config.el index dfe9d053f..d655901e9 100644 --- a/modules/lang/rest/config.el +++ b/modules/lang/rest/config.el @@ -11,12 +11,12 @@ (setq-hook! 'restclient-mode-hook imenu-generic-expression '((nil "^[A-Z]+\s+.+" 0))) - ;; Forces underlying SSL verification to prompt for self-signed or invalid - ;; certs, rather than silently reject them. - (defun +rest*permit-self-signed-ssl (orig-fn &rest args) + (defadvice! +rest--permit-self-signed-ssl-a (orig-fn &rest args) + "Forces underlying SSL verification to prompt for self-signed or invalid +certs, rather than silently reject them." + :around #'restclient-http-do (let (gnutls-verify-error tls-checktrust) (apply orig-fn args))) - (advice-add #'restclient-http-do :around #'+rest*permit-self-signed-ssl) (map! :map restclient-mode-map :n [return] #'+rest/dwim-at-point diff --git a/modules/lang/ruby/config.el b/modules/lang/ruby/config.el index 1d3c6a38e..c603689ed 100644 --- a/modules/lang/ruby/config.el +++ b/modules/lang/ruby/config.el @@ -1,16 +1,16 @@ ;;; lang/ruby/config.el -*- lexical-binding: t; -*- ;; -;; Packages +;;; Packages (use-package! enh-ruby-mode - :mode ("\\.\\(?:pry\\|irb\\)rc\\'" . +ruby|init) - :mode ("\\.\\(?:rb\\|rake\\|rabl\\|ru\\|builder\\|gemspec\\|jbuilder\\|thor\\)\\'" . +ruby|init) - :mode ("/\\(?:Berks\\|Cap\\|Gem\\|Guard\\|Pod\\|Puppet\\|Rake\\|Thor\\|Vagrant\\)file\\'" . +ruby|init) + :mode ("\\.\\(?:pry\\|irb\\)rc\\'" . +ruby-init-h) + :mode ("\\.\\(?:rb\\|rake\\|rabl\\|ru\\|builder\\|gemspec\\|jbuilder\\|thor\\)\\'" . +ruby-init-h) + :mode ("/\\(?:Berks\\|Cap\\|Gem\\|Guard\\|Pod\\|Puppet\\|Rake\\|Thor\\|Vagrant\\)file\\'" . +ruby-init-h) :preface (after! ruby-mode (require 'enh-ruby-mode)) - (defun +ruby|init () + (defun +ruby-init-h () "Enable `enh-ruby-mode' if ruby is available, otherwise `ruby-mode'." (if (executable-find "ruby") (enh-ruby-mode) @@ -33,11 +33,11 @@ (use-package! robe :defer t :init - (defun +ruby|init-robe-mode-maybe () - "Start `robe-mode' if `lsp-mode' isn't active." - (unless (bound-and-true-p lsp-mode) - (robe-mode +1))) - (add-hook 'enh-ruby-mode-hook #'+ruby|init-robe-mode-maybe) + (add-hook! 'enh-ruby-mode-hook + (defun +ruby-init-robe-mode-maybe-h () + "Start `robe-mode' if `lsp-mode' isn't active." + (unless (bound-and-true-p lsp-mode) + (robe-mode +1)))) :config (set-repl-handler! 'enh-ruby-mode #'robe-start) (set-company-backend! 'enh-ruby-mode 'company-robe) @@ -76,7 +76,7 @@ ;; -;; Package & Ruby version management +;;; Package & Ruby version management (use-package! rake :defer t @@ -111,7 +111,7 @@ ;; -;; Testing frameworks +;;; Testing frameworks (use-package! rspec-mode :mode ("/\\.rspec\\'" . text-mode) diff --git a/modules/lang/scala/config.el b/modules/lang/scala/config.el index 702dc054f..e14ef20bc 100644 --- a/modules/lang/scala/config.el +++ b/modules/lang/scala/config.el @@ -5,7 +5,8 @@ ;; indent block comments to first asterix, not second scala-indent:use-javadoc-style t) - (setq-hook! 'scala-mode-hook comment-line-break-function #'+scala-comment-indent-new-line) + (setq-hook! 'scala-mode-hook + comment-line-break-function #'+scala-comment-indent-new-line) (after! dtrt-indent (add-to-list 'dtrt-indent-hook-mapping-list '(scala-mode c/c++/java scala-indent:step))) diff --git a/modules/lang/solidity/config.el b/modules/lang/solidity/config.el index f9502a67f..7921df560 100644 --- a/modules/lang/solidity/config.el +++ b/modules/lang/solidity/config.el @@ -3,7 +3,7 @@ ;; ;; Packages -;; `solidity-mode' +;;;###package solidity-mode (setq solidity-comment-style 'slash) @@ -22,5 +22,5 @@ :when (featurep! :completion company) :after solidity-mode :config - (setq company-backends (delq 'company-solidity company-backends)) + (delq! 'company-solidity company-backends) (set-company-backend! 'solidity-mode 'company-solidity)) diff --git a/modules/lang/swift/config.el b/modules/lang/swift/config.el index f0a822830..83f21b647 100644 --- a/modules/lang/swift/config.el +++ b/modules/lang/swift/config.el @@ -5,15 +5,15 @@ (use-package! flycheck-swift - :when (and (featurep! :tools flycheck) - (not (featurep! +lsp))) + :when (featurep! :tools flycheck) + :unless (featurep! +lsp) :after swift-mode :config (flycheck-swift-setup)) (use-package! company-sourcekit - :when (and (featurep! :completion company) - (not (featurep! +lsp))) + :when (featurep! :completion company) + :unless (featurep! +lsp) :after swift-mode :config (set-company-backend! 'swift-mode '(company-sourcekit company-yasnippet))) diff --git a/modules/lang/terra/config.el b/modules/lang/terra/config.el index 7cf7db023..f6c448ce3 100644 --- a/modules/lang/terra/config.el +++ b/modules/lang/terra/config.el @@ -1,12 +1,11 @@ ;;; lang/lua/config.el -*- lexical-binding: t; -*- ;; -;; Major modes +;;; Major modes -(use-package! terra-mode - :defer t - :config - (set-lookup-handlers! 'terra-mode :documentation 'terra-search-documentation) +(after! terra-mode + (set-lookup-handlers! 'terra-mode + :documentation #'terra-search-documentation) (set-electric! 'terra-mode :words '("else" "end")) (set-repl-handler! 'terra-mode #'+terra/open-repl) (set-company-backend! 'terra-mode '(company-lua company-yasnippet))) diff --git a/modules/lang/web/+css.el b/modules/lang/web/+css.el index dc68ec39c..0dc02f0a6 100644 --- a/modules/lang/web/+css.el +++ b/modules/lang/web/+css.el @@ -1,7 +1,8 @@ ;;; lang/web/+css.el -*- lexical-binding: t; -*- ;; An improved newline+continue comment function -(setq-hook! css-mode comment-indent-function #'+css/comment-indent-new-line) +(setq-hook! css-mode + comment-indent-function #'+css/comment-indent-new-line) (map! :map (css-mode-map scss-mode-map less-css-mode-map) :localleader diff --git a/modules/lang/web/+html.el b/modules/lang/web/+html.el index 7bac671ab..724dc8369 100644 --- a/modules/lang/web/+html.el +++ b/modules/lang/web/+html.el @@ -1,19 +1,19 @@ ;;; lang/web/+html.el -*- lexical-binding: t; -*- (use-package! web-mode - :mode "\\.p?html?$" - :mode "\\.\\(?:tpl\\|blade\\)\\(\\.php\\)?$" - :mode "\\.erb$" - :mode "\\.jsp$" - :mode "\\.as[cp]x$" - :mode "\\.hbs$" - :mode "\\.mustache$" - :mode "\\.tsx$" - :mode "\\.vue$" - :mode "\\.twig$" - :mode "\\.jinja$" - :mode "wp-content/themes/.+/.+\\.php$" - :mode "templates/.+\\.php$" + :mode "\\.p?html?\\'" + :mode "\\.\\(?:tpl\\|blade\\)\\(?:\\.php\\)?\\'" + :mode "\\.erb\\'" + :mode "\\.jsp\\'" + :mode "\\.as[cp]x\\'" + :mode "\\.hbs\\'" + :mode "\\.mustache\\'" + :mode "\\.tsx\\'" + :mode "\\.vue\\'" + :mode "\\.twig\\'" + :mode "\\.jinja\\'" + :mode "wp-content/themes/.+/.+\\.php\\'" + :mode "templates/.+\\.php\\'" :config (set-docsets! 'web-mode "HTML" "CSS" "Twig" "WordPress") diff --git a/modules/lang/web/config.el b/modules/lang/web/config.el index 50a293cc5..1f872ec4c 100644 --- a/modules/lang/web/config.el +++ b/modules/lang/web/config.el @@ -19,7 +19,7 @@ ;; -;; Framework-based minor-modes +;;; Framework-based minor-modes (def-project-mode! +web-jekyll-mode :modes '(web-mode js-mode coffee-mode css-mode haml-mode pug-mode) diff --git a/modules/tools/magit/autoload.el b/modules/tools/magit/autoload.el index bd167c8a5..6635abf01 100644 --- a/modules/tools/magit/autoload.el +++ b/modules/tools/magit/autoload.el @@ -55,13 +55,13 @@ (defvar-local +magit--vc-is-stale-p nil) ;;;###autoload -(defun +magit|refresh-vc-state-maybe () +(defun +magit-refresh-vc-state-maybe-h () "Update `vc' and `git-gutter' if out of date." (when +magit--vc-is-stale-p (+magit--refresh-vc-in-buffer (current-buffer)))) ;;;###autoload -(add-hook 'doom-switch-buffer-hook #'+magit|refresh-vc-state-maybe) +(add-hook 'doom-switch-buffer-hook #'+magit-refresh-vc-state-maybe-h) ;;;###autoload (defun +magit/quit (&optional _kill-buffer) diff --git a/modules/tools/upload/config.el b/modules/tools/upload/config.el index cb7631413..cec95bf2c 100644 --- a/modules/tools/upload/config.el +++ b/modules/tools/upload/config.el @@ -33,19 +33,19 @@ (put (car sym) 'safe-local-variable (cdr sym))) ;; Maybe auto-upload on save - (defun +upload|init-after-save () - (when (and (bound-and-true-p ssh-deploy-root-remote) - ssh-deploy-on-explicit-save) - (ssh-deploy-upload-handler))) - (add-hook 'after-save-hook #'+upload|init-after-save) + (add-hook! 'after-save-hook + (defun +upload-init-after-save-h () + (when (and (bound-and-true-p ssh-deploy-root-remote) + ssh-deploy-on-explicit-save) + (ssh-deploy-upload-handler)))) ;; Enable ssh-deploy if variables are set, and check for changes on open file ;; (if possible) - (defun +upload|init-find-file () - (when (bound-and-true-p ssh-deploy-root-remote) - (require 'ssh-deploy) - (unless ssh-deploy-root-local - (setq ssh-deploy-root-local (doom-project-root))) - (when ssh-deploy-automatically-detect-remote-changes - (ssh-deploy-remote-changes-handler)))) - (add-hook 'find-file-hook #'+upload|init-find-file)) + (add-hook! 'find-file-hook + (defun +upload-init-find-file-h () + (when (bound-and-true-p ssh-deploy-root-remote) + (require 'ssh-deploy) + (unless ssh-deploy-root-local + (setq ssh-deploy-root-local (doom-project-root))) + (when ssh-deploy-automatically-detect-remote-changes + (ssh-deploy-remote-changes-handler)))))) diff --git a/modules/ui/pretty-code/+fira.el b/modules/ui/pretty-code/+fira.el index 24b2982af..c5f86067f 100644 --- a/modules/ui/pretty-code/+fira.el +++ b/modules/ui/pretty-code/+fira.el @@ -112,11 +112,11 @@ ("~~>" . #Xe169) ("%%" . #Xe16a))) -(defun +pretty-code|setup-fira-ligatures () +(defun +pretty-code-setup-fira-ligatures-h () (set-fontset-font t '(#Xe100 . #Xe16f) +pretty-code-fira-code-font-name) (setq-default prettify-symbols-alist (append prettify-symbols-alist (mapcar #'+pretty-code--correct-symbol-bounds +pretty-code-fira-code-font-ligatures)))) -(add-hook 'doom-init-ui-hook #'+pretty-code|setup-fira-ligatures) +(add-hook 'doom-init-ui-hook #'+pretty-code-setup-fira-ligatures-h) diff --git a/modules/ui/pretty-code/+hasklig.el b/modules/ui/pretty-code/+hasklig.el index ad4dd0580..3d54bf982 100644 --- a/modules/ui/pretty-code/+hasklig.el +++ b/modules/ui/pretty-code/+hasklig.el @@ -48,11 +48,11 @@ ("<->" . #Xe129))) -(defun +pretty-code|setup-hasklig-ligatures () +(defun +pretty-code-setup-hasklig-ligatures-h () (set-fontset-font t '(#Xe100 . #Xe129) +pretty-code-hasklig-font-name) (setq-default prettify-symbols-alist (append prettify-symbols-alist (mapcar #'+pretty-code--correct-symbol-bounds +pretty-code-hasklig-font-ligatures)))) -(add-hook 'doom-init-ui-hook #'+pretty-code|setup-hasklig-ligatures) +(add-hook 'doom-init-ui-hook #'+pretty-code-setup-hasklig-ligatures-h) diff --git a/modules/ui/pretty-code/+iosevka.el b/modules/ui/pretty-code/+iosevka.el index e076b34ce..315dbd754 100644 --- a/modules/ui/pretty-code/+iosevka.el +++ b/modules/ui/pretty-code/+iosevka.el @@ -223,11 +223,10 @@ ("+>" . #Xe1cc)) "Defines the character mappings for ligatures for Iosevka.") -(defun +pretty-code|setup-iosevka-ligatures () +(defun +pretty-code-setup-iosevka-ligatures-h () (set-fontset-font t '(#Xe100 . #Xe1cc) +pretty-code-iosevka-font-name) (setq-default prettify-symbols-alist (append prettify-symbols-alist +pretty-code-iosevka-font-ligatures))) -(add-hook 'doom-init-ui-hook #'+pretty-code|setup-iosevka-ligatures) - +(add-hook 'doom-init-ui-hook #'+pretty-code-setup-iosevka-ligatures-h) diff --git a/modules/ui/pretty-code/+pragmata-pro.el b/modules/ui/pretty-code/+pragmata-pro.el index eafa4cedd..c22ca2f74 100644 --- a/modules/ui/pretty-code/+pragmata-pro.el +++ b/modules/ui/pretty-code/+pragmata-pro.el @@ -198,10 +198,10 @@ ("\">" . #XEA90)) "Defines the character mappings for ligatures for Pragmata Pro.") -(defun +pretty-code|setup-pragmata-pro-ligatures () +(defun +pretty-code-setup-pragmata-pro-ligatures-h () (setq-default prettify-symbols-alist (append prettify-symbols-alist (mapcar #'+pretty-code--correct-symbol-bounds +pretty-code-pragmata-pro-font-ligatures)))) -(add-hook 'doom-init-ui-hook #'+pretty-code|setup-pragmata-pro-ligatures) +(add-hook 'doom-init-ui-hook #'+pretty-code-setup-pragmata-pro-ligatures-h) diff --git a/modules/ui/pretty-code/config.el b/modules/ui/pretty-code/config.el index da9b5480f..dcea1b671 100644 --- a/modules/ui/pretty-code/config.el +++ b/modules/ui/pretty-code/config.el @@ -17,7 +17,7 @@ besides what is listed.") ;; When you get to the right edge, it goes back to how it normally prints (setq prettify-symbols-unprettify-at-point 'right-edge) -(defun +pretty-code|init-pretty-symbols () +(defun +pretty-code-init-pretty-symbols-h () "Enable `prettify-symbols-mode'. If in fundamental-mode, or a mode derived from special, comint, eshell or term @@ -39,4 +39,4 @@ Otherwise it builds `prettify-code-symbols-alist' according to (prettify-symbols-mode -1)) (prettify-symbols-mode +1)))) -(add-hook 'after-change-major-mode-hook #'+pretty-code|init-pretty-symbols) +(add-hook 'after-change-major-mode-hook #'+pretty-code-init-pretty-symbols-h)