summaryrefslogtreecommitdiff
path: root/emacs/inits/23-text-related.el
diff options
context:
space:
mode:
authortslil clingman <>2020-03-24 10:19:15 -0700
committertslil clingman <>2020-03-24 10:19:15 -0700
commit131eae8d53e8bf41023e11da7382294f187ea41d (patch)
tree5cf47fd38bff4c6586e6f3aef48a92bebcf155c0 /emacs/inits/23-text-related.el
parent6e0beb56dd2fdfccba3094185ca52628091b1208 (diff)
Changes from bison
Diffstat (limited to 'emacs/inits/23-text-related.el')
-rw-r--r--emacs/inits/23-text-related.el34
1 files changed, 29 insertions, 5 deletions
diff --git a/emacs/inits/23-text-related.el b/emacs/inits/23-text-related.el
index 8d48795..0efdc95 100644
--- a/emacs/inits/23-text-related.el
+++ b/emacs/inits/23-text-related.el
@@ -1,10 +1,35 @@
-;; Time-stamp: <2019-07-17 18:18:58 (tslil@basingstoke)>
+;; Time-stamp: <2020-03-04 21:49:11 (tslil@bison)>
;; -----------------------------------------------------------------------------
;; Spelling
-(use-package flyspell-correct-ivy
- :ensure t :defer t)
+(defun flyspell-correct-selectrum (candidates word)
+ (let* ((save "[SAVE]")
+ (accept-session "[ACCEPT (session)]")
+ (accept-buffer "[ACCEPT (buffer)]")
+ (skip "[SKIP]")
+ (selectrucm-should-sort nil)
+ (result (selectrum-completing-read
+ (format "Correcting '%s': " word)
+ (append candidates
+ (list save accept-session accept-buffer skip)))))
+ (cond
+ ((string= result save)
+ (cons 'save word))
+ ((string= result accept-session)
+ (cons 'session word))
+ ((string= result accept-buffer)
+ (cons 'buffer word))
+ ((string= result skip)
+ (cons 'skip word))
+ (t
+ result))))
+
+(use-package flyspell-correct
+ :ensure t
+ :defer t
+ :config
+ (setq flyspell-correct-interface #'flyspell-correct-selectrum))
(use-package flyspell
:ensure t
@@ -15,8 +40,7 @@
("C-\"" . nil))
:init
(setq ispell-dictionary "british"
- flyspell-default-dictionary "british"
- flyspell-correct-interface #'flyspell-correct-ivy))
+ flyspell-default-dictionary "british"))
(setq sentence-end-double-space nil)