From: "Stuart D. Herring" <herring@lanl.gov>
Cc: emacs-devel@gnu.org
Subject: Re: Starting ispell in some fixed directory
Date: Thu, 5 Oct 2006 15:00:47 -0700 (PDT) [thread overview]
Message-ID: <33838.128.165.123.18.1160085647.squirrel@webmail.lanl.gov> (raw)
In-Reply-To: <20061005222638.A577.SLAWOMIR.NOWACZYK.847@student.lu.se>
> Hello,
>
> Any comments on this?
[snip]
> #> + (default-directory (if (member system-type '(cygwin
> windows-nt)) temporary-file-directory default-directory)))
You can use `memq' here, since you're comparing symbols.
> #> 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', but I suppose it's
possible for that not to be known in some cases. 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)))))
...)
I can't see how this would ever fail; on Unix-like systems, 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.
Davis
--
This product is sold by volume, not by mass. If it appears too dense or
too sparse, it is because mass-energy conversion has occurred during
shipping.
next prev parent reply other threads:[~2006-10-05 22:00 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 [this message]
2006-10-05 22:33 ` Slawomir Nowaczyk
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=33838.128.165.123.18.1160085647.squirrel@webmail.lanl.gov \
--to=herring@lanl.gov \
--cc=emacs-devel@gnu.org \
/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.