unofficial mirror of bug-gnu-emacs@gnu.org 
 help / color / mirror / code / Atom feed
* bug#34272: 26.1.91 M-x flyspell-mode
@ 2019-02-01 13:54 Tak Kunihiro
  2019-02-01 15:04 ` Eli Zaretskii
  2019-02-08  7:27 ` Eli Zaretskii
  0 siblings, 2 replies; 13+ messages in thread
From: Tak Kunihiro @ 2019-02-01 13:54 UTC (permalink / raw)
  To: 34272; +Cc: tkk

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)





^ permalink raw reply	[flat|nested] 13+ messages in thread

* bug#34272: 26.1.91 M-x flyspell-mode
  2019-02-01 13:54 bug#34272: 26.1.91 M-x flyspell-mode Tak Kunihiro
@ 2019-02-01 15:04 ` Eli Zaretskii
  2019-02-01 23:03   ` Tak Kunihiro
  2019-02-08  7:27 ` Eli Zaretskii
  1 sibling, 1 reply; 13+ messages in thread
From: Eli Zaretskii @ 2019-02-01 15:04 UTC (permalink / raw)
  To: Tak Kunihiro; +Cc: tkk, 34272

> From: Tak Kunihiro <homeros.misasa@gmail.com>
> Date: Fri, 01 Feb 2019 22:54:05 +0900
> Cc: tkk@misasa.okayama-u.ac.jp
> 
> 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.





^ permalink raw reply	[flat|nested] 13+ messages in thread

* bug#34272: 26.1.91 M-x flyspell-mode
  2019-02-01 15:04 ` Eli Zaretskii
@ 2019-02-01 23:03   ` Tak Kunihiro
  2019-02-02  7:07     ` Eli Zaretskii
  0 siblings, 1 reply; 13+ messages in thread
From: Tak Kunihiro @ 2019-02-01 23:03 UTC (permalink / raw)
  To: eliz; +Cc: homeros.misasa, tkk, 34272

>> From: Tak Kunihiro <homeros.misasa@gmail.com>
>> Date: Fri, 01 Feb 2019 22:54:05 +0900
>> Cc: tkk@misasa.okayama-u.ac.jp
>> 
>> 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>





^ permalink raw reply	[flat|nested] 13+ messages in thread

* bug#34272: 26.1.91 M-x flyspell-mode
  2019-02-01 23:03   ` Tak Kunihiro
@ 2019-02-02  7:07     ` Eli Zaretskii
  0 siblings, 0 replies; 13+ messages in thread
From: Eli Zaretskii @ 2019-02-02  7:07 UTC (permalink / raw)
  To: Tak Kunihiro; +Cc: homeros.misasa, 34272

> Date: Sat, 02 Feb 2019 08:03:32 +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>
> 
> >> 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.





^ permalink raw reply	[flat|nested] 13+ messages in thread

* bug#34272: 26.1.91 M-x flyspell-mode
  2019-02-01 13:54 bug#34272: 26.1.91 M-x flyspell-mode Tak Kunihiro
  2019-02-01 15:04 ` Eli Zaretskii
@ 2019-02-08  7:27 ` Eli Zaretskii
  2019-02-08 11:30   ` Tak Kunihiro
  1 sibling, 1 reply; 13+ messages in thread
From: Eli Zaretskii @ 2019-02-08  7:27 UTC (permalink / raw)
  To: Tak Kunihiro; +Cc: tkk, 34272

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.





^ permalink raw reply	[flat|nested] 13+ messages in thread

* bug#34272: 26.1.91 M-x flyspell-mode
  2019-02-08  7:27 ` Eli Zaretskii
@ 2019-02-08 11:30   ` Tak Kunihiro
  2019-02-09  9:18     ` Eli Zaretskii
  0 siblings, 1 reply; 13+ messages in thread
From: Tak Kunihiro @ 2019-02-08 11:30 UTC (permalink / raw)
  To: eliz; +Cc: homeros.misasa, tkk, 34272

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





^ permalink raw reply	[flat|nested] 13+ messages in thread

* bug#34272: 26.1.91 M-x flyspell-mode
  2019-02-08 11:30   ` Tak Kunihiro
@ 2019-02-09  9:18     ` Eli Zaretskii
  2019-02-09  9:48       ` Tak Kunihiro
  0 siblings, 1 reply; 13+ messages in thread
From: Eli Zaretskii @ 2019-02-09  9:18 UTC (permalink / raw)
  To: Tak Kunihiro; +Cc: homeros.misasa, 34272

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





^ permalink raw reply	[flat|nested] 13+ messages in thread

* bug#34272: 26.1.91 M-x flyspell-mode
  2019-02-09  9:18     ` Eli Zaretskii
@ 2019-02-09  9:48       ` Tak Kunihiro
  2019-02-09 10:24         ` Eli Zaretskii
  0 siblings, 1 reply; 13+ messages in thread
From: Tak Kunihiro @ 2019-02-09  9:48 UTC (permalink / raw)
  To: eliz; +Cc: homeros.misasa, tkk, 34272

>> 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
"






^ permalink raw reply	[flat|nested] 13+ messages in thread

* bug#34272: 26.1.91 M-x flyspell-mode
  2019-02-09  9:48       ` Tak Kunihiro
@ 2019-02-09 10:24         ` Eli Zaretskii
  2019-02-09 10:39           ` Tak Kunihiro
  0 siblings, 1 reply; 13+ messages in thread
From: Eli Zaretskii @ 2019-02-09 10:24 UTC (permalink / raw)
  To: Tak Kunihiro; +Cc: homeros.misasa, 34272

> Date: Sat, 09 Feb 2019 18:48:31 +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 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.





^ permalink raw reply	[flat|nested] 13+ messages in thread

* bug#34272: 26.1.91 M-x flyspell-mode
  2019-02-09 10:24         ` Eli Zaretskii
@ 2019-02-09 10:39           ` Tak Kunihiro
  2019-02-10 15:35             ` Eli Zaretskii
  0 siblings, 1 reply; 13+ messages in thread
From: Tak Kunihiro @ 2019-02-09 10:39 UTC (permalink / raw)
  To: eliz; +Cc: homeros.misasa, tkk, 34272

>> 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
"





^ permalink raw reply	[flat|nested] 13+ messages in thread

* bug#34272: 26.1.91 M-x flyspell-mode
  2019-02-09 10:39           ` Tak Kunihiro
@ 2019-02-10 15:35             ` Eli Zaretskii
  2019-02-11  0:49               ` Tak Kunihiro
  0 siblings, 1 reply; 13+ messages in thread
From: Eli Zaretskii @ 2019-02-10 15:35 UTC (permalink / raw)
  To: Tak Kunihiro; +Cc: homeros.misasa, 34272

> Date: Sat, 09 Feb 2019 19:39:17 +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>
> 
> (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))





^ permalink raw reply related	[flat|nested] 13+ messages in thread

* bug#34272: 26.1.91 M-x flyspell-mode
  2019-02-10 15:35             ` Eli Zaretskii
@ 2019-02-11  0:49               ` Tak Kunihiro
  2019-02-11 16:29                 ` Eli Zaretskii
  0 siblings, 1 reply; 13+ messages in thread
From: Tak Kunihiro @ 2019-02-11  0:49 UTC (permalink / raw)
  To: eliz; +Cc: homeros.misasa, tkk, 34272

> 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
"





^ permalink raw reply	[flat|nested] 13+ messages in thread

* bug#34272: 26.1.91 M-x flyspell-mode
  2019-02-11  0:49               ` Tak Kunihiro
@ 2019-02-11 16:29                 ` Eli Zaretskii
  0 siblings, 0 replies; 13+ messages in thread
From: Eli Zaretskii @ 2019-02-11 16:29 UTC (permalink / raw)
  To: Tak Kunihiro; +Cc: homeros.misasa, 34272-done

> Date: Mon, 11 Feb 2019 09:49:47 +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>
> 
> > 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.





^ permalink raw reply	[flat|nested] 13+ messages in thread

end of thread, other threads:[~2019-02-11 16:29 UTC | newest]

Thread overview: 13+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2019-02-01 13:54 bug#34272: 26.1.91 M-x flyspell-mode Tak Kunihiro
2019-02-01 15:04 ` Eli Zaretskii
2019-02-01 23:03   ` Tak Kunihiro
2019-02-02  7:07     ` Eli Zaretskii
2019-02-08  7:27 ` Eli Zaretskii
2019-02-08 11:30   ` Tak Kunihiro
2019-02-09  9:18     ` Eli Zaretskii
2019-02-09  9:48       ` Tak Kunihiro
2019-02-09 10:24         ` Eli Zaretskii
2019-02-09 10:39           ` Tak Kunihiro
2019-02-10 15:35             ` Eli Zaretskii
2019-02-11  0:49               ` Tak Kunihiro
2019-02-11 16:29                 ` Eli Zaretskii

Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).