From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Juan =?utf-8?Q?Jos=C3=A9_Garc=C3=ADa-Ripoll?= Newsgroups: gmane.emacs.devel Subject: Re: Debugging aspell problems Date: Wed, 05 Aug 2020 21:32:48 +0200 Message-ID: <868sesga73.fsf@csic.es> References: <86tuxhfj5l.fsf@csic.es> <838set9nj0.fsf@gnu.org> Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="28246"; mail-complaints-to="usenet@ciao.gmane.io" User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/26.3 (windows-nt) To: emacs-devel@gnu.org Cancel-Lock: sha1:4Uz1fuCF2ltIzfUyTBs0AIa9PGI= Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Wed Aug 05 21:33:35 2020 Return-path: Envelope-to: ged-emacs-devel@m.gmane-mx.org Original-Received: from lists.gnu.org ([209.51.188.17]) by ciao.gmane.io with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1k3PAM-0007Dw-3u for ged-emacs-devel@m.gmane-mx.org; Wed, 05 Aug 2020 21:33:34 +0200 Original-Received: from localhost ([::1]:37774 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1k3PAL-0000i2-6E for ged-emacs-devel@m.gmane-mx.org; Wed, 05 Aug 2020 15:33:33 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:36902) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1k3P9p-0000Gr-6U for emacs-devel@gnu.org; Wed, 05 Aug 2020 15:33:01 -0400 Original-Received: from static.214.254.202.116.clients.your-server.de ([116.202.254.214]:58576 helo=ciao.gmane.io) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1k3P9n-0006kK-Eu for emacs-devel@gnu.org; Wed, 05 Aug 2020 15:33:00 -0400 Original-Received: from list by ciao.gmane.io with local (Exim 4.92) (envelope-from ) id 1k3P9i-0006Xo-CT for emacs-devel@gnu.org; Wed, 05 Aug 2020 21:32:54 +0200 X-Injected-Via-Gmane: http://gmane.org/ Received-SPF: pass client-ip=116.202.254.214; envelope-from=ged-emacs-devel@m.gmane-mx.org; helo=ciao.gmane.io X-detected-operating-system: by eggs.gnu.org: First seen = 2020/08/05 15:21:54 X-ACL-Warn: Detected OS = Linux 2.2.x-3.x [generic] [fuzzy] X-Spam_score_int: 20 X-Spam_score: 2.0 X-Spam_bar: ++ X-Spam_report: (2.0 / 5.0 requ) BAYES_00=-1.9, DKIM_ADSP_CUSTOM_MED=0.001, FORGED_GMAIL_RCVD=1, FREEMAIL_FORGED_FROMDOMAIN=1, FREEMAIL_FROM=0.001, HEADER_FROM_DIFFERENT_DOMAINS=1, NML_ADSP_CUSTOM_MED=0.9, SPF_HELO_NONE=0.001, SPF_PASS=-0.001, URIBL_BLOCKED=0.001 autolearn=no autolearn_force=no X-Spam_action: no action X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "Emacs development discussions." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Original-Sender: "Emacs-devel" Xref: news.gmane.io gmane.emacs.devel:253461 Archived-At: I agree that it may be a problem with the program itself, but it comes from mingw, not from msys, and I am running emacs.exe -Q and I am seeing buffering problems also with standard scripts from Windows. I have created two Windows scripts to make it more reproducible. One is called chain.cmd and the other one is myaspell.cmd. The first one simply pulls lines of text and copies them to a file @echo off rem chain.cmd :begin set /p line= || goto :end echo %line% >> %1 echo %line% goto :begin :end echo EOF >> %1 The second one calls aspell.exe, using this tool to save the input (inlog) and the output (outlog) @echo off rem myaspell.cmd set program=c:\msys64\mingw64\bin\aspell.exe set log=c:\Users\juanj\tmp\inlog echo %program% %1 %2 %3 %4 %5 %6 >> %log% echo Emacs input >> %log% c:\Users\juanj\tmp\chain.cmd %log% | %program% %1 %2 %3 %4 %5 %6 | c:\Users\juanj\tmp\chain.cmd c:\Users\juanj\tmp\outlog Now I use the Lisp file below to run the spell checker on a fresh copy of Emacs, as in runemacs -Q --load test.el The output in alllog is this: c:\Users\juanj\tmp>type inlog type inlog c:\msys64\mingw64\bin\aspell.exe -vv Emacs input EOF c:\msys64\mingw64\bin\aspell.exe dicts Emacs input EOF c:\msys64\mingw64\bin\aspell.exe config dict-dir Emacs input EOF c:\msys64\mingw64\bin\aspell.exe config data-dir Emacs input EOF c:\msys64\mingw64\bin\aspell.exe -vv Emacs input EOF c:\msys64\mingw64\bin\aspell.exe -a -m -B --encoding utf-8 Emacs input ! + The Emacs copy is wating for output but has not flushed out the line buffer that contains the word. Note that here the script that is waiting for input is chain.cmd, not aspell. Hence, one cannot really claim that the problem is msys. --- (require 'ispell) ;;(setq ispell-program-name (expand-file-name "~/scoop/apps/hunspell/bin/hunspell.exe")) ;;(setq ispell-program-name (expand-file-name "c:/msys64/mingw64/bin/aspell.exe")) (setq ispell-program-name (expand-file-name "myaspell.cmd")) (setq ispell-async-processp t) (defun mydebug (&rest args) (apply 'print args)) (defadvice ispell-filter (before show first (_process output) activate) (mydebug (format "Receiving: %s" output))) (defadvice ispell-call-process-region (before show first (start end &rest args) activate) (mydebug (format "Sending: %s" (buffer-substring start end)))) (trace-function 'mydebug) (trace-function 'start-process) (trace-function 'process-send-string) (trace-function 'ispell-filter) (trace-function 'ispell--run-on-word) (trace-function 'ispell-call-process-region) (trace-function 'call-process) (trace-function 'call-process-region) (find-file "foo.tex") (switch-to-buffer "foo.tex") (goto-char 1) (insert "hello ") (goto-char 1) (ispell-word) (kill-buffer "foo.tex") -- Juan José García Ripoll http://juanjose.garciaripoll.com http://quinfog.hbar.es