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: Sun, 11 Sep 2022 20:24:33 +0300 Message-ID: <83r10h963y.fsf@gnu.org> References: <874jximkwp.fsf@gmx.de> <87k06dnbrs.fsf@gmx.de> <83fsh1eqlj.fsf@gnu.org> Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="38908"; 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 Sun Sep 11 19:37:02 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 1oXQtB-0009wa-VC for geb-bug-gnu-emacs@m.gmane-mx.org; Sun, 11 Sep 2022 19:37:02 +0200 Original-Received: from localhost ([::1]:37428 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1oXQtB-0001CR-1p for geb-bug-gnu-emacs@m.gmane-mx.org; Sun, 11 Sep 2022 13:37:01 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:53890) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1oXQha-0008GF-Ku for bug-gnu-emacs@gnu.org; Sun, 11 Sep 2022 13:25:02 -0400 Original-Received: from debbugs.gnu.org ([209.51.188.43]:54613) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1oXQha-0003VR-BH for bug-gnu-emacs@gnu.org; Sun, 11 Sep 2022 13:25:02 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1oXQhZ-0006T2-UA for bug-gnu-emacs@gnu.org; Sun, 11 Sep 2022 13:25: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: Sun, 11 Sep 2022 17:25: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.166291709724846 (code B ref 57649); Sun, 11 Sep 2022 17:25:01 +0000 Original-Received: (at 57649) by debbugs.gnu.org; 11 Sep 2022 17:24:57 +0000 Original-Received: from localhost ([127.0.0.1]:43312 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1oXQhV-0006Sg-Am for submit@debbugs.gnu.org; Sun, 11 Sep 2022 13:24:57 -0400 Original-Received: from eggs.gnu.org ([209.51.188.92]:55814) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1oXQhT-0006SU-Cf for 57649@debbugs.gnu.org; Sun, 11 Sep 2022 13:24:55 -0400 Original-Received: from fencepost.gnu.org ([2001:470:142:3::e]:59192) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1oXQhO-0003UU-09; Sun, 11 Sep 2022 13:24:50 -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=pUW2acFPVq4YD8dupEwH5yv/xyeJnuTvWbdyjyKRWdw=; b=HhsYSdxpGK9K ij9qJBjawuJ1AcBb5+G9I7Qaca7bKKP3K5cWmM6ciNuVgMSFOMjcWGk/NL3pYFuDkUYN6PPfdJ/XZ DdbV2nbK3xzN+QEuyUNOj4rWQz//kDmC66Th/yf+KIi67sXPW/suwUVjtrspZ/crZ+7aeLNO6fMKP PCsbyz4MKQM1Pq3J7WXdQl+zMCsRlZ2TkIqbVPjxG89RNUfFWgRZ3qT0czONwKCrOG7ng3q5dqeER pe/d6qb5ZMZZG3uVkH6qpaLG3vYNoJ0ViHD8J6cYh+5LSd1kZsxn9Erq/lPJxVXfdxxfH8FUaIMi3 eJ2U/he/ZJ02TQPhwoSCdg==; Original-Received: from [87.69.77.57] (port=4912 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 1oXQhN-0003Zb-GS; Sun, 11 Sep 2022 13:24:49 -0400 In-Reply-To: <83fsh1eqlj.fsf@gnu.org> (message from Eli Zaretskii on Thu, 08 Sep 2022 20:14:00 +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:242190 Archived-At: 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)) > > > >