emacs-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Starting ispell in some fixed directory


From: Slawomir Nowaczyk
Subject: Re: Starting ispell in some fixed directory
Date: Sun, 24 Sep 2006 19:37:04 +0200

On Mon, 18 Sep 2006 22:10:16 +0300
Eli Zaretskii <address@hidden> wrote:

#> > Date: Mon, 18 Sep 2006 16:32:57 +0200
#> > From: Slawomir Nowaczyk <address@hidden>
#> > 
#> > A simple fix would be to run ispell in some predefined directory, at
#> > least on Windows -- c:/ for example. I do not think the location matters
#> > for ispell.
#> 
#> Patches are welcome, but I doubt that it's so easy to find a robust
#> directory to run ispell, what with machines that lack a C: drive.

Possibly... Are there M$ Windows installations without C: drive?

Anyway, the following patch seems to work on my machines:

**********************************************************************

M:\__\_installing_Emacs_CVS\my_code>diff -u 
m:/EmacsCVS/EmacsCVS/lisp/textmodes/ispell.el c:/Emacs/lisp/textmodes/ispell.el
--- m:/EmacsCVS/EmacsCVS/lisp/textmodes/ispell.el       2006-08-11 
12:45:48.025268800 +0200
+++ c:/Emacs/lisp/textmodes/ispell.el   2006-09-24 19:11:05.962598400 +0200
@@ -2492,7 +2492,8 @@
     (setq ispell-buffer-local-name nil)

     (if ispell-async-processp
-       (let ((process-connection-type ispell-use-ptys-p))
+       (let ((process-connection-type ispell-use-ptys-p)
+              (default-directory (if (member system-type '(cygwin windows-nt)) 
temporary-file-directory default-directory)))
          (apply 'start-process
                 "ispell" nil ispell-program-name
                 "-a"                   ; accept single input lines

**********************************************************************

but I am not 100% sure if temporary-file-directory *always* points to an
existing directory... I believe it should, though.

I was also thinking about using (substitute-in-file-name "$WINDIR")
instead... Wikipedia claims $WINDIR should be available on all versions
of M$ Windows, but I do not have access to any 95 nor 98 machines to
test this claim.

I think the change applies to windows-nt and cygwin environments only, I
doubt any other system is similarly broken (except, maybe, MS-DOS?).

#> The user's home directory might be a better idea, but even that is
#> not fool-proof.
#> 
#> So I think perhaps the code should try c:/ or ~, and if that fails,
#> fall back on the current behavior.

Well, if we are really paranoid, the test could be expanded into
(and (member system-type '(cygwin windows-nt)) (file-exists-p 
temporary-file-directory))
but I do not think it is necessary.

We could, alternatively, use the directory from which emacs.exe is
running, but I do not know how to get it.
(with-current-buffer "*scratch*" default-directory) would be good enough
for me, but I believe it is even less likely to work reliably.

-- 
 Best wishes,
   Slawomir Nowaczyk
     ( address@hidden )

God is real, unless declared integer.





reply via email to

[Prev in Thread] Current Thread [Next in Thread]