Sett ispell and flyspell settings only if hunspell is available
This commit is contained in:
parent
64d76217f7
commit
e5ecb97e3c
1 changed files with 39 additions and 20 deletions
|
@ -56,11 +56,43 @@
|
|||
(shrface-trial)
|
||||
(shrface-default-keybindings))
|
||||
|
||||
(use-package flyspell
|
||||
:hook ((LaTeX-mode . flyspell-mode)
|
||||
(org-mode . flyspell-mode)
|
||||
(text-mode . flyspell-mode)
|
||||
(prog-mode . flyspell-prog-mode)))
|
||||
(defun hunspell-available-p ()
|
||||
"Check if Hunspell is available on the system."
|
||||
(cond
|
||||
;; Check for Windows
|
||||
((eq system-type 'windows-nt)
|
||||
(or (executable-find "hunspell.exe")
|
||||
(executable-find "hunspell")))
|
||||
;; Check for Linux and other Unix-like systems
|
||||
((or (eq system-type 'gnu/linux)
|
||||
(eq system-type 'darwin)
|
||||
(eq system-type 'berkeley-unix))
|
||||
(executable-find "hunspell"))
|
||||
;; Return nil for unsupported systems
|
||||
(t nil)))
|
||||
|
||||
(when (hunspell-available-p)
|
||||
(progn
|
||||
(use-package flyspell
|
||||
:hook ((LaTeX-mode . flyspell-mode)
|
||||
(org-mode . flyspell-mode)
|
||||
(text-mode . flyspell-mode)
|
||||
(prog-mode . flyspell-prog-mode)))
|
||||
|
||||
(use-package ispell
|
||||
:ensure nil
|
||||
:config
|
||||
;; On windows: Copy *.aff and *.dic files to C:\msys64\ucrt64\share\hunspell
|
||||
;; `hunspell -D`, the program will display the dictionaries and affix files it
|
||||
;; finds and loads.
|
||||
;; (when (eq system-type 'windows-nt)
|
||||
;; (setq ispell-program-name "c:/msys64/ucrt64/bin/hunspell.exe"))
|
||||
(setq ispell-dictionary "german,english")
|
||||
(setq ispell-local-dictionary-alist
|
||||
'(("german" "[[:alpha:]]" "[^[:alpha:]]" "[']" t ("-d" "de_DE_frami,de_AT_frami,de_CH_frami") nil utf-8)
|
||||
("english" "[[:alpha:]]" "[^[:alpha:]]" "[']" nil ("-d" "en_US,en_GB") nil utf-8)
|
||||
("german,english" "[[:alpha:]]" "[^[:alpha:]]" "[']" nil ("-d" "de_DE_frami,en_US") nil utf-8)))
|
||||
(setq ispell-hunspell-dictionary-alist ispell-local-dictionary-alist))))
|
||||
|
||||
(defun mk/nov-font-settings ()
|
||||
(setq-local line-spacing 2))
|
||||
|
@ -262,7 +294,7 @@
|
|||
(use-package spotify :bind ("S-<pause>" . spotify-playpause))
|
||||
;; (use-package clojure-mode)
|
||||
;; (use-package cider)
|
||||
)
|
||||
)
|
||||
|
||||
(use-package mastodon
|
||||
:defer t
|
||||
|
@ -302,20 +334,7 @@
|
|||
;; (cons "~/.rolo.otl"
|
||||
;; (directory-files-recursively org-directory (rx "." (or "org" "otl") eos))))))))
|
||||
|
||||
(use-package ispell
|
||||
:ensure nil
|
||||
:config
|
||||
;; On windows: Copy *.aff and *.dic files to C:\msys64\ucrt64\share\hunspell
|
||||
;; `hunspell -D`, the program will display the dictionaries and affix files it
|
||||
;; finds and loads.
|
||||
;; (when (eq system-type 'windows-nt)
|
||||
;; (setq ispell-program-name "c:/msys64/ucrt64/bin/hunspell.exe"))
|
||||
(setq ispell-dictionary "german,english")
|
||||
(setq ispell-local-dictionary-alist
|
||||
'(("german" "[[:alpha:]]" "[^[:alpha:]]" "[']" t ("-d" "de_DE_frami,de_AT_frami,de_CH_frami") nil utf-8)
|
||||
("english" "[[:alpha:]]" "[^[:alpha:]]" "[']" nil ("-d" "en_US,en_GB") nil utf-8)
|
||||
("german,english" "[[:alpha:]]" "[^[:alpha:]]" "[']" nil ("-d" "de_DE_frami,en_US") nil utf-8)))
|
||||
(setq ispell-hunspell-dictionary-alist ispell-local-dictionary-alist))
|
||||
|
||||
|
||||
(use-package plantuml-mode
|
||||
:mode ("\\.puml\\'" "\\.plantuml\\'")
|
||||
|
|
Loading…
Add table
Reference in a new issue