emacs-devel
[Top][All Lists]
Advanced

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

Re: load-path contains directories or directory names?


From: Eli Zaretskii
Subject: Re: load-path contains directories or directory names?
Date: Fri, 23 Oct 2015 10:25:06 +0300

> From: Stephen Leake <address@hidden>
> Date: Thu, 22 Oct 2015 23:26:54 -0500
> 
> Here `dir' is taken from load-path, or a similar user-provided path. The
> doc string for `load-path' says it consists of "directory names". In
> emacs -Q, `load-path' indeed has no elements that end in '/'.
> 
> However, after (package-initialize), `load-path' had elements that end
> in '/'. This comes from package-autoload-ensure-default-file in
> package.el, which adds lines like this to each package's autoload:
> 
> "(add-to-list 'load-path (or (file-name-directory #$) (car load-path)))\n"
> 
> Is this a bug, or should code that uses `load-path' tolerate this?

It's a bug, patches are welcome to fix it.

> On the other hand, since `load-path' can be modified by users, perhaps
> code must be tolerant anyway.

That's a separate issue.  Defensive programming is frequently a good
thing.  But IMO we shouldn't _force_ Lisp packages into defensive
programming, so I think Emacs itself should only put directory names
into load-path.



reply via email to

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