GNU bug report logs - #14876
24.3; load-path and environment variable EMACSLOADPATH

Previous Next

Package: emacs;

Reported by: "Roland Winkler" <winkler <at> gnu.org>

Date: Mon, 15 Jul 2013 22:42:01 UTC

Severity: minor

Found in version 24.3

Fixed in version 24.4

Done: Glenn Morris <rgm <at> gnu.org>

Bug is archived. No further changes may be made.

To add a comment to this bug, you must first unarchive it, by sending
a message to control AT debbugs.gnu.org, with unarchive 14876 in the body.
You can then email your comments to 14876 AT debbugs.gnu.org in the normal way.

Toggle the display of automated, internal messages from the tracker.

View this report as an mbox folder, status mbox, maintainer mbox


Report forwarded to bug-gnu-emacs <at> gnu.org:
bug#14876; Package emacs. (Mon, 15 Jul 2013 22:42:01 GMT) Full text and rfc822 format available.

Acknowledgement sent to "Roland Winkler" <winkler <at> gnu.org>:
New bug report received and forwarded. Copy sent to bug-gnu-emacs <at> gnu.org. (Mon, 15 Jul 2013 22:42:02 GMT) Full text and rfc822 format available.

Message #5 received at submit <at> debbugs.gnu.org (full text, mbox):

From: "Roland Winkler" <winkler <at> gnu.org>
To: bug-gnu-emacs <at> gnu.org
Subject: 24.3; load-path and environment variable EMACSLOADPATH
Date: Mon, 15 Jul 2013 17:41:07 -0500
The node "Library Search" suggests to to set EMACSLOADPATH to some
user directory such as /home/foo/.emacs.d/lisp. Yet this does not
agree with the docstring of load-path and emacs fails miserably if
one uses

  export EMACSLOADPATH=/home/foo/.emacs.d/lisp

The proper meaning of EMACSLOADPATH seems to be the one given in the
docstring of load-path saying that EMACSLOADPATH overrides the
default value of load-path specified by file `epaths.h' when Emacs
was built.

The docstring of load-path also says that an element `nil' means
"try default directory". Yet what is the "default directory" in this
context?  default-directory is a buffer-local variable with default nil.

I looked into this because I was looking for a way to _extend_ the
emacs load path in a Makefile generated via autoconf.
Autoconf uses the shell script elisp-comp to compile lisp files.
This script uses

  echo "(setq load-path (cons nil load-path))" > script
  $EMACS -batch -q -l script -f batch-byte-compile *.el || exit $?

In such a hard-coded setting I cannot (easily) extend the load-path via
the emacs option --load.  But the purpose of loading the file script
is not clear to me either.


In GNU Emacs 24.3.1 (x86_64-unknown-linux-gnu, GTK+ Version 2.20.1)
 of 2013-03-27 on regnitz
Windowing system distributor `The X.Org Foundation', version 11.0.10706000
System Description:	Ubuntu 10.04.4 LTS





Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#14876; Package emacs. (Mon, 15 Jul 2013 22:49:02 GMT) Full text and rfc822 format available.

Message #8 received at 14876 <at> debbugs.gnu.org (full text, mbox):

From: Glenn Morris <rgm <at> gnu.org>
To: "Roland Winkler" <winkler <at> gnu.org>
Cc: 14876 <at> debbugs.gnu.org
Subject: Re: bug#14876: 24.3; load-path and environment variable EMACSLOADPATH
Date: Mon, 15 Jul 2013 18:48:44 -0400
"Roland Winkler" wrote:

> The node "Library Search" suggests to to set EMACSLOADPATH to some
> user directory such as /home/foo/.emacs.d/lisp.

I don't quite see that it literally says that; but the info node should
be tidied up a little bit.

> The proper meaning of EMACSLOADPATH seems to be the one given in the
> docstring of load-path saying that EMACSLOADPATH overrides the
> default value of load-path specified by file `epaths.h' when Emacs
> was built.

Yes.

> The docstring of load-path also says that an element `nil' means
> "try default directory". Yet what is the "default directory" in this
> context?

Whatever the value is where you call `load' from.

> default-directory is a buffer-local variable with default nil.

Seems like a red-herring. Normally every buffer has a non-nil value.

> I looked into this because I was looking for a way to _extend_ the
> emacs load path in a Makefile generated via autoconf.

Use "emacs -L /path/to/add".

(cf http://debbugs.gnu.org/cgi/bugreport.cgi?bug=12100 )




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#14876; Package emacs. (Mon, 15 Jul 2013 23:12:02 GMT) Full text and rfc822 format available.

Message #11 received at 14876 <at> debbugs.gnu.org (full text, mbox):

From: "Roland Winkler" <winkler <at> gnu.org>
To: Glenn Morris <rgm <at> gnu.org>
Cc: 14876 <at> debbugs.gnu.org
Subject: Re: bug#14876: 24.3; load-path and environment variable EMACSLOADPATH
Date: Mon, 15 Jul 2013 18:11:18 -0500
On Mon Jul 15 2013 Glenn Morris wrote:
> > I looked into this because I was looking for a way to _extend_ the
> > emacs load path in a Makefile generated via autoconf.
> 
> Use "emacs -L /path/to/add".

...as I was trying to explain: this does not work with a Makefile
generated via autoconf.

> (cf http://debbugs.gnu.org/cgi/bugreport.cgi?bug=12100 )

I agree with
http://debbugs.gnu.org/cgi/bugreport.cgi?bug=12100#19




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#14876; Package emacs. (Mon, 15 Jul 2013 23:24:02 GMT) Full text and rfc822 format available.

Message #14 received at 14876 <at> debbugs.gnu.org (full text, mbox):

From: Glenn Morris <rgm <at> gnu.org>
To: "Roland Winkler" <winkler <at> gnu.org>
Cc: 14876 <at> debbugs.gnu.org
Subject: Re: bug#14876: 24.3; load-path and environment variable EMACSLOADPATH
Date: Mon, 15 Jul 2013 19:23:27 -0400
"Roland Winkler" wrote:

>> Use "emacs -L /path/to/add".
>
> ...as I was trying to explain: this does not work with a Makefile
> generated via autoconf.

Oh, I get it now, I think. 

Surely autoconf must provide _some_ way for you to customize the
command-line it uses, and if it does not, that sounds like an autoconf
bug, doesn't it? Can you do

EMACS="emacs -L /path/to/add"

or is EMACS treated literally as an executable name?

> I agree with
> http://debbugs.gnu.org/cgi/bugreport.cgi?bug=12100#19

So do I; but

http://debbugs.gnu.org/cgi/bugreport.cgi?bug=14513#102

Patches welcome.




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#14876; Package emacs. (Mon, 15 Jul 2013 23:30:02 GMT) Full text and rfc822 format available.

Message #17 received at 14876 <at> debbugs.gnu.org (full text, mbox):

From: Glenn Morris <rgm <at> gnu.org>
To: "Roland Winkler" <winkler <at> gnu.org>
Cc: 14876 <at> debbugs.gnu.org
Subject: Re: bug#14876: 24.3; load-path and environment variable EMACSLOADPATH
Date: Mon, 15 Jul 2013 19:29:51 -0400
Glenn Morris wrote:

> Surely autoconf must provide _some_ way for you to customize the
> command-line it uses, and if it does not, that sounds like an autoconf
> bug, doesn't it?

BTW, I guess you mean automake not autoconf.
Also, perhaps this an automake bug which is fixed:

http://debbugs.gnu.org/cgi/bugreport.cgi?bug=11806




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#14876; Package emacs. (Tue, 16 Jul 2013 00:35:02 GMT) Full text and rfc822 format available.

Message #20 received at 14876 <at> debbugs.gnu.org (full text, mbox):

From: "Roland Winkler" <winkler <at> gnu.org>
To: Glenn Morris <rgm <at> gnu.org>
Cc: 14876 <at> debbugs.gnu.org
Subject: Re: bug#14876: 24.3; load-path and environment variable EMACSLOADPATH
Date: Mon, 15 Jul 2013 19:34:03 -0500
On Mon Jul 15 2013 Glenn Morris wrote:
> Also, perhaps this an automake bug which is fixed:
> 
> http://debbugs.gnu.org/cgi/bugreport.cgi?bug=11806

Thanks for the hint. Indeed, this bug report seems to be outdated.
In GNU Automake 1.13 the script elisp-comp has been removed
completely, see

https://lists.gnu.org/archive/html/automake/2012-12/msg00038.html

(and 1.14 has been released since then, too)

For lisp files, automake 1.14 generates a Makefile using an approach
that has been completely redesigned. I need to check more carefully
whether now automake allows to extend the lisp load path.




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#14876; Package emacs. (Tue, 16 Jul 2013 00:56:02 GMT) Full text and rfc822 format available.

Message #23 received at 14876 <at> debbugs.gnu.org (full text, mbox):

From: "Roland Winkler" <winkler <at> gnu.org>
To: Glenn Morris <rgm <at> gnu.org>,
    14876 <at> debbugs.gnu.org
Subject: Re: bug#14876: 24.3; load-path and environment variable EMACSLOADPATH
Date: Mon, 15 Jul 2013 19:55:03 -0500
On Mon Jul 15 2013 Roland Winkler wrote:
> For lisp files, automake 1.14 generates a Makefile using an approach
> that has been completely redesigned. I need to check more carefully
> whether now automake allows to extend the lisp load path.

Indeed, the automake variable AM_ELCFLAGS does exactly what I need.
Hooray.




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#14876; Package emacs. (Tue, 16 Jul 2013 00:56:03 GMT) Full text and rfc822 format available.

Message #26 received at 14876 <at> debbugs.gnu.org (full text, mbox):

From: Glenn Morris <rgm <at> gnu.org>
To: "Roland Winkler" <winkler <at> gnu.org>
Cc: 14876 <at> debbugs.gnu.org
Subject: Re: bug#14876: 24.3; load-path and environment variable EMACSLOADPATH
Date: Mon, 15 Jul 2013 20:55:10 -0400
"Roland Winkler" wrote:

> In GNU Automake 1.13 the script elisp-comp has been removed
> completely, see
>
> https://lists.gnu.org/archive/html/automake/2012-12/msg00038.html
>
> (and 1.14 has been released since then, too)
>
> For lisp files, automake 1.14 generates a Makefile using an approach
> that has been completely redesigned. I need to check more carefully
> whether now automake allows to extend the lisp load path.

Great! Looks like you should just be able to set (AM_)ELCFLAGS to -L ...
in recent automake.




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#14876; Package emacs. (Tue, 16 Jul 2013 01:17:02 GMT) Full text and rfc822 format available.

Message #29 received at 14876 <at> debbugs.gnu.org (full text, mbox):

From: "Roland Winkler" <winkler <at> gnu.org>
To: Glenn Morris <rgm <at> gnu.org>
Cc: 14876 <at> debbugs.gnu.org
Subject: Re: bug#14876: 24.3; load-path and environment variable EMACSLOADPATH
Date: Mon, 15 Jul 2013 20:16:22 -0500
On Mon Jul 15 2013 Glenn Morris wrote:
> Great! Looks like you should just be able to set (AM_)ELCFLAGS to -L ...
> in recent automake.

With automake 1.14, by default, the compilation of lisp code uses
only the emacs option -batch. It does not include the option -q. 
I do not know whether this is reasonable. ...When I think about it,
this might even be considered a regression compared with the old
automake shell script elisp-comp which did use the option -q.
Should I send a bug report to the automake maintainers about this?




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#14876; Package emacs. (Tue, 16 Jul 2013 01:40:01 GMT) Full text and rfc822 format available.

Message #32 received at 14876 <at> debbugs.gnu.org (full text, mbox):

From: Glenn Morris <rgm <at> gnu.org>
To: "Roland Winkler" <winkler <at> gnu.org>
Cc: 14876 <at> debbugs.gnu.org
Subject: Re: bug#14876: 24.3; load-path and environment variable EMACSLOADPATH
Date: Mon, 15 Jul 2013 21:39:51 -0400
"Roland Winkler" wrote:

> With automake 1.14, by default, the compilation of lisp code uses
> only the emacs option -batch. It does not include the option -q. 
> I do not know whether this is reasonable. ...When I think about it,
> this might even be considered a regression compared with the old
> automake shell script elisp-comp which did use the option -q.
> Should I send a bug report to the automake maintainers about this?

-batch implies -q.

(I always forget that as well; it's a non-obvious relationship IMO.)




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#14876; Package emacs. (Tue, 16 Jul 2013 03:15:02 GMT) Full text and rfc822 format available.

Message #35 received at 14876 <at> debbugs.gnu.org (full text, mbox):

From: "Roland Winkler" <winkler <at> gnu.org>
To: Glenn Morris <rgm <at> gnu.org>
Cc: 14876 <at> debbugs.gnu.org
Subject: Re: bug#14876: 24.3; load-path and environment variable EMACSLOADPATH
Date: Mon, 15 Jul 2013 22:14:49 -0500
On Mon Jul 15 2013 Glenn Morris wrote:
> "Roland Winkler" wrote:
> > With automake 1.14, by default, the compilation of lisp code uses
> > only the emacs option -batch. It does not include the option -q. 
> > I do not know whether this is reasonable. ...When I think about it,
> > this might even be considered a regression compared with the old
> > automake shell script elisp-comp which did use the option -q.
> > Should I send a bug report to the automake maintainers about this?
> 
> -batch implies -q.
> 
> (I always forget that as well; it's a non-obvious relationship IMO.)

Ah, thanks.




Reply sent to Glenn Morris <rgm <at> gnu.org>:
You have taken responsibility. (Thu, 14 Nov 2013 08:40:03 GMT) Full text and rfc822 format available.

Notification sent to "Roland Winkler" <winkler <at> gnu.org>:
bug acknowledged by developer. (Thu, 14 Nov 2013 08:40:04 GMT) Full text and rfc822 format available.

Message #40 received at 14876-done <at> debbugs.gnu.org (full text, mbox):

From: Glenn Morris <rgm <at> gnu.org>
To: 14876-done <at> debbugs.gnu.org
Subject: Re: bug#14876: 24.3; load-path and environment variable EMACSLOADPATH
Date: Thu, 14 Nov 2013 03:39:42 -0500
Version: 24.4

I finally got round to updating the "Library Search" section.




bug archived. Request was from Debbugs Internal Request <help-debbugs <at> gnu.org> to internal_control <at> debbugs.gnu.org. (Thu, 12 Dec 2013 12:24:05 GMT) Full text and rfc822 format available.

This bug report was last modified 11 years and 195 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.