From: Eli Zaretskii <eliz@gnu.org>
To: Michael Albinus <michael.albinus@gmx.de>
Cc: 57649@debbugs.gnu.org, nlongo@mathworks.com
Subject: bug#57649: 27.1; Spell check on remote file fails on windows.
Date: Thu, 08 Sep 2022 20:14:00 +0300 [thread overview]
Message-ID: <83fsh1eqlj.fsf@gnu.org> (raw)
In-Reply-To: <87k06dnbrs.fsf@gmx.de> (message from Michael Albinus on Thu, 08 Sep 2022 17:09:27 +0200)
> Cc: "57649@debbugs.gnu.org" <57649@debbugs.gnu.org>
> From: Michael Albinus <michael.albinus@gmx.de>
> 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))
next prev parent reply other threads:[~2022-09-08 17:14 UTC|newest]
Thread overview: 12+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-09-07 14:32 bug#57649: 27.1; Spell check on remote file fails on windows Nick Longo
2022-09-08 6:37 ` Michael Albinus
2022-09-08 14:49 ` Nick Longo
2022-09-08 15:09 ` Michael Albinus
2022-09-08 17:14 ` Eli Zaretskii [this message]
2022-09-11 17:24 ` Eli Zaretskii
2022-09-16 17:31 ` Eli Zaretskii
2022-09-17 6:39 ` Michael Albinus
2022-09-17 7:12 ` Eli Zaretskii
2022-09-22 21:00 ` Nick Longo
2022-10-03 13:25 ` Nick Longo
2022-10-03 17:13 ` Eli Zaretskii
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
List information: https://www.gnu.org/software/emacs/
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=83fsh1eqlj.fsf@gnu.org \
--to=eliz@gnu.org \
--cc=57649@debbugs.gnu.org \
--cc=michael.albinus@gmx.de \
--cc=nlongo@mathworks.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
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).