unofficial mirror of bug-gnu-emacs@gnu.org 
 help / color / mirror / code / Atom feed
From: Jonas Bernoulli <jonas@bernoul.li>
To: Eli Zaretskii <eliz@gnu.org>
Cc: 58073@debbugs.gnu.org
Subject: bug#58073: 29.0.50; Uninstalled emacs sends startup messages to stderr
Date: Sun, 25 Sep 2022 20:30:05 +0200	[thread overview]
Message-ID: <87mtanmhn6.fsf@bernoul.li> (raw)
In-Reply-To: <83tu4vl9wr.fsf@gnu.org>

>> Due to reasons that aren't important here, I recently had to replace the
>> symlink with a wrapper script, and that resulted in these messages being
>> send to stderr.

I was very wrong about that not being important here.

Installing emacs using guix sets EMACSLOADPATH in a file that is sourced
by the shells startup file.  To me it looks like they are abusing this
variable; it makes it impossible to use an emacs that wasn't installed
using guix, without something to counter their modification.  I did that
with a wrapper script.

The value that is set somewhere in the shell's init files is something
like "/home/jonas/.guix-home/profile/share/emacs/site-lisp".  It doesn't
contain an empty element, which would "stand for the default value of
`load-path'", according to (info "(emacs)General Variables").

The side startup file is located inside this directory and contains

  (when (require 'guix-emacs nil t)
    (guix-emacs-autoload-packages)
    (advice-add 'package-load-all-descriptors :after
                #'guix-emacs-load-package-descriptors))

The file "guix-emacs.el" is located in the same directory.  So the
purpose of setting EMACSLOADPATH seems to be to allow using `require' to
load that file.  This doesn't seem right to me, they could just as well
extend the load-path inside "site-lisp.el", or load their additional
init file using `load'.

To deal with the incomplete EMACSLOADPATH, as set in the shell
environment, they use a wrapper script named "emacs" and located on PATH:

  #!/gnu/store/4y5m9lb8k3qkb1y9m02sw9w9a6hacd16-bash-minimal-5.1.8/bin/bash
  export XDG_DATA_DIRS="/gnu/store/h6qdfd4sjdg28jq16600hcjky0cfw9gx-shared-mime-info-1.15/share:/gnu/store/bnsf9il448hl5xjavbhq3rcx355svz2v-glib-2.70.2/share:/gnu/store/7njbpmsgwmx59xn2r6q097iy2wwscb44-gtk+-3.24.30/share:/gnu/store/w0ssipd06il3kvyvqihpmw4lwbhwwfq3-emacs-28.1/share${XDG_DATA_DIRS:+:}$XDG_DATA_DIRS"
  export GTK_PATH="/gnu/store/7njbpmsgwmx59xn2r6q097iy2wwscb44-gtk+-3.24.30/lib/gtk-3.0${GTK_PATH:+:}$GTK_PATH"
  export PATH="$PATH${PATH:+:}/gnu/store/0c1yfbxyv877mlgychfgvmk5ha2jqh52-gzip-1.10/bin:/gnu/store/8fpk2cja3f07xls48jfnpgrzrljpqivr-coreutils-8.32/bin"
  export EMACSLOADPATH="$EMACSLOADPATH${EMACSLOADPATH:+:}/gnu/store/w0ssipd06il3kvyvqihpmw4lwbhwwfq3-emacs-28.1/share/emacs/28.1/lisp"
  exec -a "$0" "/gnu/store/w0ssipd06il3kvyvqihpmw4lwbhwwfq3-emacs-28.1/bin/.emacs-28.1-real" "$@"

I am under the impression that they should stop setting EMACSLOADPATH
and should either invent their own variable to replace that or load
"guix-emacs.el" using simpler means as I suggested above.

What do you think?  I intend to raise the issue with the guix folks but
would first like to hear your opinion.

If I unset EMACSLOADPATH, then everything works as expected.

> Emacs has special support for running from the build tree, but in your
> case it somehow doesn't realize that.

As a side-note, the wrapper script that I previously used looked like
this:

  #!/bin/sh
  export EMACSLOADPATH="\
  /home/jonas/.guix-home/profile/share/emacs/site-lisp:\
  /home/jonas/src/emacs/emacs/lisp"
  exec -a "$0" "/home/jonas/src/emacs/emacs/src/emacs" "$@"

The build tree is at "/home/jonas/src/emacs/emacs"; I think the value I
set above is correct (correct me if I am wrong), so it seems that when
running from the build tree EMACSLOADPATH has to be unset; explicitly
doubling down on the defaults doesn't work.  I also tried with an empty
element.





  reply	other threads:[~2022-09-25 18:30 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-09-25 15:15 bug#58073: 29.0.50; Uninstalled emacs sends startup messages to stderr Jonas Bernoulli
2022-09-25 16:02 ` Eli Zaretskii
2022-09-25 18:30   ` Jonas Bernoulli [this message]
2022-09-26  7:56     ` Eli Zaretskii
2022-10-02 14:50       ` Jonas Bernoulli
2022-10-02 14:54         ` Eli Zaretskii
2022-10-02 20:55           ` Jonas Bernoulli
2022-10-02 22:14             ` Stefan Kangas
2022-10-03  2:30             ` Eli Zaretskii
2022-10-03 16:03             ` Jonas Bernoulli
2022-10-03 17:26               ` Eli Zaretskii
2022-10-03 18:51                 ` Jonas Bernoulli
2022-10-03 19:01                   ` Eli Zaretskii

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://www.gnu.org/software/emacs/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=87mtanmhn6.fsf@bernoul.li \
    --to=jonas@bernoul.li \
    --cc=58073@debbugs.gnu.org \
    --cc=eliz@gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).