3

I use flyspell hunspell for checking my spelling mistakes in Emacs. Recently, when I run M-x flyspell-mode in .org or .tex files I got the following error:

Error enabling Flyspell mode:
 (hunspell exited with signal  Abort trap: 6)

I didn't get this error in the past, and I think I have changed nothing from my config.

My .emacs file for latex, ispell and hunspell are:

;; LATEX
;;
(setq TeX-auto-save t)
(setq TeX-parse-self t)
(setq-default TeX-master nil)

(setq ispell-program-name "hunspell") ;; Dictionaries
(add-hook 'LaTeX-mode-hook 'visual-line-mode)
(add-hook 'LaTeX-mode-hook 'LaTeX-math-mode)
(add-hook 'LaTeX-mode-hook 'TeX-source-correlate-mode)

(add-hook 'LaTeX-mode-hook 'turn-on-reftex)
(setq reftex-plug-into-AUCTeX t)
(setq TeX-PDF-mode t)

(setq TeX-output-view-style
    (quote
     (("^pdf$" "." "evince -f %o")
      ("^html?$" "." "iceweasel %o"))))

;;
;;ispell config
;;
(setenv "PATH" (concat (getenv "PATH") ":/usr/local/bin"))
(setq exec-path (append exec-path '("/usr/local/bin")))

How can I debug this?

UPDATE

I solved the problem by:

  1. upgrade brew

  2. removing:

    (setq ispell-program-name "hunspell") ;; Dictionaries
    
    ;;
    ;;ispell config
    ;;
    (setenv "PATH" (concat (getenv "PATH") ":/usr/local/bin"))
    (setq exec-path (append exec-path '("/usr/local/bin")))
    
  3. and adding:

    (setq ispell-program-name "hunspell")
    (setq ispell-local-dictionary "en_GB")
    (setq ispell-local-dictionary-alist
          '(("en_GB" "[[:alpha:]]" "[^[:alpha:]]" "[']" nil nil nil utf-8)))
    
Andrew Swann
  • 3,436
  • 2
  • 15
  • 43
Irbin B.
  • 131
  • 1
  • 5
  • There is some problem with the interface to hunspell version 1.7. See https://emacs.stackexchange.com/q/47344/2710 for a different approach. – Andrew Swann Feb 17 '19 at 12:42

1 Answers1

0

Why do you have to specify the environment paths? Doesn't your aspell work when you type aspell --version in your terminal? In any case, this is my flyspell configuration:

;; Spell-check
(require 'flyspell)
(setq flyspell-issue-message-flag nil
      ispell-local-dictionary "en_GB"
      ispell-program-name "aspell"
      ispell-extra-args '("--sug-mode=ultra"))

(add-hook 'text-mode-hook 'flyspell-mode)
(add-hook 'prog-mode-hook 'flyspell-prog-mode)

Sorry, didn't realise you were using hunspell. I think aspell is the preferred utility. You have to install aspell separately from your terminal and install the required dictionary as well.

Arktik
  • 932
  • 4
  • 15
  • I am not sure but I think aspell is no longer maintained. Anyway I have already solved my issue. Thanks. – Irbin B. Feb 17 '19 at 04:58