unofficial mirror of emacs-devel@gnu.org 
 help / color / mirror / code / Atom feed
* "load-file" surreptitiously pushes directories onto load-path.
@ 2007-04-09  7:53 Alan Mackenzie
       [not found] ` <17946.90.547705.72200@farnswood.snap.net.nz>
  0 siblings, 1 reply; 2+ messages in thread
From: Alan Mackenzie @ 2007-04-09  7:53 UTC (permalink / raw)
  To: emacs-devel

Hi, Emacs!

Start a modern Emacs with
    # emacs -Q

In *scratch*, do
    C-u M-: load-path

Follow this up with
    M-x load-file ~/cc-mode-5.31.n/tests/000tests.elc

and repeat
    C-u M-: load-path

It will be seen that load-file has pushed the element
"/home/acm/cc-mode-5.31.n" onto the front of load-path.  This is surely
a bug.  And even if it's not, it ought to be!

I think it's a serious bug.  It can lead hackers to testing code which
is in a different directory from what they think.  It has done exactly
that to me for an extended period.

I've had a quick look through the Elisp manual, without finding this
behaviour described.

As a matter of interest, this bug is in Emacs 21.  It is very old.

I might try and track it down tomorrow.

-- 
Alan Mackenzie (Ittersbach, Germany).

^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: "load-file" surreptitiously pushes directories onto load-path.
       [not found] ` <17946.90.547705.72200@farnswood.snap.net.nz>
@ 2007-04-09 10:16   ` Alan Mackenzie
  0 siblings, 0 replies; 2+ messages in thread
From: Alan Mackenzie @ 2007-04-09 10:16 UTC (permalink / raw)
  To: Nick Roberts; +Cc: emacs-devel

Hi, Nick!

On Mon, Apr 09, 2007 at 08:59:06PM +1200, Nick Roberts wrote:
>  > Start a modern Emacs with
>  >     # emacs -Q

>  > In *scratch*, do
>  >     C-u M-: load-path

>  > Follow this up with
>  >     M-x load-file ~/cc-mode-5.31.n/tests/000tests.elc

>  > and repeat
>  >     C-u M-: load-path

>  > It will be seen that load-file has pushed the element
>  > "/home/acm/cc-mode-5.31.n" onto the front of load-path.  This is surely
>  > a bug.  And even if it's not, it ought to be!

> I suspect that 000tests.elc does this, not load-file.

Yes, that's exactly it.  Thanks for the help.

Sorry for wasting everybody's time.

> Nick

-- 
Alan.

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2007-04-09 10:16 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2007-04-09  7:53 "load-file" surreptitiously pushes directories onto load-path Alan Mackenzie
     [not found] ` <17946.90.547705.72200@farnswood.snap.net.nz>
2007-04-09 10:16   ` Alan Mackenzie

Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).