From abf452d3884de3a9ada37c508c48669a77fc730f Mon Sep 17 00:00:00 2001 From: Alex Date: Fri, 28 Feb 2025 19:30:19 +0100 Subject: [PATCH] Add Vale spell checking, including Rust code * Use built-in support of use-package for Git repos * Modernize the Emacs RH configuration --- emacs/emacs-rh.el | 19 ++++++------------- emacs/emacs.el | 8 ++++++++ 2 files changed, 14 insertions(+), 13 deletions(-) diff --git a/emacs/emacs-rh.el b/emacs/emacs-rh.el index 0948a36..67de770 100644 --- a/emacs/emacs-rh.el +++ b/emacs/emacs-rh.el @@ -19,20 +19,13 @@ :config (add-hook 'adoc-mode-hook #'abbrev-mode)) -(cl-defun slot/vc-install (&key (fetcher "github") repo name rev backend) - (let* ((url (format "https://www.%s.com/%s" fetcher repo)) - (iname (when name (intern name))) - (pac-name (or iname (intern (file-name-base repo))))) - (unless (package-installed-p pac-name) - (package-vc-install url iname rev backend)))) - (use-package flymake-vale - :init (slot/vc-install :fetcher "github" :repo "tpeacock19/flymake-vale") - :ensure t) - -(add-hook 'adoc-mode-hook #'flymake-vale-load) -(add-hook 'find-file-hook 'flymake-vale-maybe-load) -(add-hook 'adoc-mode-hook 'flymake-mode) + :vc (:url "https://github.com/tpeacock19/flymake-vale.git" + :rev :newest) + :config + (add-to-list 'flymake-vale-modes 'adoc-mode) + (add-hook 'find-file-hook 'flymake-vale-maybe-load) + ) (use-package flymake-aspell :ensure t) diff --git a/emacs/emacs.el b/emacs/emacs.el index 0e6713f..860e7b7 100644 --- a/emacs/emacs.el +++ b/emacs/emacs.el @@ -155,3 +155,11 @@ (setq prolog-system 'swi) (setq auto-mode-alist (append '(("\\.pl\\'" . prolog-mode)) auto-mode-alist)) + +(use-package flymake-vale + :vc (:url "https://github.com/tpeacock19/flymake-vale.git" + :rev :newest) + :config + (add-to-list 'flymake-vale-modes 'rust-mode) + (add-hook 'find-file-hook 'flymake-vale-maybe-load) + ) -- 2.47.3