Subject: [bug#38662] [PATCH] gnu: Add emacs-next.

From: Valentin Ignatev <[email-masked]>
Date: Thu, 19 Dec 2019 16:38:58 +0300

Thanks a lot for submitting the patch, I'm eager to see emacs-next in
upstream!
However, there is a potential issue with it. Original emacs package that we
inherit here sets EMACSLOADPATH with two values, one of which is some
directory path combined with the version:
https://git.savannah.gnu.org/cgit/guix.git/tree/gnu/packages/emacs.scm?h=master#n196

Every Emacs version creates a dir along the lines of
.gix-profile/share/emacs/version/lisp. Current emacs from master hardcodes
this version to 27.0.50, so this path becomes
.gix-profile/share/emacs/27.0.50/lisp. But since we set version based on
commit in this submitted patch, EMACSLOADPATH becomes invalid and this
specific directory doesn't end up in the guix-profile/etc/profile script,
so when you run emacs, you get multiple errors because Emacs can't load
builtin packages. I think that hardcoding a version of emacs-next to
"27.0.50" should work well. I'm attaching a patch that can be applied to
Amin's emacs-next patch.

Regards,
Valentin
Hardcode version in `emacs-next', use commit in `file-name'

* gnu/packages/emacs.scm (emacs-next):
Hardcode version to be 27.0.50.
Change file-name to use commit instead of version to avoid checkout collisions.

diff --git a/gnu/packages/emacs.scm b/gnu/packages/emacs.scm
index 102754deed..86795ba046 100644
--- a/gnu/packages/emacs.scm
+++ b/gnu/packages/emacs.scm
@@ -221,7 +221,7 @@ languages.")
     (package
       (inherit emacs)
       (name "emacs-next")
-      (version (git-version "27" revision commit))
+      (version "27.0.50")
       (source
        (origin
          (method git-fetch)
@@ -229,7 +229,7 @@ languages.")
                (url "https://git.savannah.gnu.org/git/emacs.git")
                (commit commit)))
          (sha256 (base32 "0niamywp3cq05hqc7k693c3d12jbqbzbfgl4aza9dja0jidv4b80"))
-         (file-name (git-file-name name version))
+         (file-name (git-file-name name commit))
          (patches (search-patches "emacs27-exec-path.patch"
                                   "emacs-fix-scheme-indent-function.patch"
                                   "emacs-source-date-epoch.patch"))