[Top][All Lists]

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

Re: Starting ispell in some fixed directory

From: Stuart D. Herring
Subject: Re: Starting ispell in some fixed directory
Date: Thu, 5 Oct 2006 15:00:47 -0700 (PDT)
User-agent: SquirrelMail/1.4.6-7.el3.7lanl

> Hello,
> Any comments on this?
> #> +              (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
                     (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.


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

reply via email to

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