Check for hunspell and mutool exe
This commit is contained in:
parent
fb75187167
commit
cc9d279f0b
1 changed files with 18 additions and 17 deletions
35
init.el
35
init.el
|
@ -157,6 +157,21 @@
|
||||||
(setq doom-themes-enable-bold t
|
(setq doom-themes-enable-bold t
|
||||||
doom-themes-enable-italic t))
|
doom-themes-enable-italic t))
|
||||||
|
|
||||||
|
(defun mk/exe-available-p (exe-name)
|
||||||
|
"Check if exe is available on the system."
|
||||||
|
(cond
|
||||||
|
;; Check for Windows
|
||||||
|
((eq system-type 'windows-nt)
|
||||||
|
(or (executable-find (format "%s.exe" exe-name))
|
||||||
|
(executable-find exe-name)))
|
||||||
|
;; 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 exe-name))
|
||||||
|
;; Return nil for unsupported systems
|
||||||
|
(t nil)))
|
||||||
|
|
||||||
;; (load "bundle--gui")
|
;; (load "bundle--gui")
|
||||||
|
|
||||||
(setq-default mode-line-format
|
(setq-default mode-line-format
|
||||||
|
@ -323,6 +338,7 @@
|
||||||
|
|
||||||
(use-package doc-view
|
(use-package doc-view
|
||||||
:ensure nil
|
:ensure nil
|
||||||
|
:init (mk/exe-available-p "mutool")
|
||||||
:custom
|
:custom
|
||||||
(doc-view-continuous nil)
|
(doc-view-continuous nil)
|
||||||
(doc-view-scale-internally nil)
|
(doc-view-scale-internally nil)
|
||||||
|
@ -421,22 +437,7 @@
|
||||||
(shrface-trial)
|
(shrface-trial)
|
||||||
(shrface-default-keybindings))
|
(shrface-default-keybindings))
|
||||||
|
|
||||||
(defun hunspell-available-p ()
|
(when (mk/exe-available-p "hunspell")
|
||||||
"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
|
(progn
|
||||||
(use-package flyspell
|
(use-package flyspell
|
||||||
:hook ((LaTeX-mode . flyspell-mode)
|
:hook ((LaTeX-mode . flyspell-mode)
|
||||||
|
@ -446,7 +447,7 @@
|
||||||
(use-package ispell
|
(use-package ispell
|
||||||
:ensure nil
|
:ensure nil
|
||||||
:config
|
:config
|
||||||
;; On windows: Copy *.aff and *.dic files to C:\msys64\ucrt64\share\hunspell
|
;; On windows: Copy *.aff and *.dic files to C:\msys64\ucrt64\share\hunspell or C:\cygwin64\usr\share\myspell
|
||||||
;; `hunspell -D`, the program will display the dictionaries and affix files it
|
;; `hunspell -D`, the program will display the dictionaries and affix files it
|
||||||
;; finds and loads.
|
;; finds and loads.
|
||||||
;; (when (eq system-type 'windows-nt)
|
;; (when (eq system-type 'windows-nt)
|
||||||
|
|
Loading…
Add table
Reference in a new issue