From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Slawomir Nowaczyk Newsgroups: gmane.emacs.devel Subject: Re: Starting ispell in some fixed directory Date: Sun, 24 Sep 2006 19:37:04 +0200 Message-ID: <20060924191215.4CE2.SLAWOMIR.NOWACZYK.847@student.lu.se> References: <20060918161018.705C.SLAWOMIR.NOWACZYK.847@student.lu.se> NNTP-Posting-Host: main.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: 8bit X-Trace: sea.gmane.org 1159119456 28155 80.91.229.2 (24 Sep 2006 17:37:36 GMT) X-Complaints-To: usenet@sea.gmane.org NNTP-Posting-Date: Sun, 24 Sep 2006 17:37:36 +0000 (UTC) Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Sun Sep 24 19:37:33 2006 Return-path: Envelope-to: ged-emacs-devel@m.gmane.org Original-Received: from lists.gnu.org ([199.232.76.165]) by ciao.gmane.org with esmtp (Exim 4.43) id 1GRXv3-0007nb-BD for ged-emacs-devel@m.gmane.org; Sun, 24 Sep 2006 19:37:33 +0200 Original-Received: from localhost ([127.0.0.1] helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1GRXv2-0006Rg-JH for ged-emacs-devel@m.gmane.org; Sun, 24 Sep 2006 13:37:32 -0400 Original-Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1GRXuq-0006RH-Jo for emacs-devel@gnu.org; Sun, 24 Sep 2006 13:37:20 -0400 Original-Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1GRXup-0006Pp-9O for emacs-devel@gnu.org; Sun, 24 Sep 2006 13:37:20 -0400 Original-Received: from [199.232.76.173] (helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1GRXup-0006Pk-66 for emacs-devel@gnu.org; Sun, 24 Sep 2006 13:37:19 -0400 Original-Received: from [130.235.16.11] (helo=himmelsborg.cs.lth.se) by monty-python.gnu.org with esmtp (Exim 4.52) id 1GRXz3-0003vc-99 for emacs-devel@gnu.org; Sun, 24 Sep 2006 13:41:41 -0400 Original-Received: from [127.0.0.1] (slawek@dain [130.235.16.76]) by himmelsborg.cs.lth.se (8.13.6/8.13.6/perf-jw-tr) with ESMTP id k8OHbGvS009468 for ; Sun, 24 Sep 2006 19:37:16 +0200 (CEST) Original-To: emacs-devel@gnu.org In-Reply-To: X-Esmandil_Citation: done X-Mailer-Plugin: Popup Memopad for Becky!2 Ver.0.02 Rev.2 X-Mailer: Becky! ver. 2.25.02 [en] X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "Emacs development discussions." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Original-Sender: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Errors-To: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.devel:60170 Archived-At: On Mon, 18 Sep 2006 22:10:16 +0300 Eli Zaretskii wrote: #> > Date: Mon, 18 Sep 2006 16:32:57 +0200 #> > From: Slawomir Nowaczyk #> > #> > 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 ( slawomir.nowaczyk.847@student.lu.se ) God is real, unless declared integer.