GNU bug report logs -
#57649
27.1; Spell check on remote file fails on windows.
Previous Next
Reported by: Nick Longo <nlongo <at> mathworks.com>
Date: Wed, 7 Sep 2022 16:08:03 UTC
Severity: normal
Found in version 27.1
Done: Eli Zaretskii <eliz <at> gnu.org>
Bug is archived. No further changes may be made.
Full log
View this message in rfc822 format
Ping!
> Cc: 57649 <at> debbugs.gnu.org, nlongo <at> mathworks.com
> Date: Thu, 08 Sep 2022 20:14:00 +0300
> From: Eli Zaretskii <eliz <at> gnu.org>
>
> > Cc: "57649 <at> debbugs.gnu.org" <57649 <at> debbugs.gnu.org>
> > From: Michael Albinus <michael.albinus <at> 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))
>
>
>
>
This bug report was last modified 2 years and 227 days ago.
Previous Next
GNU bug tracking system
Copyright (C) 1999 Darren O. Benham,
1997,2003 nCipher Corporation Ltd,
1994-97 Ian Jackson.