GNU bug report logs - #44726
28.0.50; [feature/native-comp] Provide a mechanism to populate comp-eln-load-path from the environment

Previous Next

Package: emacs;

Reported by: Tad <tadfisher <at> gmail.com>

Date: Wed, 18 Nov 2020 21:06:01 UTC

Severity: normal

Found in version 28.0.50

Done: Andrea Corallo <akrl <at> sdf.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 44726 in the body.
You can then email your comments to 44726 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#44726; Package emacs. (Wed, 18 Nov 2020 21:06:01 GMT) Full text and rfc822 format available.

Acknowledgement sent to Tad <tadfisher <at> gmail.com>:
New bug report received and forwarded. Copy sent to bug-gnu-emacs <at> gnu.org. (Wed, 18 Nov 2020 21:06:02 GMT) Full text and rfc822 format available.

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

From: Tad <tadfisher <at> gmail.com>
To: bug-gnu-emacs <at> gnu.org
Cc: Andrea Corallo <akrl <at> sdf.org>
Subject: 28.0.50; [feature/native-comp] Provide a mechanism to populate
 comp-eln-load-path from the environment
Date: Wed, 18 Nov 2020 13:05:29 -0800
Emacs populates `load-path' at startup from `$EMACSLOADPATH' in the
process environment. It would be useful to have an
`$EMACSNATIVELOADPATH' or equivalent to populate `comp-eln-load-path'.

I have implemented a workaround in NixOS with some code in
`site-start.el', but it would probably be useful in other contexts as
well.

    ;; Append paths set via `EMACSNATIVELOADPATH', an environment
    ;; variable made up for this purpose.
    (when-let ((path-env (getenv "EMACSNATIVELOADPATH"))
               (paths-from-env (split-string path-env))
               (paths (seq-filter (lambda (path) (not (string= "" path)))
                                  paths-from-env)))
      (setq comp-eln-load-path
            (append paths comp-eln-load-path)))

Thanks,
Tad




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#44726; Package emacs. (Wed, 18 Nov 2020 21:16:01 GMT) Full text and rfc822 format available.

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

From: Andrea Corallo <akrl <at> sdf.org>
To: Tad <tadfisher <at> gmail.com>
Cc: bug-gnu-emacs <at> gnu.org
Subject: Re: 28.0.50; [feature/native-comp] Provide a mechanism to populate
 comp-eln-load-path from the environment
Date: Wed, 18 Nov 2020 21:15:11 +0000
Tad <tadfisher <at> gmail.com> writes:

> Emacs populates `load-path' at startup from `$EMACSLOADPATH' in the
> process environment. It would be useful to have an
> `$EMACSNATIVELOADPATH' or equivalent to populate `comp-eln-load-path'.
>
> I have implemented a workaround in NixOS with some code in
> `site-start.el', but it would probably be useful in other contexts as
> well.
>
>     ;; Append paths set via `EMACSNATIVELOADPATH', an environment
>     ;; variable made up for this purpose.
>     (when-let ((path-env (getenv "EMACSNATIVELOADPATH"))
>                (paths-from-env (split-string path-env))
>                (paths (seq-filter (lambda (path) (not (string= "" path)))
>                                   paths-from-env)))
>       (setq comp-eln-load-path
>             (append paths comp-eln-load-path)))

Wouldn't EMACS_NATIVE_LOAD_PATH be more idiomatic?

  Andrea




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#44726; Package emacs. (Wed, 18 Nov 2020 21:22:02 GMT) Full text and rfc822 format available.

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

From: Tad <tadfisher <at> gmail.com>
To: Andrea Corallo <akrl <at> sdf.org>
Cc: bug-gnu-emacs <at> gnu.org
Subject: Re: 28.0.50; [feature/native-comp] Provide a mechanism to populate
 comp-eln-load-path from the environment
Date: Wed, 18 Nov 2020 13:20:37 -0800
On Wed, Nov 18, 2020 at 1:15 PM Andrea Corallo <akrl <at> sdf.org> wrote:

> Wouldn't EMACS_NATIVE_LOAD_PATH be more idiomatic?

I don't have a personal preference regarding the name. However, looking
at [1], we don't generally use underscores in the variables we support.
Some do have underscores, such as `DBUS_SESSION_BUS_ADDRESS' and `LC_*',
but these are standardized outside of Emacs and used by other programs.

[1] https://www.gnu.org/software/emacs/manual/html_node/emacs/General-Variables.html




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#44726; Package emacs. (Wed, 18 Nov 2020 21:42:02 GMT) Full text and rfc822 format available.

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

From: Andrea Corallo <akrl <at> sdf.org>
To: Tad <tadfisher <at> gmail.com>
Cc: bug-gnu-emacs <at> gnu.org
Subject: Re: 28.0.50; [feature/native-comp] Provide a mechanism to populate
 comp-eln-load-path from the environment
Date: Wed, 18 Nov 2020 21:41:31 +0000
Tad <tadfisher <at> gmail.com> writes:

> On Wed, Nov 18, 2020 at 1:15 PM Andrea Corallo <akrl <at> sdf.org> wrote:
>
>> Wouldn't EMACS_NATIVE_LOAD_PATH be more idiomatic?
>
> I don't have a personal preference regarding the name. However, looking
> at [1], we don't generally use underscores in the variables we support.
> Some do have underscores, such as `DBUS_SESSION_BUS_ADDRESS' and `LC_*',
> but these are standardized outside of Emacs and used by other programs.
>
> [1] https://www.gnu.org/software/emacs/manual/html_node/emacs/General-Variables.html

Fair.

Other question, shouldn't we use ":" as separator as in PATH?  I'm
asking because I see in your snippet you don't so I was wondering if
that's intentional.




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#44726; Package emacs. (Wed, 18 Nov 2020 21:46:01 GMT) Full text and rfc822 format available.

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

From: Tad <tadfisher <at> gmail.com>
To: Andrea Corallo <akrl <at> sdf.org>
Cc: bug-gnu-emacs <at> gnu.org
Subject: Re: 28.0.50; [feature/native-comp] Provide a mechanism to populate
 comp-eln-load-path from the environment
Date: Wed, 18 Nov 2020 13:45:01 -0800
On Wed, Nov 18, 2020 at 1:41 PM Andrea Corallo <akrl <at> sdf.org> wrote:

> Other question, shouldn't we use ":" as separator as in PATH?  I'm
> asking because I see in your snippet you don't so I was wondering if
> that's intentional.

That's not intentional, and thanks for catching that! Yes, ":" should
be used as the separator.




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#44726; Package emacs. (Thu, 19 Nov 2020 19:54:02 GMT) Full text and rfc822 format available.

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

From: Andrea Corallo <akrl <at> sdf.org>
To: Tad <tadfisher <at> gmail.com>
Cc: bug-gnu-emacs <at> gnu.org
Subject: Re: 28.0.50; [feature/native-comp] Provide a mechanism to populate
 comp-eln-load-path from the environment
Date: Thu, 19 Nov 2020 19:52:15 +0000
Tad <tadfisher <at> gmail.com> writes:

> On Wed, Nov 18, 2020 at 1:41 PM Andrea Corallo <akrl <at> sdf.org> wrote:
>
>> Other question, shouldn't we use ":" as separator as in PATH?  I'm
>> asking because I see in your snippet you don't so I was wondering if
>> that's intentional.
>
> That's not intentional, and thanks for catching that! Yes, ":" should
> be used as the separator.

Last question, what is specific need to filter out empty strings after
splitting?

  Andrea




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#44726; Package emacs. (Thu, 19 Nov 2020 22:51:02 GMT) Full text and rfc822 format available.

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

From: Tad <tadfisher <at> gmail.com>
To: Andrea Corallo <akrl <at> sdf.org>
Cc: bug-gnu-emacs <at> gnu.org
Subject: Re: 28.0.50; [feature/native-comp] Provide a mechanism to populate
 comp-eln-load-path from the environment
Date: Thu, 19 Nov 2020 14:50:39 -0800
On Thu, Nov 19, 2020 at 11:52 AM Andrea Corallo <akrl <at> sdf.org> wrote:

> Last question, what is specific need to filter out empty strings after
> splitting?

NixOS has code which appends an extra path separator[1], which looks
like:

    # It turns out, that the trailing : is actually required
    # see https://www.gnu.org/software/emacs/manual/html_node/elisp/Library-Search.html
    export EMACSLOADPATH="$lispDir:${EMACSLOADPATH-}"

The link to the Emacs manual leads to a section containing the text:

    An empty element in the value of the environment variable, whether
    trailing (as in the above example), leading, or embedded, is
    replaced by the default value of load-path as determined by the
    standard initialization procedure. If there are no such empty
    elements, then EMACSLOADPATH specifies the entire load-path. You
    must include either an empty element, or the explicit path to the
    directory containing the standard Lisp files, else Emacs will not
    function. (Another way to modify load-path is to use the -L
    command-line option when starting Emacs; see below.)

As the code I posted above simply prepends the value of this variable to
`comp-eln-load-path', which is already initialized with appropriate
default values, I didn't believe the special handling of empty path
entries was warranted in site-start.el. It would be consistent for
`comp' to implement the behavior as is done for `EMACSLOADPATH',
however.

[1] https://github.com/NixOS/nixpkgs/blob/bf486f784ddd969c03243dba4c93d0e8e861173e/pkgs/build-support/emacs/setup-hook.sh#L4-L6




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#44726; Package emacs. (Fri, 20 Nov 2020 10:04:01 GMT) Full text and rfc822 format available.

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

From: Andrea Corallo <akrl <at> sdf.org>
To: Tad <tadfisher <at> gmail.com>
Cc: bug-gnu-emacs <at> gnu.org
Subject: Re: 28.0.50; [feature/native-comp] Provide a mechanism to populate
 comp-eln-load-path from the environment
Date: Fri, 20 Nov 2020 10:03:22 +0000
Hi Tad,

a55415af7e should do what we want.

Okay to close?

Thanks

  Andrea




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#44726; Package emacs. (Fri, 20 Nov 2020 14:44:01 GMT) Full text and rfc822 format available.

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

From: Stefan Monnier <monnier <at> iro.umontreal.ca>
To: Tad <tadfisher <at> gmail.com>
Cc: 44726 <at> debbugs.gnu.org, Andrea Corallo <akrl <at> sdf.org>
Subject: Re: bug#44726: 28.0.50; [feature/native-comp] Provide a mechanism
 to populate comp-eln-load-path from the environment
Date: Fri, 20 Nov 2020 09:43:43 -0500
> Emacs populates `load-path' at startup from `$EMACSLOADPATH' in the
> process environment. It would be useful to have an
> `$EMACSNATIVELOADPATH' or equivalent to populate `comp-eln-load-path'.

Can you explain why you need that?

The eln-load-path is basically a list of cache-directories, so it plays
a role fairly different from that of EMACSLOADPATH.


        Stefan





Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#44726; Package emacs. (Mon, 30 Nov 2020 23:26:01 GMT) Full text and rfc822 format available.

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

From: Andrea Corallo <akrl <at> sdf.org>
To: Andrea Corallo via "Bug reports for GNU Emacs, the Swiss army knife of
 text editors" <bug-gnu-emacs <at> gnu.org>
Cc: Tad <tadfisher <at> gmail.com>, 44726-done <at> debbugs.gnu.org
Subject: Re: bug#44726: 28.0.50; [feature/native-comp] Provide a mechanism
 to populate comp-eln-load-path from the environment
Date: Mon, 30 Nov 2020 23:25:25 +0000
Andrea Corallo via "Bug reports for GNU Emacs, the Swiss army knife of
text editors" <bug-gnu-emacs <at> gnu.org> writes:

> Hi Tad,
>
> a55415af7e should do what we want.
>
> Okay to close?
>
> Thanks
>
>   Andrea

Closing this as I think is fulfilled.

Happy to repopen in case it's not :)

  Andrea




Reply sent to Andrea Corallo <akrl <at> sdf.org>:
You have taken responsibility. (Mon, 30 Nov 2020 23:26:02 GMT) Full text and rfc822 format available.

Notification sent to Tad <tadfisher <at> gmail.com>:
bug acknowledged by developer. (Mon, 30 Nov 2020 23:26:02 GMT) Full text and rfc822 format available.

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

This bug report was last modified 4 years and 170 days ago.

Previous Next


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