From: Slawomir Nowaczyk <slawomir.nowaczyk.847@student.lu.se>
Subject: Re: Starting ispell in some fixed directory
Date: Fri, 06 Oct 2006 00:33:35 +0200 [thread overview]
Message-ID: <20061006000443.A584.SLAWOMIR.NOWACZYK.847@student.lu.se> (raw)
In-Reply-To: <33838.128.165.123.18.1160085647.squirrel@webmail.lanl.gov>
On Thu, 05 Oct 2006 15:00:47 -0700 (PDT)
"Stuart D. Herring" <herring@lanl.gov> wrote:
#> > #> 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.
#>
#> You can use the variable `invocation-directory'
That's nice :) Seems to be better than temporary-file-directory. Just in
case, I have included an updated patch at the end of this email.
#> but I suppose it's possible for that not to be known in some cases.
Any idea when could it happen? The doc says "[...]The value is nil if
that directory's name is not known.", so I suppose it *is* possible, but
it might be interesting to know when? If I read the code correctly, it
gets its value from argv[0], so it should always be set on w32. Right?
#> Why not just use "/" if it exists, or else continue to call
#> `directory-file-name' and `file-name-directory' repeatedly until the
#> result doesn't change? Namely,
#>
#> (let ((default-directory default-directory))
#> (while (not (equal default-directory
#> (setq default-directory
#> (file-name-directory
#> (directory-file-name default-directory)))))
#> ...)
Well, I suppose that would work in all practical cases, but I think it's
too complex for the problem at hand... Besides, at least in principle,
the root of a current drive might still not be the best place to run
ispell from (just in case it turns out to be a removable drive and we
lock it unnecessarily).
#> I can't see how this would ever fail; on Unix-like systems,
There is no problem on Unix-like systems, as those systems allow you to
rename/move/remove/whatever a directory even if you run ispell from it,
so it's OK to make it so. Only Windows is problematic.
#> you have to have access to all parents of a directory to be in it
#> anyway, and on all systems (I believe) there are fixed points. If
#> this turns out to be useful, an obvious `file-system-root' function
#> could be created to put the while loop in one place.
*If* somebody else finds file-system-root function to be useful, then it
might make sense to use it in ispell.el -- but otherwise I think it is
an overkill. YMMV, of course.
**************************************************
--- /EmacsCVS/lisp/textmodes/ispell.el 2006-09-26 20:28:23.092467200 +0200
+++ /Emacs/lisp/textmodes/ispell.el 2006-10-06 00:30:58.450860800 +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 (memq system-type '(cygwin windows-nt)) invocation-directory default-directory)))
(apply 'start-process
"ispell" nil ispell-program-name
"-a" ; accept single input lines
**************************************************
--
Best wishes,
Slawomir Nowaczyk
( slawomir.nowaczyk.847@student.lu.se )
Living on Earth may be expensive, but it includes
an annual free trip around the Sun.
next prev parent reply other threads:[~2006-10-05 22:33 UTC|newest]
Thread overview: 10+ messages / expand[flat|nested] mbox.gz Atom feed top
2006-09-18 14:32 Starting ispell in some fixed directory Slawomir Nowaczyk
2006-09-18 18:51 ` Richard Stallman
2006-09-18 19:10 ` Eli Zaretskii
2006-09-24 17:37 ` Slawomir Nowaczyk
2006-09-25 8:21 ` Slawomir Nowaczyk
2006-10-05 21:36 ` Slawomir Nowaczyk
2006-10-05 22:00 ` Stuart D. Herring
2006-10-05 22:33 ` Slawomir Nowaczyk [this message]
2006-10-05 22:43 ` Stefan Monnier
2006-10-06 20:28 ` Slawomir Nowaczyk
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
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20061006000443.A584.SLAWOMIR.NOWACZYK.847@student.lu.se \
--to=slawomir.nowaczyk.847@student.lu.se \
/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 external index
https://git.savannah.gnu.org/cgit/emacs.git
https://git.savannah.gnu.org/cgit/emacs/org-mode.git
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.