emacs-next is broke, "seq" missing

  • Done
  • quality assurance status badge
Details
7 participants
  • Morgan.J.Smith
  • Ludovic Courtès
  • Malte Gerdes
  • Maxim Cournoyer
  • Michael Rohleder
  • Martin Becze
  • Pierre Langlois
Owner
unassigned
Submitted by
Martin Becze
Severity
important
M
M
Martin Becze wrote on 8 Sep 2020 14:13
(address . bug-guix@gnu.org)
615e26f9-fb67-e929-697e-81fe4f70b03c@riseup.net
emacs-next recently broke. It now has this error on start up.

"require: Cannot open load file: No such file or directory, seq"

I think this must have happened relatively recently (with the last 3
weeks) since it was working fine earlier.
Attachment: signature.asc
M
M
Malte Gerdes wrote on 8 Sep 2020 14:40
(name . Martin Becze)(address . mjbecze@riseup.net)(address . 43277@debbugs.gnu.org)
CAMVpQiUaMptTYs832N_CoaarpeJps=GxQA-9JaXOrPo4tTmmQQ@mail.gmail.com
Hi,

I had a similar error yesterday, with emacs27. Turned out I had to reload
my environment because some variables still pointed to emacs 26.3
directories which didn't exist anymore.

Malte

On Tue, 8 Sep 2020, 14:25 Martin Becze, <mjbecze@riseup.net> wrote:

Toggle quote (8 lines)
> emacs-next recently broke. It now has this error on start up.
>
> "require: Cannot open load file: No such file or directory, seq"
>
> I think this must have happened relatively recently (with the last 3
> weeks) since it was working fine earlier.
>
>
Attachment: file
M
M
Martin Becze wrote on 8 Sep 2020 15:17
(name . Malte Gerdes)(address . malte.f.gerdes@gmail.com)(address . 43277@debbugs.gnu.org)
44d34919-f529-8131-3645-e6f6ad61855e@riseup.net
I just tried out emacs27 and what replicated Malte's experience. But
even after reloading my environment emacs28 doesn't work.

On 9/8/20 7:40 AM, Malte Gerdes wrote:
Toggle quote (18 lines)
> Hi,
>
> I had a similar error yesterday, with emacs27. Turned out I had to
> reload my environment because some variables still pointed to emacs 26.3
> directories which didn't exist anymore.
>
> Malte
>
> On Tue, 8 Sep 2020, 14:25 Martin Becze, <mjbecze@riseup.net
> <mailto:mjbecze@riseup.net>> wrote:
>
> emacs-next recently broke. It now has this error on start up.
>
> "require: Cannot open load file: No such file or directory, seq"
>
> I think this must have happened relatively recently (with the last 3
> weeks) since it was working fine earlier.
>
Attachment: signature.asc
M
M
Michael Rohleder wrote on 8 Sep 2020 16:01
(name . Martin Becze)(address . mjbecze@riseup.net)(address . 43277@debbugs.gnu.org)
87wo14l647.fsf@rohleder.de
Hi Martin,

Martin Becze <mjbecze@riseup.net> writes:
Toggle quote (4 lines)
> emacs-next recently broke. It now has this error on start up.
>
> "require: Cannot open load file: No such file or directory, seq"

Maybe it's possible to find where this is coming from?
(starting emacs with "--debug-init" might help or starting with a
minimal .emacs.el etc)

--
Alle anziehenden Leute sind immer im Kern verdorben.
Darin liegt das Geheimnis ihrer sympathischen Kraft.
Oskar Wilde
-----BEGIN PGP SIGNATURE-----

iQFFBAEBCAAvFiEEdV4t5dDVhcUueCgwfHr/vv7yyyUFAl9XjsgRHG1pa2VAcm9o
bGVkZXIuZGUACgkQfHr/vv7yyyXDRQgAoaEc7ExvNQ80KVB4Evl9VlPM/t6NS7Nn
yzhk7XzT8Hx7trCcRLMHEJbA8EiBQBeTDH0J9d05UPcM0vKL0AYLZbtelabL7Qtx
5GzkHwR8limm751KVCJQwSsf143gDyDIb9EMboiFM/Bu5ucHOugb6e70TbSSYfPz
YWM1KSDxCllucmrKN05nKV59kQVc89HViao3C0DH9bRlZY12W9R4UvaxcDIhZLOM
EMFYUy7dJmEsm80iIUWrAZ7nyd5wgXkNOhyO/j8TJZd7/f4gEZuJDiHi4ezWBnpJ
6pjLEgHJ2Jqk50+q7mQEL4zsPHiJSJ8vJgISrkryg/fE8fWeE0UvOA==
=4FdF
-----END PGP SIGNATURE-----

M
M
Martin Becze wrote on 8 Sep 2020 17:07
(name . Michael Rohleder)(address . mike@rohleder.de)(address . 43277@debbugs.gnu.org)
b76cc43f-a811-8fd5-3ba0-1f31a12b2518@riseup.net
--debug-init doesn't help and we don't seem to be loading the init file.

On 9/8/20 9:01 AM, Michael Rohleder wrote:
Toggle quote (11 lines)
> Hi Martin,
>
> Martin Becze <mjbecze@riseup.net> writes:
>> emacs-next recently broke. It now has this error on start up.
>>
>> "require: Cannot open load file: No such file or directory, seq"
>
> Maybe it's possible to find where this is coming from?
> (starting emacs with "--debug-init" might help or starting with a
> minimal .emacs.el etc)
>
Attachment: signature.asc
P
P
Pierre Langlois wrote on 11 Sep 2020 22:09
(name . Martin Becze)(address . mjbecze@riseup.net)
87tuw4848q.fsf@gmx.com
Hi Martin,

Sorry this not working for you :-/

Martin Becze writes:

Toggle quote (7 lines)
> emacs-next recently broke. It now has this error on start up.
>
> "require: Cannot open load file: No such file or directory, seq"
>
> I think this must have happened relatively recently (with the last 3
> weeks) since it was working fine earlier.

I submitted a patch a few weeks ago that entirely removed the seq
package from guix, it's included in emacs itself so it shouldn't be
needed anymore, and actually, installing it along with emacs27 causes
stack overflows.

Testing emacs-next, I can see that seq.el is included as well:

$ ls $(guix build emacs-next)/share/emacs/28.0.50/lisp/emacs-lisp/seq.el.gz

Then inside a clean environment it's able to (require 'seq):

$ guix environment --ad-hoc emacs-next -- emacs -Q --eval "(require 'seq)"

Using the -Q flag to make sure it's not loading any config.

Can you share some of your emacs config and how you're installing emacs
packages? I assume they're not installed with guix, unless there's a way
to replace each package's input with emacs-next automatically.

Thanks,
Pierre
-----BEGIN PGP SIGNATURE-----

iQFMBAEBCgA2FiEEctU9gYy29KFyWDdMqPyeRH9PfVQFAl9b2YUYHHBpZXJyZS5s
YW5nbG9pc0BnbXguY29tAAoJEKj8nkR/T31U+8EH+QGozRrjTZXG+/hWGxFTM0J9
+IRtV6yw/M0WV9j7XEuWh0OKR9P387ICiE/GCjQ6aVUfJ9reb4+2o9HVIikmPNOm
KCpytz7aO8hdqtV7XRMffP8RnRsloszJ1ehZX+X8+mdMnMdUymp4a+23yM52eWzu
HbtbVmS7bLucJDMGCpdO1HM0AEaDXqCapUOr2xEtnK3CPA+su4oZcNgBYjjgIzX4
Apv33OfCw6Lmpcid5jNKf5dqAMM8VlgkfNHVxNGcAkRgZsm875ES6eiHqdCaSS6T
vo7mXgCqtcDusF9EiBfPeOOXdGYZv71MEdSY9ywRa9HPeM5HcpC9O6iIZsiqoqI=
=6afK
-----END PGP SIGNATURE-----

M
M
Morgan.J.Smith wrote on 15 Sep 2020 00:08
[PATCH] gnu: emacs-next: Fix load path and version
(address . 43277@debbugs.gnu.org)
DM5PR1001MB210564F9A72336BF27BFA57FC5230@DM5PR1001MB2105.namprd10.prod.outlook.com
From: Morgan Smith <Morgan.J.Smith@outlook.com>

* gnu/packages/emacs.scm (emacs):
[strip-double-wrap] Modify to work with emacs-next

* gnu/packages/emacs.scm (emacs-next):
[version] Change version from 28.0.50.1 to 28.0.50
[arguments] Removed field
[native-search-paths] New field
---

The problem turned out to be that EMACSLOADPATH wasn't being set
properly. This patch fixes that.



gnu/packages/emacs.scm | 37 ++++++++++++++++---------------------
1 file changed, 16 insertions(+), 21 deletions(-)

Toggle diff (71 lines)
diff --git a/gnu/packages/emacs.scm b/gnu/packages/emacs.scm
index 03c28ee7a7..b3d099257d 100644
--- a/gnu/packages/emacs.scm
+++ b/gnu/packages/emacs.scm
@@ -196,11 +196,12 @@
(lambda* (#:key outputs #:allow-other-keys)
;; Directly copy emacs-X.Y to emacs, so that it is not wrapped
;; twice. This also fixes a minor issue, where WMs would not be
- ;; able to track emacs back to emacs.desktop.
+ ;; able to track emacs back to emacs.desktop. It's done using
+ ;; this-package so emacs-next can reuse it
(with-directory-excursion (assoc-ref outputs "out")
(copy-file (string-append
"bin/emacs-"
- ,(version-major+minor (package-version emacs)))
+ ,(car (string-split (package-version this-package) #\-)))
"bin/emacs")
#t)))
(add-before 'reset-gzip-timestamps 'make-compressed-files-writable
@@ -279,11 +280,10 @@ languages.")
(define-public emacs-next
(let ((commit "2ea34662c20f71d35dd52a5ed996542c7386b9cb")
- (revision "0")
- (emacs-version "28.0.50.1"))
+ (revision "0"))
(package/inherit emacs
(name "emacs-next")
- (version (git-version emacs-version revision commit))
+ (version (git-version "28.0.50" revision commit))
(source
(origin
(inherit (package-source emacs))
@@ -295,24 +295,19 @@ languages.")
(sha256
(base32
"0igjm9kwiswn2dpiy2k9xikbdfc7njs07ry48fqz70anljj8y7y3"))))
- (arguments
- (substitute-keyword-arguments (package-arguments emacs)
- ((#:phases phases)
- `(modify-phases ,phases
- (replace 'strip-double-wrap
- (lambda* (#:key outputs #:allow-other-keys)
- ;; Directly copy emacs-X.Y to emacs, so that it is not wrapped
- ;; twice. This also fixes a minor issue, where WMs would not be
- ;; able to track emacs back to emacs.desktop.
- (with-directory-excursion (assoc-ref outputs "out")
- (copy-file (string-append
- "bin/emacs-"
- ,(version-major+minor+point (package-version emacs-next)))
- "bin/emacs")
- #t)))))))
(native-inputs
`(("autoconf" ,autoconf)
- ,@(package-native-inputs emacs))))))
+ ,@(package-native-inputs emacs)))
+
+ (native-search-paths
+ (list (search-path-specification
+ (variable "EMACSLOADPATH")
+ ;; The versioned entry is for the Emacs' builtin libraries.
+ (files (list "share/emacs/site-lisp"
+ (string-append "share/emacs/" (car (string-split version #\-)) "/lisp"))))
+ (search-path-specification
+ (variable "INFOPATH")
+ (files '("share/info"))))))))
(define-public emacs-minimal
;; This is the version that you should use as an input to packages that just
--
2.28.0
M
M
Morgan Smith wrote on 22 Sep 2020 15:05
(address . guix-devel@gnu.org)
DM5PR1001MB2105E63A2DCDC4F78819B162C53B0@DM5PR1001MB2105.namprd10.prod.outlook.com
Hello guix-devel,

I fear this patch may get lost (as it has not received feedback since I
posted it on Sept 14th (ok maybe I'm just being impatient but I'd like
to think emacs-next is an important package)) so I've decided to post it
in guix-devel. While I'm here I might as well add some much needed
information.

The emacs-next package has been broken since it was re-added on August
31st. It was added by me so this my fault. It's broken because the
EMACSLOADPATH environment variable only contains the lisp location for
your user profile and doesn't include the lisp bundled with
emacs-next. If you have emacs and emacs-next installed at the same time,
emacs-next appears to work as expected because it's using the lisp
installed with emacs. I'm not sure if there is a way to make sure people
only install emacs or emacs-next, but you should only install one.

I created the below patch on Sept 14th, and have been using it daily
since then with no issues.

The version goes from 28.0.50.1 to 28.0.50. The "1" is the build number
which gets incremented every time you run "make" (so not actually part
of the version). Also it's important to get the version correct as I use
it to refer to the binary.

When we copy the binary in 'string-double-wrap, I've decided to just
string split on #\-. This is remove the end of the git-version string so
we're left with just 28.0.50.

I need to copy the native-search-paths section from emacs and place it
into emacs-next. It would be cooler if the native-search-paths sections
was thunked so I could pull the this-package trick again to get the
right version, but I think this is the only way.

Thanks,

Morgan

Morgan.J.Smith@outlook.com writes:

Toggle quote (88 lines)
> From: Morgan Smith <Morgan.J.Smith@outlook.com>
>
> * gnu/packages/emacs.scm (emacs):
> [strip-double-wrap] Modify to work with emacs-next
>
> * gnu/packages/emacs.scm (emacs-next):
> [version] Change version from 28.0.50.1 to 28.0.50
> [arguments] Removed field
> [native-search-paths] New field
> ---
>
> The problem turned out to be that EMACSLOADPATH wasn't being set
> properly. This patch fixes that.
>
>
>
> gnu/packages/emacs.scm | 37 ++++++++++++++++---------------------
> 1 file changed, 16 insertions(+), 21 deletions(-)
>
> diff --git a/gnu/packages/emacs.scm b/gnu/packages/emacs.scm
> index 03c28ee7a7..b3d099257d 100644
> --- a/gnu/packages/emacs.scm
> +++ b/gnu/packages/emacs.scm
> @@ -196,11 +196,12 @@
> (lambda* (#:key outputs #:allow-other-keys)
> ;; Directly copy emacs-X.Y to emacs, so that it is not wrapped
> ;; twice. This also fixes a minor issue, where WMs would not be
> - ;; able to track emacs back to emacs.desktop.
> + ;; able to track emacs back to emacs.desktop. It's done using
> + ;; this-package so emacs-next can reuse it
> (with-directory-excursion (assoc-ref outputs "out")
> (copy-file (string-append
> "bin/emacs-"
> - ,(version-major+minor (package-version emacs)))
> + ,(car (string-split (package-version this-package) #\-)))
> "bin/emacs")
> #t)))
> (add-before 'reset-gzip-timestamps 'make-compressed-files-writable
> @@ -279,11 +280,10 @@ languages.")
>
> (define-public emacs-next
> (let ((commit "2ea34662c20f71d35dd52a5ed996542c7386b9cb")
> - (revision "0")
> - (emacs-version "28.0.50.1"))
> + (revision "0"))
> (package/inherit emacs
> (name "emacs-next")
> - (version (git-version emacs-version revision commit))
> + (version (git-version "28.0.50" revision commit))
> (source
> (origin
> (inherit (package-source emacs))
> @@ -295,24 +295,19 @@ languages.")
> (sha256
> (base32
> "0igjm9kwiswn2dpiy2k9xikbdfc7njs07ry48fqz70anljj8y7y3"))))
> - (arguments
> - (substitute-keyword-arguments (package-arguments emacs)
> - ((#:phases phases)
> - `(modify-phases ,phases
> - (replace 'strip-double-wrap
> - (lambda* (#:key outputs #:allow-other-keys)
> - ;; Directly copy emacs-X.Y to emacs, so that it is not wrapped
> - ;; twice. This also fixes a minor issue, where WMs would not be
> - ;; able to track emacs back to emacs.desktop.
> - (with-directory-excursion (assoc-ref outputs "out")
> - (copy-file (string-append
> - "bin/emacs-"
> - ,(version-major+minor+point (package-version emacs-next)))
> - "bin/emacs")
> - #t)))))))
> (native-inputs
> `(("autoconf" ,autoconf)
> - ,@(package-native-inputs emacs))))))
> + ,@(package-native-inputs emacs)))
> +
> + (native-search-paths
> + (list (search-path-specification
> + (variable "EMACSLOADPATH")
> + ;; The versioned entry is for the Emacs' builtin libraries.
> + (files (list "share/emacs/site-lisp"
> + (string-append "share/emacs/" (car (string-split version #\-)) "/lisp"))))
> + (search-path-specification
> + (variable "INFOPATH")
> + (files '("share/info"))))))))
>
> (define-public emacs-minimal
> ;; This is the version that you should use as an input to packages that just
P
P
Pierre Langlois wrote on 22 Sep 2020 20:35
Re: [PATCH] gnu: emacs-next: Fix load path and version
(address . Morgan.J.Smith@outlook.com)
87pn6dslqh.fsf@gmx.com
Hi Morgan,

Morgan.J.Smith@outlook.com writes:

Toggle quote (14 lines)
> From: Morgan Smith <Morgan.J.Smith@outlook.com>
>
> * gnu/packages/emacs.scm (emacs):
> [strip-double-wrap] Modify to work with emacs-next
>
> * gnu/packages/emacs.scm (emacs-next):
> [version] Change version from 28.0.50.1 to 28.0.50
> [arguments] Removed field
> [native-search-paths] New field
> ---
>
> The problem turned out to be that EMACSLOADPATH wasn't being set
> properly. This patch fixes that.

Nice catch!

This patch looks good to me overall, I'm not a maintainer but I can
review it. See my couple of comments inline.

Toggle quote (23 lines)
>
>
>
> gnu/packages/emacs.scm | 37 ++++++++++++++++---------------------
> 1 file changed, 16 insertions(+), 21 deletions(-)
>
> diff --git a/gnu/packages/emacs.scm b/gnu/packages/emacs.scm
> index 03c28ee7a7..b3d099257d 100644
> --- a/gnu/packages/emacs.scm
> +++ b/gnu/packages/emacs.scm
> @@ -196,11 +196,12 @@
> (lambda* (#:key outputs #:allow-other-keys)
> ;; Directly copy emacs-X.Y to emacs, so that it is not wrapped
> ;; twice. This also fixes a minor issue, where WMs would not be
> - ;; able to track emacs back to emacs.desktop.
> + ;; able to track emacs back to emacs.desktop. It's done using
> + ;; this-package so emacs-next can reuse it
> (with-directory-excursion (assoc-ref outputs "out")
> (copy-file (string-append
> "bin/emacs-"
> - ,(version-major+minor (package-version emacs)))
> + ,(car (string-split (package-version this-package) #\-)))

I agree in general it's good to reuse code, however in this particular
case it's probably better to keep the phases duplicated. For example,
in the future one could update the emacs-next package to not require a
revision number anymore, and it's likely they'd forget to update the
emacs package since it'll still work.

Does that make sense? It might be just a matter of taste, I don't have a
super strong opinion on this.

Toggle quote (48 lines)
> "bin/emacs")
> #t)))
> (add-before 'reset-gzip-timestamps 'make-compressed-files-writable
> @@ -279,11 +280,10 @@ languages.")
>
> (define-public emacs-next
> (let ((commit "2ea34662c20f71d35dd52a5ed996542c7386b9cb")
> - (revision "0")
> - (emacs-version "28.0.50.1"))
> + (revision "0"))
> (package/inherit emacs
> (name "emacs-next")
> - (version (git-version emacs-version revision commit))
> + (version (git-version "28.0.50" revision commit))
> (source
> (origin
> (inherit (package-source emacs))
> @@ -295,24 +295,19 @@ languages.")
> (sha256
> (base32
> "0igjm9kwiswn2dpiy2k9xikbdfc7njs07ry48fqz70anljj8y7y3"))))
> - (arguments
> - (substitute-keyword-arguments (package-arguments emacs)
> - ((#:phases phases)
> - `(modify-phases ,phases
> - (replace 'strip-double-wrap
> - (lambda* (#:key outputs #:allow-other-keys)
> - ;; Directly copy emacs-X.Y to emacs, so that it is not wrapped
> - ;; twice. This also fixes a minor issue, where WMs would not be
> - ;; able to track emacs back to emacs.desktop.
> - (with-directory-excursion (assoc-ref outputs "out")
> - (copy-file (string-append
> - "bin/emacs-"
> - ,(version-major+minor+point (package-version emacs-next)))
> - "bin/emacs")
> - #t)))))))
> (native-inputs
> `(("autoconf" ,autoconf)
> - ,@(package-native-inputs emacs))))))
> + ,@(package-native-inputs emacs)))
> +
> + (native-search-paths
> + (list (search-path-specification
> + (variable "EMACSLOADPATH")
> + ;; The versioned entry is for the Emacs' builtin libraries.
> + (files (list "share/emacs/site-lisp"
> + (string-append "share/emacs/" (car (string-split version #\-)) "/lisp"))))

nit: This line seems to be a bit long.

Toggle quote (8 lines)
> + (search-path-specification
> + (variable "INFOPATH")
> + (files '("share/info"))))))))
>
> (define-public emacs-minimal
> ;; This is the version that you should use as an input to packages that just


Thanks!
Pierre
-----BEGIN PGP SIGNATURE-----

iQFMBAEBCgA2FiEEctU9gYy29KFyWDdMqPyeRH9PfVQFAl9qQ/YYHHBpZXJyZS5s
YW5nbG9pc0BnbXguY29tAAoJEKj8nkR/T31U+gcH/ikCn2wAUofFWcqccYuY8YqG
uVZmRHM9L8iwgt+YBafje3RWhynBnMEK7J3InXfIZzNNsPDqtHh69yVjUjVJvEVO
PHs16evScizEnsPZfY5ipsZ5QhjHKDLg9KglWhcEHbcfNQQiSD3w3j7ORPFSEKaI
xFIJrSQpESJcn69QMtl2QM3KSF4zTvPeOgfXCLOWH7AOayDoguI7p6uI0YvWFczU
dUvViLY7+cNZhC5R++ObGl/ZpKjC/WE+LH1F8EHQddIPdaN9hJ1qOtytvCSYhQ7T
Vp8Am83u3/8tLOJlFx8oURDpbv9xoKVbCApQEaHRPAxy98m6y6Uk7MLLVz8iI9I=
=6wHs
-----END PGP SIGNATURE-----

M
M
Morgan Smith wrote on 26 Sep 2020 14:08
[PATCH] gnu: emacs-next: Fix load path and version
(name . Pierre Langlois)(address . pierre.langlois@gmx.com)
DM5PR1001MB2105B9477369BA5566500E7CC5370@DM5PR1001MB2105.namprd10.prod.outlook.com
Hi Pierre,

Thanks for the feedback!

Pierre Langlois <pierre.langlois@gmx.com> writes:

Toggle quote (9 lines)
> I agree in general it's good to reuse code, however in this particular
> case it's probably better to keep the phases duplicated. For example,
> in the future one could update the emacs-next package to not require a
> revision number anymore, and it's likely they'd forget to update the
> emacs package since it'll still work.
>
> Does that make sense? It might be just a matter of taste, I don't have a
> super strong opinion on this.

It's important to realize that this is what caused the current problem
to begin with so in a way I agree. However, I think there is a big
difference between code that fails silently, and code that fails
loudly. The native search paths failed "silently" since the package
still built and even appeared to work (since the normal emacs with in my
path). copy-file, thankfully, fails very loudly since the package simply
won't build if it can't find the file to move. Plus the error message is
quite good (It can't find the file). For this reason, it's likely a good
thing that the native search paths code is duplicated, but I think the
stip-double-wrap phase should be reused.

Thanks,

Morgan
L
L
Ludovic Courtès wrote on 1 Oct 2020 14:37
control message for bug #43277
(address . control@debbugs.gnu.org)
87v9furuk6.fsf@gnu.org
severity 43277 important
quit
M
M
Maxim Cournoyer wrote on 1 Oct 2020 17:05
Re: bug#43277: [PATCH] gnu: emacs-next: Fix load path and version
(name . Pierre Langlois)(address . pierre.langlois@gmx.com)
87sgaynfzp.fsf@gmail.com
Hello!

[...]

Toggle quote (26 lines)
>> gnu/packages/emacs.scm | 37 ++++++++++++++++---------------------
>> 1 file changed, 16 insertions(+), 21 deletions(-)
>>
>> diff --git a/gnu/packages/emacs.scm b/gnu/packages/emacs.scm
>> index 03c28ee7a7..b3d099257d 100644
>> --- a/gnu/packages/emacs.scm
>> +++ b/gnu/packages/emacs.scm
>> @@ -196,11 +196,12 @@
>> (lambda* (#:key outputs #:allow-other-keys)
>> ;; Directly copy emacs-X.Y to emacs, so that it is not wrapped
>> ;; twice. This also fixes a minor issue, where WMs would not be
>> - ;; able to track emacs back to emacs.desktop.
>> + ;; able to track emacs back to emacs.desktop. It's done using
>> + ;; this-package so emacs-next can reuse it
>> (with-directory-excursion (assoc-ref outputs "out")
>> (copy-file (string-append
>> "bin/emacs-"
>> - ,(version-major+minor (package-version emacs)))
>> + ,(car (string-split (package-version this-package) #\-)))
>
> I agree in general it's good to reuse code, however in this particular
> case it's probably better to keep the phases duplicated. For example,
> in the future one could update the emacs-next package to not require a
> revision number anymore, and it's likely they'd forget to update the
> emacs package since it'll still work.

It's unlikely the emacs-next package would be pegged against a stable
version, but in the event it would, the above code would still work.

[...]

Toggle quote (13 lines)
>> `(("autoconf" ,autoconf)
>> - ,@(package-native-inputs emacs))))))
>> + ,@(package-native-inputs emacs)))
>> +
>> + (native-search-paths
>> + (list (search-path-specification
>> + (variable "EMACSLOADPATH")
>> + ;; The versioned entry is for the Emacs' builtin libraries.
>> + (files (list "share/emacs/site-lisp"
>> + (string-append "share/emacs/" (car (string-split version #\-)) "/lisp"))))
>
> nit: This line seems to be a bit long.

Reformatted, and edited the commit message to match our standards.

I made minor, cosmetic changes like below:

modified gnu/packages/emacs.scm
@@ -196,12 +196,16 @@
(lambda* (#:key outputs #:allow-other-keys)
;; Directly copy emacs-X.Y to emacs, so that it is not wrapped
;; twice. This also fixes a minor issue, where WMs would not be
- ;; able to track emacs back to emacs.desktop. It's done using
- ;; this-package so emacs-next can reuse it
+ ;; able to track emacs back to emacs.desktop. The version is
+ ;; accessed using using THIS-PACKAGE so it "just works" for
+ ;; inherited Emacs packages of different versions.
(with-directory-excursion (assoc-ref outputs "out")
(copy-file (string-append
"bin/emacs-"
- ,(car (string-split (package-version this-package) #\-)))
+ ,(let ((this-version (package-version this-package)))
+ (or (false-if-exception
+ (version-major+minor+point this-version))
+ (version-major+minor this-version))))
"bin/emacs")
#t)))
(add-before 'reset-gzip-timestamps 'make-compressed-files-writable
@@ -304,7 +308,9 @@ languages.")
(variable "EMACSLOADPATH")
;; The versioned entry is for the Emacs' builtin libraries.
(files (list "share/emacs/site-lisp"
- (string-append "share/emacs/" (car (string-split version #\-)) "/lisp"))))
+ (string-append "share/emacs/"
+ (version-major+minor+point version)
+ "/lisp"))))
(search-path-specification
(variable "INFOPATH")
(files '("share/info"))))))))

Verified it produced a correct EMACSLOADPATH and ran using:

Toggle snippet (9 lines)
$ guix environment --pure --ad-hoc emacs-next
[...]
[env]$ echo $EMACSLOADPATH
/gnu/store/6s7p3yi969pm2xmkdd45dljbnwy5107g-profile/share/emacs/site-lisp:/gnu/store/6s7p3yi969pm2xmkdd45dljbnwy5107g-profile/share/emacs/28.0.50/

[env]$ emacs --version
GNU Emacs 28.0.50

And pushed to master as commit 0f88fea0eaa.

Thanks everyone!

Closing,

Maxim
Closed
?