feat(emacs): Spell-checking

- Uses Aspell and Jinx.
This commit is contained in:
Madeleine Sydney
2025-02-17 21:36:30 -07:00
parent 12caaa6097
commit e730599357
5 changed files with 89 additions and 36 deletions

View File

@@ -10,7 +10,9 @@
`(("Kagi" . "https://kagi.com/search?q=%s")
("DuckDuckGo" . "https://duckduckgo.com/?q=%s")
("Nixpkgs" . "https://search.nixos.org/packages?query=%s")
("Hackage" . "https://hackage.haskell.org/packages/search?terms=%s"))
("Hackage" . "https://hackage.haskell.org/packages/search?terms=%s")
("The Free Dictionary" . "https://www.thefreedictionary.com/%s")
("The Free Thesaurus" . "https://www.freethesaurus.com/%s"))
"A list of pairs (NAME . BACKEND) describing the various backends
`syd-lookup-online-documentation' may delegate to.

View File

@@ -1,5 +1,7 @@
;;; syd-prose.el -*- lexical-binding: t; -*-
;; Soft-wrap text to not the window edge, but a constant width. Also allows for
;; centering buffer text.
(use-package visual-fill-column
:defer t)
@@ -11,12 +13,35 @@
"Sets the buffer-local value for `visual-fill-column-center-text'."
(setq-local visual-fill-column-center-text t))
;; Jinx is a fast just-in-time spell-checker for Emacs. Jinx highlights
;; misspelled words in the text of the visible portion of the buffer. For
;; efficiency, Jinx highlights misspellings lazily, recognizes window boundaries
;; and text folding, if any. For example, when unfolding or scrolling, only the
;; newly visible part of the text is checked if it has not been checked
;; before. Each misspelling can be corrected from a list of dictionary words
;; presented as a completion menu.
(use-package jinx
;; Managed by Nix.
:straight nil
:commands (jinx-mode jinx-correct jinx-correct-word)
:init (defun syd-jinx--jinx-or-ispell ()
(interactive)
(if (bound-and-true-p jinx-mode)
(call-interactively #'jinx-correct-word)
(call-interactively #'ispell-word)))
:general (:states '(normal visual)
"z =" #'syd-jinx--jinx-or-ispell)
:config
;; Default is "en_US"; fuck that!
(jinx-languages "en" t))
(defvar syd-prose-mode-hook
(list #'syd-prose-set-visual-fill-column-center
#'visual-fill-column-mode
#'visual-line-mode
#'variable-pitch-mode
#'syd-prose-disable-display-line-numbers-mode-h)
#'syd-prose-disable-display-line-numbers-mode-h
#'jinx-mode)
"Hooks run for `syd-prose-mode'.")
;;;###autoload