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: Thu, 08 Sep 2022 20:14:00 +0300 Message-ID: <83fsh1eqlj.fsf@gnu.org> References: <874jximkwp.fsf@gmx.de> <87k06dnbrs.fsf@gmx.de> Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="24983"; mail-complaints-to="usenet@ciao.gmane.io" Cc: 57649@debbugs.gnu.org, nlongo@mathworks.com To: Michael Albinus Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Thu Sep 08 19:15:26 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 1oWL7d-0006ME-3I for geb-bug-gnu-emacs@m.gmane-mx.org; Thu, 08 Sep 2022 19:15:25 +0200 Original-Received: from localhost ([::1]:58690 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1oWL7c-0001eX-55 for geb-bug-gnu-emacs@m.gmane-mx.org; Thu, 08 Sep 2022 13:15:24 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:53056) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1oWL7G-0001cU-Au for bug-gnu-emacs@gnu.org; Thu, 08 Sep 2022 13:15:04 -0400 Original-Received: from debbugs.gnu.org ([209.51.188.43]:43084) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1oWL7G-0007zW-1B for bug-gnu-emacs@gnu.org; Thu, 08 Sep 2022 13:15:02 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1oWL7F-0000fU-TG for bug-gnu-emacs@gnu.org; Thu, 08 Sep 2022 13:15:01 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Eli Zaretskii Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Thu, 08 Sep 2022 17:15:01 +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.16626572612508 (code B ref 57649); Thu, 08 Sep 2022 17:15:01 +0000 Original-Received: (at 57649) by debbugs.gnu.org; 8 Sep 2022 17:14:21 +0000 Original-Received: from localhost ([127.0.0.1]:60016 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1oWL6b-0000eN-7l for submit@debbugs.gnu.org; Thu, 08 Sep 2022 13:14:21 -0400 Original-Received: from eggs.gnu.org ([209.51.188.92]:57424) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1oWL6Z-0000e9-Pm for 57649@debbugs.gnu.org; Thu, 08 Sep 2022 13:14:20 -0400 Original-Received: from fencepost.gnu.org ([2001:470:142:3::e]:50928) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1oWL6U-0007ut-Gn; Thu, 08 Sep 2022 13:14:14 -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=fC/TyJh/SdduKUvd2ZTariWhF1YT2cllaB4yEG6Gj5g=; b=AVpmYRik14I1 g4M0g1sIi91EfZ4CMJU5LdU5C4ZsfAMaby8nI29EvsYOeWEYmG3IH6/KyK+VX5Lsz6Ltw21Gny7Et QYmQLqx+SbE1aZLlUeNB9tYzO4WXNtuVBWgBbudoANDeSKqflqK15ugdS9yj486m7LSvgO64wlAcB A4D18rWeA5YxOQbLFGTYmkPG9iG7MzSbgIKtqCiuWt83WaRCo0RrHGZfMgKqVAfX6IVuBqy4Mw24+ ISADhnWt/j7hcoXV29+1Qil3DedVolDGTgyg64X2ybiz7HDsP6mMOSi8ScR/wQbi3DNwhgZxcc/tP Gon7QXWZQtkGK+P9PpSHWg==; Original-Received: from [87.69.77.57] (port=1539 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 1oWL6T-0004vg-Io; Thu, 08 Sep 2022 13:14:13 -0400 In-Reply-To: <87k06dnbrs.fsf@gmx.de> (message from Michael Albinus on Thu, 08 Sep 2022 17:09:27 +0200) 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:241929 Archived-At: > 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))