Subject: [PATCH emacs-team 2/5] gnu: Add emacs-next.

From: Liliana Marie Prikler <[email-masked]>
Date: Sat, 9 Sep 2023 16:29:07 +0200

* gnu/packages/emacs.scm (emacs->emacs-next, emacs-next): New variable.
---
 gnu/packages/emacs.scm | 18 +++++++++++++++++-
 1 file changed, 17 insertions(+), 1 deletion(-)

diff --git a/gnu/packages/emacs.scm b/gnu/packages/emacs.scm
index 469c5e36f2..1be58bd5c1 100644
--- a/gnu/packages/emacs.scm
+++ b/gnu/packages/emacs.scm
@@ -86,7 +86,8 @@ (define-module (gnu packages emacs)
   #:use-module (gnu packages xorg)
   #:use-module (guix utils)
   #:use-module (ice-9 match)
-  #:use-module (srfi srfi-1))
+  #:use-module (srfi srfi-1)
+  #:export (emacs->emacs-next))
 
 (define (%emacs-modules build-system)
   (let ((which (build-system-name build-system)))
@@ -499,6 +500,21 @@ (define-public emacs-next-minimal
        (sha256
         (base32 "00mwpq1msr3jij281w5piqmbwq968xr8dn9hqbf4r947ck754kn9")))))))
 
+(define* (emacs->emacs-next emacs #:optional name
+                            #:key (version (package-version emacs-next-minimal))
+                            (source (package-source emacs-next-minimal)))
+  (package
+    (inherit emacs)
+    (name (or name
+              (and (string-prefix? "emacs" (package-name emacs))
+                   (string-append "emacs-next"
+                                  (string-drop (package-name emacs)
+                                               (string-length "emacs"))))))
+    (version version)
+    (source source)))
+
+(define-public emacs-next (emacs->emacs-next emacs))
+
 (define-public guile-emacs
   (let ((commit "41120e0f595b16387eebfbf731fff70481de1b4b")
         (revision "0"))
-- 
2.41.0