[gnu.emacs.bug] absolute paths in GNU emacs

primer@BRAUER.HARVARD.EDU (Jeremy Primer) (02/24/90)

It annoyed me somewhat that putting

(setq load-path (cons "~/emacs/lisp" load-path))

in my .emacs file failed to cause emacs to search my own lisp directory for
elisp code.  Reason: emacs only likes to use absolute paths internally,
objected to the use of "~" in a directory name.  In short, I became the
"luser" in the function "openp()" in lread.c.

I can live with that.  If emacs wants its internal paths to be absolute,
then that makes sense to me.  What bothered me much more was that the same
treatment was given to paths specified in the environment, i.e.

setenv EMACSLOADPATH "~/emacs/lisp:/usr/local/lib/emacs/lisp"

also luses for the same reason.  This is bad, since people have been
specifying relative paths in their .login's for years.  Please hack
decode_env_path() to expand relative paths in the next release.

Or, alternatively, if I am mistaken and emacs is supposed to deal with
relative paths internally, then I guess openp() needs fixing.

Jeremy Primer
primer@math.harvard.edu

nhess@dvlseq.oracle.com (Nate Hess) (02/27/90)

In article <9002240247.AA13575@brauer.harvard.edu>, primer@BRAUER (Jeremy Primer) writes:
>It annoyed me somewhat that putting
>
>(setq load-path (cons "~/emacs/lisp" load-path))
>
>in my .emacs file failed to cause emacs to search my own lisp directory for
>elisp code.  Reason: emacs only likes to use absolute paths internally,

Well, "~/emacs/lisp" *is* an absolute path.  You just expect Emacs to
expand the "~" for you.  A way to have this done is to do something
like:

	(setq load-path (cons (expand-file-name "~/emacs/lisp") load-path))


Hope this helps,
--woodstock
-- 
	   "What I like is when you're looking and thinking and looking
	   and thinking...and suddenly you wake up."   - Hobbes

nhess@oracle.com or ...!uunet!oracle!nhess or (415) 598-3046

bbc@libya.rice.edu (Benjamin Chase) (02/27/90)

primer@BRAUER.HARVARD.EDU (Jeremy Primer) complains:

[Emacs doesn't expand occurrences of `~' in load-path.  Can
decode_env_path by taught to do this?]

I concur.  Lacking this (either for the time being, or permanently), I
recommend:

	(setq-default load-path (mapcar 'expand-file-name load-path))

in your .emacs.
--
	Ben Chase <bbc@rice.edu>, Rice University, Houston, Texas

rbr4@uhura.cc.rochester.edu (Roland Roberts) (02/28/90)

In article <1990Feb26.175514.10768@oracle.com> nhess@dvlseq.oracle.com
(Nate Hess) writes:

>.... You just expect Emacs to expand the "~" for you.  A way to have
>this done is to do something like:
>
>	(setq load-path (cons (expand-file-name "~/emacs/lisp") load-path))
>
>nhess@oracle.com or ...!uunet!oracle!nhess or (415) 598-3046

Unfortunately, this doesn't work on VMS.  You get the following:

	(expand-file-name "~/emacs/")
	"user$disk2:[roberts]EMACS:"
	(expand-file-name "~/public/cd/")
	"user$disk2:[roberts]PUBLIC:[CD]"

This just means I have to put in the explicit path, which is no big
deal for setting the load-path, but it is a pain that find-file will
accept "~/file-name" but not "~/subdir/file-name".  One has to use the
mixed notation "~/[.subdir]file-name".

roland
-- 
Roland Roberts,  University of Rochester   BITNET: roberts@uornsrl
  Nuclear Structure Research Lab         INTERNET: rbr4@uhura.cc.rochester.edu
  271 East River Road                        UUCP: rochester!ur-cc!rbr4
  Rochester, NY  14267                       AT&T: (716) 275-8962