From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Eli Zaretskii Newsgroups: gmane.emacs.bugs Subject: bug#57649: 27.1; Spell check on remote file fails on windows. Date: Fri, 16 Sep 2022 20:31:53 +0300 Message-ID: <83leqj2pkm.fsf@gnu.org> References: <874jximkwp.fsf@gmx.de> <87k06dnbrs.fsf@gmx.de> <83fsh1eqlj.fsf@gnu.org> <83r10h963y.fsf@gnu.org> Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="7261"; mail-complaints-to="usenet@ciao.gmane.io" Cc: 57649@debbugs.gnu.org, nlongo@mathworks.com To: michael.albinus@gmx.de Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Fri Sep 16 19:34:35 2022 Return-path: Envelope-to: geb-bug-gnu-emacs@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 1oZFEZ-0001bI-4l for geb-bug-gnu-emacs@m.gmane-mx.org; Fri, 16 Sep 2022 19:34:35 +0200 Original-Received: from localhost ([::1]:52226 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1oZFEY-0007lT-3f for geb-bug-gnu-emacs@m.gmane-mx.org; Fri, 16 Sep 2022 13:34:34 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:55434) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1oZFD6-0006HZ-SX for bug-gnu-emacs@gnu.org; Fri, 16 Sep 2022 13:33:04 -0400 Original-Received: from debbugs.gnu.org ([209.51.188.43]:45143) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1oZFD4-0002ru-Ag for bug-gnu-emacs@gnu.org; Fri, 16 Sep 2022 13:33:04 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1oZFD4-0005hg-2S for bug-gnu-emacs@gnu.org; Fri, 16 Sep 2022 13:33:02 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Eli Zaretskii Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Fri, 16 Sep 2022 17:33:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 57649 X-GNU-PR-Package: emacs Original-Received: via spool by 57649-submit@debbugs.gnu.org id=B57649.166334952321855 (code B ref 57649); Fri, 16 Sep 2022 17:33:02 +0000 Original-Received: (at 57649) by debbugs.gnu.org; 16 Sep 2022 17:32:03 +0000 Original-Received: from localhost ([127.0.0.1]:44221 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1oZFC7-0005gQ-Ff for submit@debbugs.gnu.org; Fri, 16 Sep 2022 13:32:03 -0400 Original-Received: from eggs.gnu.org ([209.51.188.92]:53578) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1oZFC5-0005fw-Nb for 57649@debbugs.gnu.org; Fri, 16 Sep 2022 13:32:02 -0400 Original-Received: from fencepost.gnu.org ([2001:470:142:3::e]:40962) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1oZFC0-0002e3-Af; Fri, 16 Sep 2022 13:31:56 -0400 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=gnu.org; s=fencepost-gnu-org; h=References:Subject:In-Reply-To:To:From:Date: mime-version; bh=uoiDNWgvBZZEz+autaIhTm+1CXV18xI9AVITVMBSp9Q=; b=nh6f5Avj3/MN fQIDUJyALMhkUFltK0TFwhZNwKIQn1ml54jyL78auKXaQAhulEz2sEr+zTZFh/iC1VYYjmmfCrtnF u8i4gpSv5s6dTSfLr7dRe7eQHoiL5stFH4rUb5ACMQz4CbiA9M7EADiNyBabiq8BI8WzMBL0KMsVS J5Wa2GoO7cf4p3rqrdKz6p5bm67+lab1fSoguAmDFrZUlTeWo+TAZhLE5QgBwv6QE99dnRsgb8WRo kKXHarde9kC1Vlmibm7noNXAxc+l8MGv/wlN0KS9COzk+pr3wWyrCPg5GitKuTNQofi+qMCjHUXco xV5O6UIBsrEcP7RIgnPwKQ==; Original-Received: from [87.69.77.57] (port=1460 helo=home-c4e4a596f7) by fencepost.gnu.org with esmtpsa (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1oZFBz-0001q3-Oo; Fri, 16 Sep 2022 13:31:56 -0400 In-Reply-To: <83r10h963y.fsf@gnu.org> (message from Eli Zaretskii on Sun, 11 Sep 2022 20:24:33 +0300) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-BeenThere: bug-gnu-emacs@gnu.org List-Id: "Bug reports for GNU Emacs, the Swiss army knife of text editors" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Original-Sender: "bug-gnu-emacs" Xref: news.gmane.io gmane.emacs.bugs:242794 Archived-At: Ping! Ping! Michael, could you please respond? > Cc: 57649@debbugs.gnu.org, nlongo@mathworks.com > Date: Sun, 11 Sep 2022 20:24:33 +0300 > From: Eli Zaretskii > > Ping! > > > Cc: 57649@debbugs.gnu.org, nlongo@mathworks.com > > Date: Thu, 08 Sep 2022 20:14:00 +0300 > > From: Eli Zaretskii > > > > > Cc: "57649@debbugs.gnu.org" <57649@debbugs.gnu.org> > > > From: Michael Albinus > > > Date: Thu, 08 Sep 2022 17:09:27 +0200 > > > > > > > The emacs debugger gives: > > > > Debugger entered--Lisp error: (file-missing "Opening process input file" "No such file or directory" "/plinkx:homeoffice:/home/nmichalo/NUL") > > > > call-process("c:/NProgramFiles/bin/hunspell.exe" "NUL" t nil "-D" "-a" "NUL") > > > > apply(call-process ("c:/NProgramFiles/bin/hunspell.exe" "NUL" t nil "-D" "-a" "NUL")) > > > > ispell-call-process("c:/NProgramFiles/bin/hunspell.exe" "NUL" t nil "-D" "-a" "NUL") > > > > ispell-find-hunspell-dictionaries() > > > > > > That's it. `call-process' does not support remote files. > > > > > > I've just checked in Emacs 29, ispell.el is still using > > > `call-process'. Somebody who knows this package shall adapt, using > > > either `process-file', or working on a temporary local copy of the file > > > to be spelled. > > > > In this case the problem is not with the file being spell-checked, > > it's with default-directory. > > > > The file should not be an issue, since Emacs spell-checking works by > > sending buffer text to the local spell-checking process. It should > > not matter where the buffer text came from. > > > > So, going back to the default-directory problem, we have this: > > > > (defmacro ispell-with-safe-default-directory (&rest body) > > "Execute the forms in BODY with a reasonable `default-directory'." > > (declare (indent 0) (debug t)) > > `(let ((default-directory default-directory)) > > (unless (file-accessible-directory-p default-directory) > > (setq default-directory (expand-file-name "~/"))) > > ,@body)) > > > > And I guess the problem is with file-accessible-directory-p, which in > > this case returns non-nil, because it probes the accessibility of the > > remote directory? So something like the below should fix the problem? > > > > (defmacro ispell-with-safe-default-directory (&rest body) > > "Execute the forms in BODY with a reasonable `default-directory'." > > (declare (indent 0) (debug t)) > > `(let ((default-directory default-directory)) > > (unless (and (not (file-remote-p default-directory)) > > (file-accessible-directory-p default-directory)) > > (setq default-directory (expand-file-name "~/"))) > > ,@body)) > > > > > > > > > > > >