Subject: [bug#77185] [PATCH v4] gnu: Add emacs-bqn-mode.

From: Cayetano Santos <[email-masked]>
Date: Tue, 25 Mar 2025 09:10:34 +0100

From: Lee Thompson <[email-masked]>

* gnu/packages/emacs-xyz.scm (emacs-bqn-mode): New variable.

Change-Id: Ibe9a32c4f8414dbc5d3bb350aa684a8f3e15c567
---

Upstream project uses dates as releases, and guix privilege releases, so no need to use revisions.

 gnu/packages/emacs-xyz.scm | 96 ++++++++++++++++++++++++++++----------
 1 file changed, 71 insertions(+), 25 deletions(-)

diff --git a/gnu/packages/emacs-xyz.scm b/gnu/packages/emacs-xyz.scm
index f00c5e4b29..b73b6666c0 100644
--- a/gnu/packages/emacs-xyz.scm
+++ b/gnu/packages/emacs-xyz.scm
@@ -155,6 +155,7 @@
 ;;; Copyright © 2025 Remco van 't Veer <[email-masked]>
 ;;; Copyright © 2025 Skylar Hill <[email-masked]>
 ;;; Copyright © 2025 Cayetano Santos <[email-masked]>
+;;; Copyright © 2025 Lee Thompson <[email-masked]>
 ;;;
 ;;; This file is part of GNU Guix.
 ;;;
@@ -487,6 +488,51 @@ (define-public emacs-bookmark-plus
 reading the extensive documentation about BookmarkPlus on the Emacs Wiki.")
     (license license:gpl3+)))
 
+(define-public emacs-bqn-mode
+  (package
+    (name "emacs-bqn-mode")
+    ;; upstream releases are tagged by date
+    (version "2024-09-10")
+    (source
+     (origin
+       (method git-fetch)
+       (uri (git-reference
+             (url "https://github.com/museoa/bqn-mode/")
+             (commit version)))
+       (file-name (git-file-name name version))
+       (sha256
+        (base32 "0a4whlx8065c15nfyqy8176mwysnc13z4q7mmdfnf6skdnvi2pk6"))))
+    (build-system emacs-build-system)
+    (arguments
+     (list
+      #:tests? #f ;No tests found in source
+      #:phases
+      #~(modify-phases %standard-phases
+          ;; `bqn-comint-bring' in `bqn-mode.el' uses the macro
+          ;; `thread-last', defined in `subr-x.el' but not autoloaded.
+          ;; `emacs-build-system' will happily byte-compile `bqn-mode.el'
+          ;; but interactively calling `bqn-comint-bring' will cause an
+          ;; error.  An explicit call to `(require 'subr-x)' remedies the
+          ;; issue until it is fixed upstream.
+          (add-after 'unpack 'require-subr-x
+            (lambda _
+              (emacs-batch-edit-file "bqn-mode.el"
+                                     '(progn (goto-char (point-min))
+                                             (re-search-forward
+                                              "(require 'pulse)")
+                                             (forward-line)
+                                             (insert "(require 'subr-x)\n")
+                                             (basic-save-buffer))))))))
+    (propagated-inputs (list emacs-compat))
+    (synopsis "Emacs major mode for the BQN programming language")
+    (description
+     "This package provides a major mode for editing and executing BQN code.
+It can be used to interactively evaluate BQN code in buffer or can be used to
+launch BQN REPL sessions.  For evaluating BQN code or spawning interpreters an
+executable implementation is required such as @code{cbqn} or @code{dbqn}.")
+    (home-page "https://github.com/museoa/bqn-mode/")
+    (license license:gpl3)))
+
 (define-public emacs-cfrs
   (package
     (name "emacs-cfrs")
@@ -3142,13 +3188,13 @@ (define-public emacs-fb2-reader
       (version "0.1.1")
       (source
        (origin
-	 (method git-fetch)
-	 (uri (git-reference
-	       (url "https://github.com/jumper047/fb2-reader")
-	       (commit commit)))
-	 (file-name (git-file-name name version))
-	 (sha256
-	  (base32 "0vx4b9wnmx1bng8wak5r7yryyvgib4m46l6b877xzkdhsjr3rbsi"))))
+         (method git-fetch)
+         (uri (git-reference
+               (url "https://github.com/jumper047/fb2-reader")
+               (commit commit)))
+         (file-name (git-file-name name version))
+         (sha256
+          (base32 "0vx4b9wnmx1bng8wak5r7yryyvgib4m46l6b877xzkdhsjr3rbsi"))))
       (build-system emacs-build-system)
       (arguments
        (list
@@ -26583,19 +26629,19 @@ (define-public emacs-pulseaudio-control
 
 (define-public emacs-smudge
   (let ((commit "4a9c5b34e9bc0a694d0faf8c2f83dc244b8b6a2f")
-	(revision "1"))
+        (revision "1"))
     (package
       (name "emacs-smudge")
       (version (git-version "1.0.0" revision commit))
       (source (origin
-	        (method git-fetch)
-	        (uri (git-reference
-		      (url "https://github.com/danielfm/smudge")
-		      (commit commit)))
-	        (file-name (git-file-name name version))
-	        (sha256
-	         (base32
-		  "1xiqxw87sdk9mgy7fdbmzqaf58dc1grhkigirg1bd0b2q5kbnbwx"))))
+                (method git-fetch)
+                (uri (git-reference
+                      (url "https://github.com/danielfm/smudge")
+                      (commit commit)))
+                (file-name (git-file-name name version))
+                (sha256
+                 (base32
+                  "1xiqxw87sdk9mgy7fdbmzqaf58dc1grhkigirg1bd0b2q5kbnbwx"))))
       (build-system emacs-build-system)
       (propagated-inputs (list emacs-oauth2 emacs-request emacs-simple-httpd))
       (home-page "https://github.com/danielfm/smudge")
@@ -37239,7 +37285,7 @@ (define-public emacs-ssh-deploy
        (uri (string-append "https://elpa.gnu.org/packages/ssh-deploy-" version
                            ".tar"))
        (sha256
-	(base32 "0fb88l3270d7l808q8x16zcvjgsjbyhgifgv17syfsj0ja63x28p"))))
+        (base32 "0fb88l3270d7l808q8x16zcvjgsjbyhgifgv17syfsj0ja63x28p"))))
     (build-system emacs-build-system)
     (home-page "https://github.com/cjohansson/emacs-ssh-deploy")
     (synopsis "Deployment via Tramp, global or per directory")
@@ -43112,19 +43158,19 @@ (define-public emacs-window-tool-bar
 
 (define-public emacs-tintin-mode
   (let ((commit "82e71e1db92ee3d94c7d0208bafc5de337193de8")
-	(revision "1"))
+        (revision "1"))
     (package
       (name "emacs-tintin-mode")
       (version (git-version "1.0.1" revision commit))
       (source
        (origin
-	 (method git-fetch)
-	 (uri (git-reference
-	       (url "https://github.com/sunwayforever/tintin-mode")
-	       (commit commit)))
-	 (file-name (git-file-name name version))
-	 (sha256
-	  (base32 "1p6ryqb8m30cp0zyawb6bs8wy3ga7gm60lcan0xx1fy3wx8qip33"))))
+         (method git-fetch)
+         (uri (git-reference
+               (url "https://github.com/sunwayforever/tintin-mode")
+               (commit commit)))
+         (file-name (git-file-name name version))
+         (sha256
+          (base32 "1p6ryqb8m30cp0zyawb6bs8wy3ga7gm60lcan0xx1fy3wx8qip33"))))
       (build-system emacs-build-system)
       (home-page "https://github.com/sunwayforever/tintin-mode")
       (synopsis "Emacs major mode for TinTin++ scripts")

base-commit: ce086e31f0f5c78be76fd228dfd7718ff6df584e
--
2.49.0