bug#34272: 26.1.91 M-x flyspell-mode

classic Classic list List threaded Threaded
13 messages Options
Reply | Threaded
Open this post in threaded view
|

bug#34272: 26.1.91 M-x flyspell-mode

Tak Kunihiro-3
I cannot start flyspell-mode on GNU Emacs 26.1.91 (build 1, x86_64-w64-mingw32).
I can    start flyspell-mode on GNU Emacs 26.1 (build 1, x86_64-w64-mingw32)
I wonder if this is something to do with 26.1.91.

CMD> c:/msys64/mingw64/bin/hunspell.exe --version
@(#) International Ispell Version 3.2.06 (but really Hunspell 1.6.2)

GNU Emacs 26.1.91 (build 1, x86_64-w64-mingw32)
CMD> runemacs -Q

M-: (with-eval-after-load "ispell"
        (ispell-change-dictionary "en_US" t))
M-: (setq ispell-program-name "c:/msys64/mingw64/bin/hunspell.exe"
          ispell-local-dictionary "en_US"
          ispell-local-dictionary-alist
          '(("en_US" "[[:alpha:]]" "[^[:alpha:]]" "[']" nil ("-d" "en_US") nil utf-8)))
M-x flyspell-mode
  Error enabling Flyspell mode:
   (stringp nil)



Reply | Threaded
Open this post in threaded view
|

bug#34272: 26.1.91 M-x flyspell-mode

Eli Zaretskii
> From: Tak Kunihiro <[hidden email]>
> Date: Fri, 01 Feb 2019 22:54:05 +0900
> Cc: [hidden email]
>
> I cannot start flyspell-mode on GNU Emacs 26.1.91 (build 1, x86_64-w64-mingw32).
> I can    start flyspell-mode on GNU Emacs 26.1 (build 1, x86_64-w64-mingw32)
> I wonder if this is something to do with 26.1.91.
>
> CMD> c:/msys64/mingw64/bin/hunspell.exe --version
> @(#) International Ispell Version 3.2.06 (but really Hunspell 1.6.2)
>
> GNU Emacs 26.1.91 (build 1, x86_64-w64-mingw32)
> CMD> runemacs -Q
>
> M-: (with-eval-after-load "ispell"
>         (ispell-change-dictionary "en_US" t))
> M-: (setq ispell-program-name "c:/msys64/mingw64/bin/hunspell.exe"
>           ispell-local-dictionary "en_US"
>           ispell-local-dictionary-alist
>           '(("en_US" "[[:alpha:]]" "[^[:alpha:]]" "[']" nil ("-d" "en_US") nil utf-8)))
> M-x flyspell-mode
>   Error enabling Flyspell mode:
>    (stringp nil)

Please show the output of the following 2 commands from the Windows
cmd shell's prompt:

  c:\msys64\mingw64\bin\hunspell.exe -D nul
  c:\msys64\mingw64\bin\hunspell.exe -D

Thanks.



Reply | Threaded
Open this post in threaded view
|

bug#34272: 26.1.91 M-x flyspell-mode

Tak Kunihiro
>> From: Tak Kunihiro <[hidden email]>
>> Date: Fri, 01 Feb 2019 22:54:05 +0900
>> Cc: [hidden email]
>>
>> I cannot start flyspell-mode on GNU Emacs 26.1.91 (build 1, x86_64-w64-mingw32).
>> I can    start flyspell-mode on GNU Emacs 26.1 (build 1, x86_64-w64-mingw32)
>> I wonder if this is something to do with 26.1.91.
>>
>> CMD> c:/msys64/mingw64/bin/hunspell.exe --version
>> @(#) International Ispell Version 3.2.06 (but really Hunspell 1.6.2)
>>
>> GNU Emacs 26.1.91 (build 1, x86_64-w64-mingw32)
>> CMD> runemacs -Q
>>
>> M-: (with-eval-after-load "ispell"
>>         (ispell-change-dictionary "en_US" t))
>> M-: (setq ispell-program-name "c:/msys64/mingw64/bin/hunspell.exe"
>>           ispell-local-dictionary "en_US"
>>           ispell-local-dictionary-alist
>>           '(("en_US" "[[:alpha:]]" "[^[:alpha:]]" "[']" nil ("-d" "en_US") nil utf-8)))
>> M-x flyspell-mode
>>   Error enabling Flyspell mode:
>>    (stringp nil)
>
> Please show the output of the following 2 commands from the Windows
> cmd shell's prompt:
>
>   c:\msys64\mingw64\bin\hunspell.exe -D nul
>   c:\msys64\mingw64\bin\hunspell.exe -D

Following is the output from hunspell.exe -D nul and hunspell.exe -D.
I hope this helps.


CMD> c:\msys64\mingw64\bin\hunspell.exe -D nul
SEARCH PATH:
.;c:/msys64/mingw64/bin/;c:/msys64/mingw64/share/hunspell;c:/msys64/mingw64/share/myspell;c:/msys64/mingw64/share/myspell/dicts;c:/msys64;%USERPROFILE%/Application Data/OpenOffice.org 2/user/wordbook;c:/msys64/mingw64/share/dict/ooo;
AVAILABLE DICTIONARIES (path is not mandatory for -d option):
c:/msys64/mingw64/share/hunspell/en_AG
c:/msys64/mingw64/share/hunspell/en_AU
c:/msys64/mingw64/share/hunspell/en_BS
c:/msys64/mingw64/share/hunspell/en_BW
c:/msys64/mingw64/share/hunspell/en_BZ
c:/msys64/mingw64/share/hunspell/en_CA
c:/msys64/mingw64/share/hunspell/en_DK
c:/msys64/mingw64/share/hunspell/en_GB
c:/msys64/mingw64/share/hunspell/en_GH
c:/msys64/mingw64/share/hunspell/en_HK
c:/msys64/mingw64/share/hunspell/en_IE
c:/msys64/mingw64/share/hunspell/en_IN
c:/msys64/mingw64/share/hunspell/en_JM
c:/msys64/mingw64/share/hunspell/en_NA
c:/msys64/mingw64/share/hunspell/en_NG
c:/msys64/mingw64/share/hunspell/en_NZ
c:/msys64/mingw64/share/hunspell/en_PH
c:/msys64/mingw64/share/hunspell/en_SG
c:/msys64/mingw64/share/hunspell/en_TT
c:/msys64/mingw64/share/hunspell/en_US
c:/msys64/mingw64/share/hunspell/en_ZA
c:/msys64/mingw64/share/hunspell/en_ZW
c:/msys64/mingw64/share/myspell/dicts/en_AG
c:/msys64/mingw64/share/myspell/dicts/en_AU
c:/msys64/mingw64/share/myspell/dicts/en_BS
c:/msys64/mingw64/share/myspell/dicts/en_BW
c:/msys64/mingw64/share/myspell/dicts/en_BZ
c:/msys64/mingw64/share/myspell/dicts/en_CA
c:/msys64/mingw64/share/myspell/dicts/en_DK
c:/msys64/mingw64/share/myspell/dicts/en_GB
c:/msys64/mingw64/share/myspell/dicts/en_GH
c:/msys64/mingw64/share/myspell/dicts/en_HK
c:/msys64/mingw64/share/myspell/dicts/en_IE
c:/msys64/mingw64/share/myspell/dicts/en_IN
c:/msys64/mingw64/share/myspell/dicts/en_JM
c:/msys64/mingw64/share/myspell/dicts/en_NA
c:/msys64/mingw64/share/myspell/dicts/en_NG
c:/msys64/mingw64/share/myspell/dicts/en_NZ
c:/msys64/mingw64/share/myspell/dicts/en_PH
c:/msys64/mingw64/share/myspell/dicts/en_SG
c:/msys64/mingw64/share/myspell/dicts/en_TT
c:/msys64/mingw64/share/myspell/dicts/en_US
c:/msys64/mingw64/share/myspell/dicts/en_ZA
c:/msys64/mingw64/share/myspell/dicts/en_ZW
LOADED DICTIONARY:
c:/msys64/mingw64/share/hunspell/en_US.aff
c:/msys64/mingw64/share/hunspell/en_US.dic
Can't create tempfile: Permission denied

CMD>



CMD> c:\msys64\mingw64\bin\hunspell.exe -D
SEARCH PATH:
.;c:/msys64/mingw64/bin/;c:/msys64/mingw64/share/hunspell;c:/msys64/mingw64/share/myspell;c:/msys64/mingw64/share/myspell/dicts;c:/msys64;%USERPROFILE%/Application Data/OpenOffice.org 2/user/wordbook;c:/msys64/mingw64/share/dict/ooo;
AVAILABLE DICTIONARIES (path is not mandatory for -d option):
c:/msys64/mingw64/share/hunspell/en_AG
c:/msys64/mingw64/share/hunspell/en_AU
c:/msys64/mingw64/share/hunspell/en_BS
c:/msys64/mingw64/share/hunspell/en_BW
c:/msys64/mingw64/share/hunspell/en_BZ
c:/msys64/mingw64/share/hunspell/en_CA
c:/msys64/mingw64/share/hunspell/en_DK
c:/msys64/mingw64/share/hunspell/en_GB
c:/msys64/mingw64/share/hunspell/en_GH
c:/msys64/mingw64/share/hunspell/en_HK
c:/msys64/mingw64/share/hunspell/en_IE
c:/msys64/mingw64/share/hunspell/en_IN
c:/msys64/mingw64/share/hunspell/en_JM
c:/msys64/mingw64/share/hunspell/en_NA
c:/msys64/mingw64/share/hunspell/en_NG
c:/msys64/mingw64/share/hunspell/en_NZ
c:/msys64/mingw64/share/hunspell/en_PH
c:/msys64/mingw64/share/hunspell/en_SG
c:/msys64/mingw64/share/hunspell/en_TT
c:/msys64/mingw64/share/hunspell/en_US
c:/msys64/mingw64/share/hunspell/en_ZA
c:/msys64/mingw64/share/hunspell/en_ZW
c:/msys64/mingw64/share/myspell/dicts/en_AG
c:/msys64/mingw64/share/myspell/dicts/en_AU
c:/msys64/mingw64/share/myspell/dicts/en_BS
c:/msys64/mingw64/share/myspell/dicts/en_BW
c:/msys64/mingw64/share/myspell/dicts/en_BZ
c:/msys64/mingw64/share/myspell/dicts/en_CA
c:/msys64/mingw64/share/myspell/dicts/en_DK
c:/msys64/mingw64/share/myspell/dicts/en_GB
c:/msys64/mingw64/share/myspell/dicts/en_GH
c:/msys64/mingw64/share/myspell/dicts/en_HK
c:/msys64/mingw64/share/myspell/dicts/en_IE
c:/msys64/mingw64/share/myspell/dicts/en_IN
c:/msys64/mingw64/share/myspell/dicts/en_JM
c:/msys64/mingw64/share/myspell/dicts/en_NA
c:/msys64/mingw64/share/myspell/dicts/en_NG
c:/msys64/mingw64/share/myspell/dicts/en_NZ
c:/msys64/mingw64/share/myspell/dicts/en_PH
c:/msys64/mingw64/share/myspell/dicts/en_SG
c:/msys64/mingw64/share/myspell/dicts/en_TT
c:/msys64/mingw64/share/myspell/dicts/en_US
c:/msys64/mingw64/share/myspell/dicts/en_ZA
c:/msys64/mingw64/share/myspell/dicts/en_ZW
LOADED DICTIONARY:
c:/msys64/mingw64/share/hunspell/en_US.aff
c:/msys64/mingw64/share/hunspell/en_US.dic
Hunspell 1.6.2
^C
CMD>



Reply | Threaded
Open this post in threaded view
|

bug#34272: 26.1.91 M-x flyspell-mode

Eli Zaretskii
> Date: Sat, 02 Feb 2019 08:03:32 +0900 (JST)
> Cc: [hidden email], [hidden email],
>  [hidden email]
> From: Tak Kunihiro <[hidden email]>
>
> >> M-x flyspell-mode
> >>   Error enabling Flyspell mode:
> >>    (stringp nil)
> >
> > Please show the output of the following 2 commands from the Windows
> > cmd shell's prompt:
> >
> >   c:\msys64\mingw64\bin\hunspell.exe -D nul
> >   c:\msys64\mingw64\bin\hunspell.exe -D
>
> Following is the output from hunspell.exe -D nul and hunspell.exe -D.
> I hope this helps.
>
>
> CMD> c:\msys64\mingw64\bin\hunspell.exe -D nul
> SEARCH PATH:
> .;c:/msys64/mingw64/bin/;c:/msys64/mingw64/share/hunspell;c:/msys64/mingw64/share/myspell;c:/msys64/mingw64/share/myspell/dicts;c:/msys64;%USERPROFILE%/Application Data/OpenOffice.org 2/user/wordbook;c:/msys64/mingw64/share/dict/ooo;
> AVAILABLE DICTIONARIES (path is not mandatory for -d option):
> c:/msys64/mingw64/share/hunspell/en_AG
> c:/msys64/mingw64/share/hunspell/en_AU
> c:/msys64/mingw64/share/hunspell/en_BS
> c:/msys64/mingw64/share/hunspell/en_BW
> c:/msys64/mingw64/share/hunspell/en_BZ
> c:/msys64/mingw64/share/hunspell/en_CA
> c:/msys64/mingw64/share/hunspell/en_DK
> c:/msys64/mingw64/share/hunspell/en_GB
> c:/msys64/mingw64/share/hunspell/en_GH
> c:/msys64/mingw64/share/hunspell/en_HK
> c:/msys64/mingw64/share/hunspell/en_IE
> c:/msys64/mingw64/share/hunspell/en_IN
> c:/msys64/mingw64/share/hunspell/en_JM
> c:/msys64/mingw64/share/hunspell/en_NA
> c:/msys64/mingw64/share/hunspell/en_NG
> c:/msys64/mingw64/share/hunspell/en_NZ
> c:/msys64/mingw64/share/hunspell/en_PH
> c:/msys64/mingw64/share/hunspell/en_SG
> c:/msys64/mingw64/share/hunspell/en_TT
> c:/msys64/mingw64/share/hunspell/en_US
> c:/msys64/mingw64/share/hunspell/en_ZA
> c:/msys64/mingw64/share/hunspell/en_ZW
> c:/msys64/mingw64/share/myspell/dicts/en_AG
> c:/msys64/mingw64/share/myspell/dicts/en_AU
> c:/msys64/mingw64/share/myspell/dicts/en_BS
> c:/msys64/mingw64/share/myspell/dicts/en_BW
> c:/msys64/mingw64/share/myspell/dicts/en_BZ
> c:/msys64/mingw64/share/myspell/dicts/en_CA
> c:/msys64/mingw64/share/myspell/dicts/en_DK
> c:/msys64/mingw64/share/myspell/dicts/en_GB
> c:/msys64/mingw64/share/myspell/dicts/en_GH
> c:/msys64/mingw64/share/myspell/dicts/en_HK
> c:/msys64/mingw64/share/myspell/dicts/en_IE
> c:/msys64/mingw64/share/myspell/dicts/en_IN
> c:/msys64/mingw64/share/myspell/dicts/en_JM
> c:/msys64/mingw64/share/myspell/dicts/en_NA
> c:/msys64/mingw64/share/myspell/dicts/en_NG
> c:/msys64/mingw64/share/myspell/dicts/en_NZ
> c:/msys64/mingw64/share/myspell/dicts/en_PH
> c:/msys64/mingw64/share/myspell/dicts/en_SG
> c:/msys64/mingw64/share/myspell/dicts/en_TT
> c:/msys64/mingw64/share/myspell/dicts/en_US
> c:/msys64/mingw64/share/myspell/dicts/en_ZA
> c:/msys64/mingw64/share/myspell/dicts/en_ZW
> LOADED DICTIONARY:
> c:/msys64/mingw64/share/hunspell/en_US.aff
> c:/msys64/mingw64/share/hunspell/en_US.dic
> Can't create tempfile: Permission denied  <<<<<<<<<<<<<<<<<<<<

The last line could be the source of the problem, but I still don't
understand why it happens (are you running in a directory where you
cannot create files?), nor why that would prevent Flyspell from
working.  Please step with Edebug through
ispell-find-hunspell-dictionaries (it is called once, when Flyspell is
activated), and tell what you see there.  It is supposed to find this
line in the output:

  c:/msys64/mingw64/share/hunspell/en_US.aff

and then call ispell-parse-hunspell-affix-file with the name of that
dictionary.



Reply | Threaded
Open this post in threaded view
|

bug#34272: 26.1.91 M-x flyspell-mode

Eli Zaretskii
In reply to this post by Tak Kunihiro-3
Ping!  Any news regarding this one?  I'd like to fix whatever needs to
be fixed before Emacs 26.2 is released.  Could you please respond to
my requests, see https://debbugs.gnu.org/cgi/bugreport.cgi?bug=34272#14?

Thanks.



Reply | Threaded
Open this post in threaded view
|

bug#34272: 26.1.91 M-x flyspell-mode

Tak Kunihiro
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.


* Recipe with success

CMD> c:\emacs-26.1\bin\runemacs.exe -Q
(setq ispell-program-name "c:/msys64/mingw64/bin/hunspell.exe")
M-x flyspell-mode

* Recipe with failure

CMD> c:\emacs-26.1.91\bin\runemacs.exe -Q
(setq ispell-program-name "c:/msys64/mingw64/bin/hunspell.exe")
M-x flyspell-mode

Error enabling Flyspell mode:
(stringp nil)

* 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))

* Output by Edebug

ispell:1187: (setq hunspell-default-dict (or hunspell-multi-dict
ispell:1188:                                 (car hunspell-default-dict)))

hunspell-multi-dict                     ; => nil
hunspell-default-dict                   ; => nil
(car hunspell-default-dict)             ; => nil
(or hunspell-multi-dict
    (car hunspell-default-dict))        ; => nil
(setq hunspell-default-dict
      (or hunspell-multi-dict
          (car hunspell-default-dict))) ; => nil

ispell:1189: (setq hunspell-default-dict-entry
ispell:1189:   (ispell-parse-hunspell-affix-file hunspell-default-dict))

hunspell-default-dict                   ; => nil
(ispell-parse-hunspell-affix-file hunspell-default-dict) ; => crash



Reply | Threaded
Open this post in threaded view
|

bug#34272: 26.1.91 M-x flyspell-mode

Eli Zaretskii
> Date: Fri, 08 Feb 2019 20:30:01 +0900 (JST)
> Cc: [hidden email], [hidden email],
>  [hidden email]
> From: Tak Kunihiro <[hidden email]>
>
> 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 | Threaded
Open this post in threaded view
|

bug#34272: 26.1.91 M-x flyspell-mode

Tak Kunihiro
>> 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.
>
> 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))


I think that I found issue.  In my environment, `ispell-call-process'
returns empty string with `null-device'.

Output with and without `null-device' is shown below.



* With `null-device'

(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))                      ; => ""


* Without `null-device',

(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")
  (buffer-string))                      ; => see below

"SEARCH PATH:
.;c:/msys64/mingw64/bin/;c:/msys64/mingw64/share/hunspell;c:/msys64/mingw64/share/myspell;c:/msys64/mingw64/share/myspell/dicts;c:/msys64;%USERPROFILE%/Application Data/OpenOffice.org 2/user/wordbook;c:/msys64/mingw64/share/dict/ooo;
AVAILABLE DICTIONARIES (path is not mandatory for -d option):
c:/msys64/mingw64/share/hunspell/en_AG
...
c:/msys64/mingw64/share/hunspell/en_ZW
c:/msys64/mingw64/share/myspell/dicts/en_AG
...
c:/msys64/mingw64/share/myspell/dicts/en_ZW
LOADED DICTIONARY:
c:/msys64/mingw64/share/hunspell/en_US.aff
c:/msys64/mingw64/share/hunspell/en_US.dic
Hunspell 1.6.2
"




Reply | Threaded
Open this post in threaded view
|

bug#34272: 26.1.91 M-x flyspell-mode

Eli Zaretskii
> Date: Sat, 09 Feb 2019 18:48:31 +0900 (JST)
> Cc: [hidden email], [hidden email],
>  [hidden email]
> From: Tak Kunihiro <[hidden email]>
>
> I think that I found issue.  In my environment, `ispell-call-process'
> returns empty string with `null-device'.

That's strange.  What is the value of null-device on your system?

> * With `null-device'
>
> (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))                      ; => ""

Did you make sure ispell-program-name is set to "hunspell" when you
evaluated the above form?  Its default value is something else.



Reply | Threaded
Open this post in threaded view
|

bug#34272: 26.1.91 M-x flyspell-mode

Tak Kunihiro
>> I think that I found issue.  In my environment, `ispell-call-process'
>> returns empty string with `null-device'.
>
> That's strange.  What is the value of null-device on your system?

On my system, null-device returns "NUL".

> Did you make sure ispell-program-name is set to "hunspell" when you
> evaluated the above form?  Its default value is something else.

Yes, I set it to "c:/msys64/mingw64/bin/hunspell.exe".  Again, the
output is shown below.


CMD> c:\emacs-26.1.91\bin\runemacs.exe -Q

null-device ; => "NUL"
(setq ispell-program-name "c:/msys64/mingw64/bin/hunspell.exe")

(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))                      ; => ""

(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")
  (buffer-string))                      ; => see below

"SEARCH PATH:
.;c:/msys64/mingw64/bin/;c:/msys64/mingw64/share/hunspell;c:/msys64/mingw64/share/myspell;c:/msys64/mingw64/share/myspell/dicts;c:/msys64;%USERPROFILE%/Application Data/OpenOffice.org 2/user/wordbook;c:/msys64/mingw64/share/dict/ooo;
AVAILABLE DICTIONARIES (path is not mandatory for -d option):
c:/msys64/mingw64/share/hunspell/en_AG
...
c:/msys64/mingw64/share/hunspell/en_ZW
c:/msys64/mingw64/share/myspell/dicts/en_AG
...
c:/msys64/mingw64/share/myspell/dicts/en_ZW
LOADED DICTIONARY:
c:/msys64/mingw64/share/hunspell/en_US.aff
c:/msys64/mingw64/share/hunspell/en_US.dic
Hunspell 1.6.2
"



Reply | Threaded
Open this post in threaded view
|

bug#34272: 26.1.91 M-x flyspell-mode

Eli Zaretskii
> Date: Sat, 09 Feb 2019 19:39:17 +0900 (JST)
> Cc: [hidden email], [hidden email],
>  [hidden email]
> From: Tak Kunihiro <[hidden email]>
>
> (setq ispell-program-name "c:/msys64/mingw64/bin/hunspell.exe")
>
> (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))                      ; => ""

Does the patch below help?

diff --git a/lisp/textmodes/ispell.el b/lisp/textmodes/ispell.el
index 656c9fa..237997d 100644
--- a/lisp/textmodes/ispell.el
+++ b/lisp/textmodes/ispell.el
@@ -1114,12 +1114,19 @@ ispell-find-hunspell-dictionaries
  null-device
  t
  nil
+                                 "-D"
+                                 ;; Use -a to prevent Hunspell from
+                                 ;; trying to initialize its
+                                 ;; curses/termcap UI, which causes it
+                                 ;; to crash or fail to start in some
+                                 ;; MS-Windows ports.
+                                 "-a"
                                  ;; 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)
+ null-device)
     (buffer-string))
   "[\n\r]+"
   t))



Reply | Threaded
Open this post in threaded view
|

bug#34272: 26.1.91 M-x flyspell-mode

Tak Kunihiro
> Does the patch below help?
>
> diff --git a/lisp/textmodes/ispell.el b/lisp/textmodes/ispell.el
> index 656c9fa..237997d 100644
> --- a/lisp/textmodes/ispell.el
> +++ b/lisp/textmodes/ispell.el
> @@ -1114,12 +1114,19 @@ ispell-find-hunspell-dictionaries
>   null-device
>   t
>   nil
> +                                 "-D"
> +                                 ;; Use -a to prevent Hunspell from
> +                                 ;; trying to initialize its
> +                                 ;; curses/termcap UI, which causes it
> +                                 ;; to crash or fail to start in some
> +                                 ;; MS-Windows ports.
> +                                 "-a"
>                                   ;; 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)
> + null-device)
>      (buffer-string))
>    "[\n\r]+"
>    t))

Yes, the following block works and also `M-x flyspell' works!

(setq ispell-program-name "c:/msys64/mingw64/bin/hunspell.exe")
(with-temp-buffer
  (ispell-call-process ispell-program-name
                       null-device
                       t
                       nil
                       "-D"
                       ;; Use -a to prevent Hunspell from
                       ;; trying to initialize its
                       ;; curses/termcap UI, which causes it
                       ;; to crash or fail to start in some
                       ;; MS-Windows ports.
                       "-a"
                       ;; 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.
                       null-device)
  (buffer-string))                ; => see below

"@(#) International Ispell Version 3.2.06 (but really Hunspell 1.6.2)\n
SEARCH PATH:\n
.;c:/msys64/mingw64/bin/;c:/msys64/mingw64/share/hunspell;c:/msys64/mingw64/share/myspell;c:/msys64/mingw64/share/myspell/dicts;c:/msys64;%USERPROFILE%/Application Data/OpenOffice.org 2/user/wordbook;c:/msys64/mingw64/share/dict/ooo;\n
AVAILABLE DICTIONARIES (path is not mandatory for -d option):\n
c:/msys64/mingw64/share/hunspell/en_AG\n
c:/msys64/mingw64/share/hunspell/en_AU\n
c:/msys64/mingw64/share/hunspell/en_BS\n
c:/msys64/mingw64/share/hunspell/en_BW\n
c:/msys64/mingw64/share/hunspell/en_BZ\n
c:/msys64/mingw64/share/hunspell/en_CA\n
c:/msys64/mingw64/share/hunspell/en_DK\n
c:/msys64/mingw64/share/hunspell/en_GB\n
c:/msys64/mingw64/share/hunspell/en_GH\n
c:/msys64/mingw64/share/hunspell/en_HK\n
c:/msys64/mingw64/share/hunspell/en_IE\n
c:/msys64/mingw64/share/hunspell/en_IN\n
c:/msys64/mingw64/share/hunspell/en_JM\n
c:/msys64/mingw64/share/hunspell/en_NA\n
c:/msys64/mingw64/share/hunspell/en_NG\n
c:/msys64/mingw64/share/hunspell/en_NZ\n
c:/msys64/mingw64/share/hunspell/en_PH\n
c:/msys64/mingw64/share/hunspell/en_SG\n
c:/msys64/mingw64/share/hunspell/en_TT\n
c:/msys64/mingw64/share/hunspell/en_US\n
c:/msys64/mingw64/share/hunspell/en_ZA\n
c:/msys64/mingw64/share/hunspell/en_ZW\n
c:/msys64/mingw64/share/myspell/dicts/en_AG\n
c:/msys64/mingw64/share/myspell/dicts/en_AU\n
c:/msys64/mingw64/share/myspell/dicts/en_BS\n
c:/msys64/mingw64/share/myspell/dicts/en_BW\n
c:/msys64/mingw64/share/myspell/dicts/en_BZ\n
c:/msys64/mingw64/share/myspell/dicts/en_CA\n
c:/msys64/mingw64/share/myspell/dicts/en_DK\n
c:/msys64/mingw64/share/myspell/dicts/en_GB\n
c:/msys64/mingw64/share/myspell/dicts/en_GH\n
c:/msys64/mingw64/share/myspell/dicts/en_HK\n
c:/msys64/mingw64/share/myspell/dicts/en_IE\n
c:/msys64/mingw64/share/myspell/dicts/en_IN\n
c:/msys64/mingw64/share/myspell/dicts/en_JM\n
c:/msys64/mingw64/share/myspell/dicts/en_NA\n
c:/msys64/mingw64/share/myspell/dicts/en_NG\n
c:/msys64/mingw64/share/myspell/dicts/en_NZ\n
c:/msys64/mingw64/share/myspell/dicts/en_PH\n
c:/msys64/mingw64/share/myspell/dicts/en_SG\n
c:/msys64/mingw64/share/myspell/dicts/en_TT\n
c:/msys64/mingw64/share/myspell/dicts/en_US\n
c:/msys64/mingw64/share/myspell/dicts/en_ZA\n
c:/msys64/mingw64/share/myspell/dicts/en_ZW\n
LOADED DICTIONARY:\n
c:/msys64/mingw64/share/hunspell/en_US.aff\n
c:/msys64/mingw64/share/hunspell/en_US.dic\n
"



Reply | Threaded
Open this post in threaded view
|

bug#34272: 26.1.91 M-x flyspell-mode

Eli Zaretskii
> Date: Mon, 11 Feb 2019 09:49:47 +0900 (JST)
> Cc: [hidden email], [hidden email],
>  [hidden email]
> From: Tak Kunihiro <[hidden email]>
>
> > Does the patch below help?
> >
> > diff --git a/lisp/textmodes/ispell.el b/lisp/textmodes/ispell.el
> > index 656c9fa..237997d 100644
> > --- a/lisp/textmodes/ispell.el
> > +++ b/lisp/textmodes/ispell.el
> > @@ -1114,12 +1114,19 @@ ispell-find-hunspell-dictionaries
> >   null-device
> >   t
> >   nil
> > +                                 "-D"
> > +                                 ;; Use -a to prevent Hunspell from
> > +                                 ;; trying to initialize its
> > +                                 ;; curses/termcap UI, which causes it
> > +                                 ;; to crash or fail to start in some
> > +                                 ;; MS-Windows ports.
> > +                                 "-a"
> >                                   ;; 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)
> > + null-device)
> >      (buffer-string))
> >    "[\n\r]+"
> >    t))
>
> Yes, the following block works and also `M-x flyspell' works!

Thanks, I installed this on the emacs-26 branch, and I'm marking this
bug done.