bug-gnu-emacs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

bug#34272: 26.1.91 M-x flyspell-mode


From: Eli Zaretskii
Subject: bug#34272: 26.1.91 M-x flyspell-mode
Date: Sat, 09 Feb 2019 11:18:33 +0200

> Date: Fri, 08 Feb 2019 20:30:01 +0900 (JST)
> Cc: homeros.misasa@gmail.com, 34272@debbugs.gnu.org,
>  tkk@misasa.okayama-u.ac.jp
> From: Tak Kunihiro <tkk@misasa.okayama-u.ac.jp>
> 
> I traced `ispell-find-hunspell-dictionaries' using Edebug.  I have an
> impression, problem is something to do with initialization on
> `hunspell-default-dict'.  The output is shown below.

Thanks.

hunspell-default-dict is computed in this function,
ispell-find-hunspell-dictionaries.  It starts as nil, and then the
function iterates through the list of dictionaries produced by the
command "hunspell -D nul", looking for a dictionary name that ends
with a ".aff".  Here's the relevant portion of the code:

  (let ((hunspell-found-dicts
         (split-string
          (with-temp-buffer
            (ispell-call-process ispell-program-name
                                 null-device
                                 t
                                 nil
                                 ;; Hunspell 1.7.0 (and later?) won't
                                 ;; show LOADED DICTIONARY unless
                                 ;; there's at least one file argument
                                 ;; on the command line.  So we feed
                                 ;; it with the null device.
                                 "-D" null-device)
            (buffer-string))
          "[\n\r]+"
          t))
        hunspell-default-dict
        hunspell-default-dict-entry
        hunspell-multi-dict)
    (dolist (dict hunspell-found-dicts)
      (let* ((full-name (file-name-nondirectory dict))
             (basename  (file-name-sans-extension full-name))
             (affix-file (concat dict ".aff")))
        (if (string-match "\\.aff$" dict)
            ;; Found default dictionary
            (progn
              (if hunspell-default-dict
                  (setq hunspell-multi-dict
                        (concat (or hunspell-multi-dict
                                    (car hunspell-default-dict))
                                "," basename))
                (setq affix-file dict)

I need to understand what goes wrong inside this dolist loop that
causes hunspell-default-dict be left at its initial nil value.  This
portion is entirely missing from your trace:

> * Lines surveyed
> 
> ispell:1104: (defun ispell-find-hunspell-dictionaries ()
> ...
> ispell:1187:    (setq hunspell-default-dict (or hunspell-multi-dict
> ispell:1188:                              (car hunspell-default-dict)))
> ispell:1189:    (setq hunspell-default-dict-entry
> ispell:1190:    (ispell-parse-hunspell-affix-file hunspell-default-dict))

This jumps from line 1104 to 1187, whereas the code fragment shown
above is between lines 1129 and 1158.  Please show me what happens in
that loop, because this is the key to the problem, I think.

(I tried to simulate what should be happening for you, by using the
Hunspell output you have shown in your previous message, but couldn't
spot any problem

Thanks.





reply via email to

[Prev in Thread] Current Thread [Next in Thread]