Subject: [bug#73281] [PATCH] gnu: emacs: add emacs-nextnext and related packages.

From: Brennan Vincent <[email-masked]>
Date: Sun, 15 Sep 2024 16:01:56 -0400

emacs-30 has been branched, and upstream git master is now version 31. Add
this for those who want to test the bleeding-edge version.

We keep emacs-next for emacs-30, since it is still not released. Thus,
the new naming scheme is "emacs-nextnext".

* gnu/packages/emacs.scm (emacs-nextnext): new variable.
  (emacs-nextnext-pgtk): new variable.
  (emacs-nextnext-pgtk-xwidgets): new variable.

Change-Id: I42abca804e8595c90092adbfd9605b38527ffe40
---

Suggestions for a better naming scheme than "nextnext" are welcome,
should anyone have one.

 gnu/packages/emacs.scm | 35 +++++++++++++++++++++++++++++++++++
 1 file changed, 35 insertions(+)

diff --git a/gnu/packages/emacs.scm b/gnu/packages/emacs.scm
index 3ce01f1a24..8448e2778a 100644
--- a/gnu/packages/emacs.scm
+++ b/gnu/packages/emacs.scm
@@ -588,6 +588,28 @@ (define-public emacs-next-minimal
                         "emacs-next-native-comp-driver-options.patch"
                         "emacs-pgtk-super-key-fix.patch")))))))
 
+(define-public emacs-nextnext-minimal
+  (let ((commit "f27553c30a772a0103d2e6762e4d7f588f302e4b")
+        (revision "1"))
+   (package
+    (inherit emacs-minimal)
+    (name "emacs-nextnext-minimal")
+    (version (git-version "31.0.50" revision commit))
+    (source
+     (origin
+       (method git-fetch)
+       (uri (git-reference
+             (url "https://git.savannah.gnu.org/git/emacs.git")
+             (commit commit)))
+       (file-name (git-file-name name version))
+       (sha256
+        (base32 "0s9mh6pz3lp4cjh2j0vn5fy2ihphqhvgx7ac4idikj66k4y98w2c"))
+       (patches
+        (search-patches "emacs-next-exec-path.patch"
+                        "emacs-fix-scheme-indent-function.patch"
+                        "emacs-next-native-comp-driver-options.patch"
+                        "emacs-pgtk-super-key-fix.patch")))))))
+
 (define* (emacs->emacs-next emacs #:optional name
                             #:key (version (package-version emacs-next-minimal))
                             (source (package-source emacs-next-minimal)))
@@ -628,6 +650,19 @@ (define-public emacs-next-pgtk-xwidgets (emacs->emacs-next emacs-pgtk-xwidgets))
 (define-public emacs-next-tree-sitter
   (deprecated-package "emacs-next-tree-sitter" emacs-next))
 
+(define (emacs->emacs-nextnext emacs)
+  (emacs->emacs-next emacs
+                     (and (string-prefix? "emacs" (package-name emacs))
+                          (string-append "emacs-nextnext"
+                                         (string-drop (package-name emacs)
+                                                      (string-length "emacs"))))
+                     #:version (package-version emacs-nextnext-minimal)
+                     #:source (package-source emacs-nextnext-minimal)))
+
+(define-public emacs-nextnext (emacs->emacs-nextnext emacs))
+(define-public emacs-nextnext-pgtk (emacs->emacs-nextnext emacs-pgtk))
+(define-public emacs-nextnext-pgtk-xwidgets (emacs->emacs-nextnext emacs-pgtk-xwidgets))
+
 (define-public guile-emacs
   (let ((commit "41120e0f595b16387eebfbf731fff70481de1b4b")
         (revision "0"))
-- 
2.45.2