Message ID | 20250322162557.9873-2-lee.p.thomp@gmail.com |
---|---|
State | New |
Headers |
Return-Path: <guix-patches-bounces+patchwork=mira.cbaines.net@gnu.org> X-Original-To: patchwork@mira.cbaines.net Delivered-To: patchwork@mira.cbaines.net Received: by mira.cbaines.net (Postfix, from userid 113) id 1469227BBEA; Sat, 22 Mar 2025 16:27:29 +0000 (GMT) X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on mira.cbaines.net X-Spam-Level: X-Spam-Status: No, score=-6.6 required=5.0 tests=BAYES_00,DKIM_ADSP_CUSTOM_MED, DKIM_SIGNED,DKIM_VALID,FREEMAIL_FROM,MAILING_LIST_MULTI, RCVD_IN_DNSWL_BLOCKED,RCVD_IN_VALIDITY_CERTIFIED,RCVD_IN_VALIDITY_RPBL, RCVD_IN_VALIDITY_SAFE,SPF_HELO_PASS,URIBL_BLOCKED autolearn=ham autolearn_force=no version=3.4.6 Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mira.cbaines.net (Postfix) with ESMTPS id 7E16E27BBE2 for <patchwork@mira.cbaines.net>; Sat, 22 Mar 2025 16:27:28 +0000 (GMT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from <guix-patches-bounces@gnu.org>) id 1tw1gf-0006ga-6g; Sat, 22 Mar 2025 12:27:05 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from <Debian-debbugs@debbugs.gnu.org>) id 1tw1gd-0006gH-7V for guix-patches@gnu.org; Sat, 22 Mar 2025 12:27:03 -0400 Received: from debbugs.gnu.org ([2001:470:142:5::43]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from <Debian-debbugs@debbugs.gnu.org>) id 1tw1gc-00050k-V0 for guix-patches@gnu.org; Sat, 22 Mar 2025 12:27:02 -0400 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=debbugs.gnu.org; s=debbugs-gnu-org; h=MIME-Version:Date:From:To:Subject; bh=Ertm6r2TOdc+wHPshBYV0l5uNTSJ2YGiB/4qx/RcnbE=; b=QStGSJYpM0jPGS5gszZ7EE8rYjGmZyZ0A0PXdYEIA+Gx16yuYrAQJbw0c6l1zWAOk95hIP1i7h160VFvHZNtTtEW20g1bdiVXfcmTbpoCNiTmMBBnbnNSzmlX1vYja2fn/UGqIaLNfhElaiMPnGDzi1XXdye1ef7Awubuqa+0kVrAyVuip7ZF15Y6AcfoaCrjwt84XZsthLrZ434GMM3EUXLUa96KmkxrDCL1/7IXjM5rWyBfHjUB6tjPUZv5gJ/kwpDjR6B8RAgayDtFHZusuxchpa4WlNbo5oFXebGt5B5t9G7Eq/xYk1E53RjNgwyWtrhViAm45f/yzlFZwfthg==; Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from <Debian-debbugs@debbugs.gnu.org>) id 1tw1gc-0004pn-PS for guix-patches@gnu.org; Sat, 22 Mar 2025 12:27:02 -0400 X-Loop: help-debbugs@gnu.org Subject: [bug#77185] [PATCH] gnu: Add emacs-bqn-mode Resent-From: Lee Thompson <lee.p.thomp@gmail.com> Original-Sender: "Debbugs-submit" <debbugs-submit-bounces@debbugs.gnu.org> Resent-CC: guix-patches@gnu.org Resent-Date: Sat, 22 Mar 2025 16:27:02 +0000 Resent-Message-ID: <handler.77185.B.174266079718541@debbugs.gnu.org> Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: report 77185 X-GNU-PR-Package: guix-patches X-GNU-PR-Keywords: patch To: 77185@debbugs.gnu.org Cc: Lee Thompson <lee.p.thomp@gmail.com> X-Debbugs-Original-To: guix-patches@gnu.org Received: via spool by submit@debbugs.gnu.org id=B.174266079718541 (code B ref -1); Sat, 22 Mar 2025 16:27:02 +0000 Received: (at submit) by debbugs.gnu.org; 22 Mar 2025 16:26:37 +0000 Received: from localhost ([127.0.0.1]:44900 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from <debbugs-submit-bounces@debbugs.gnu.org>) id 1tw1gD-0004oy-3G for submit@debbugs.gnu.org; Sat, 22 Mar 2025 12:26:37 -0400 Received: from lists.gnu.org ([2001:470:142::17]:41124) by debbugs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.84_2) (envelope-from <lee.p.thomp@gmail.com>) id 1tw1gA-0004of-CZ for submit@debbugs.gnu.org; Sat, 22 Mar 2025 12:26:34 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from <lee.p.thomp@gmail.com>) id 1tw1g2-0006Wt-98 for guix-patches@gnu.org; Sat, 22 Mar 2025 12:26:27 -0400 Received: from mail-wm1-x335.google.com ([2a00:1450:4864:20::335]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from <lee.p.thomp@gmail.com>) id 1tw1g0-0004so-Gu for guix-patches@gnu.org; Sat, 22 Mar 2025 12:26:25 -0400 Received: by mail-wm1-x335.google.com with SMTP id 5b1f17b1804b1-43cf58eea0fso16103365e9.0 for <guix-patches@gnu.org>; Sat, 22 Mar 2025 09:26:23 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1742660782; x=1743265582; darn=gnu.org; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:from:to:cc:subject:date:message-id:reply-to; bh=Ertm6r2TOdc+wHPshBYV0l5uNTSJ2YGiB/4qx/RcnbE=; b=hsvkpcXyfmgytDfl19nk6vivzRSpvPIkz8lpYbsFqT2U5ngjMaSNfYj0+GiAi7Vw8E 1udgQTxor3RWzSxBi54Ur7B+BX8JAsMNX1QJq1X53cLvE6iTxwdFOiANxanqG1GsXzG0 TSajp65sr1jq7aoHelM6qI8dLsnYk37RpSrMgfp60tJ/K9ibNJpnFm+ClTlivkmE0k31 q6h48et+O91rHtHG7GAetQrM7ZVFiE8hnchPmUHWQv0w080IcneoeAKJomOkvG2RtSm/ JyAE4TDVs5refHE7hQWC9/mDHs1ga22oNVnnYrBU2SRMVfnGaRckvThYXN9XnwevKBXR w4Iw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1742660782; x=1743265582; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=Ertm6r2TOdc+wHPshBYV0l5uNTSJ2YGiB/4qx/RcnbE=; b=O6nP2Tm/lD80vNnTPvdtewfG+iITXiVILU2YpvAUI1ZjgPu4oS9B363KqC1c6QWcP2 yHeBP5V0VJBk46KZLxUJAKY2sZX2fujTgrlBOnZI7q0k8Ed9YLoCDssKq9S25Lfy+oA7 SX4GTSAgJgDad27LUf9a8NNhn7aaCvRm3AcBizlwWG73wC8YnE4npaX4TjFxGke1PTAA KBxKBOKorqF9p8YkKpQ9wCO/ZWiVsJ1Nqrh2uE27BagqxKN9dbAyKn7m71aJmz4drhqG zX2cjDs+YIKycHHaxsL+YhPDlge1a0jlXQC17XaKZyboPANuxK8s5BrnBEflrdnRCAgR MThg== X-Gm-Message-State: AOJu0Yya0TM9wHcEmAQlciGeNiY/jEdZ2XVjVYUKKJU38SHFJ0Jsoeyl w9y07dcTtJXepkVj1QT+BIftcebh1vBSORhKKkaQn3w+QGDwfovn1oQzRzIO X-Gm-Gg: ASbGncuGFb7usnURQgRjoX3LQaiuZ5gLAC9wcQcmDbp7aupDGTzO9r/LzcTx4K0iUpS zT5SkU0iOPC2/2DY3d2wuDuV0/9s6MPJgtC7ieRovUlDEs/AoY2g81BM0c5/YsWtVMjHuUT2cxy 5ZIZIL6K1i2b67tRGdAN7FqP1pDkZ5G93mXktS6vPWy0ppJtIDbRd7cCymwYVYHQnW/JZocb9GV 4ws67Wtl+j8dy3gI4PnmHNmS32XSufVaI/qkY10pGJCqv2/DRk6N4SErs+BLgRGJdXpieJXlS03 /nJ7TtW232ZIHbo2zl9mJWAUYRHeBKIceK74z41GeuwFeM3ecRM+ X-Google-Smtp-Source: AGHT+IEyh14P0tuncdbJO3k6MDQr24hCfx4bRmxLFHrFay030r1J668OVxgtTHpxlVdBbCOWiuNCPw== X-Received: by 2002:a05:6000:156e:b0:391:2b04:73d9 with SMTP id ffacd0b85a97d-3997f93d5d4mr6004130f8f.49.1742660782197; Sat, 22 Mar 2025 09:26:22 -0700 (PDT) Received: from theodora.Home ([2a02:c7c:c11b:7600:7aae:703b:7fec:dcc5]) by smtp.gmail.com with ESMTPSA id 5b1f17b1804b1-43d43f32fb3sm111888905e9.2.2025.03.22.09.26.21 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 22 Mar 2025 09:26:21 -0700 (PDT) From: Lee Thompson <lee.p.thomp@gmail.com> Date: Sat, 22 Mar 2025 16:25:38 +0000 Message-ID: <20250322162557.9873-2-lee.p.thomp@gmail.com> X-Mailer: git-send-email 2.48.1 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Received-SPF: pass client-ip=2a00:1450:4864:20::335; envelope-from=lee.p.thomp@gmail.com; helo=mail-wm1-x335.google.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, FREEMAIL_FROM=0.001, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-BeenThere: guix-patches@gnu.org List-Id: <guix-patches.gnu.org> List-Unsubscribe: <https://lists.gnu.org/mailman/options/guix-patches>, <mailto:guix-patches-request@gnu.org?subject=unsubscribe> List-Archive: <https://lists.gnu.org/archive/html/guix-patches> List-Post: <mailto:guix-patches@gnu.org> List-Help: <mailto:guix-patches-request@gnu.org?subject=help> List-Subscribe: <https://lists.gnu.org/mailman/listinfo/guix-patches>, <mailto:guix-patches-request@gnu.org?subject=subscribe> Errors-To: guix-patches-bounces+patchwork=mira.cbaines.net@gnu.org Sender: guix-patches-bounces+patchwork=mira.cbaines.net@gnu.org X-getmail-retrieved-from-mailbox: Patches |
Series |
[bug#77185] gnu: Add emacs-bqn-mode
|
|
Commit Message
Lee Thompson
March 22, 2025, 4:25 p.m. UTC
* gnu/packages/emacs-xyz.scm (emacs-bqn-mode): New variable Change-Id: Ibe9a32c4f8414dbc5d3bb350aa684a8f3e15c567 --- gnu/packages/emacs-xyz.scm | 40 ++++++++++++++++++++++++++++++++++++++ 1 file changed, 40 insertions(+)
Comments
Hey all reviewing this, I've only just realised I've forgotten to add my name to the copyright list at the top of the file (assuming what I've read is correct I can just bundle it with my patch to add the package right?). I only read in the manual about adding this in after I sent my last patch for emacs-parinfer-rust-mode, and I've been kicking myself since for missing it. Should I send in a revised patch or is it trivial enough for a maintainer to take care of before merging the existing patch in?
Thanks for the patch ! You may send an updated version, including the copyright. A few comments: - emacs-eros 0.1.0 seems necessary as propagated input (we have 0.0.1-2.dd89102 in the repos) - you may drop the .git in url - why do you need to (require 'subr-x) ? this is not a decision of package maintainers ? - `guix lint emacs-bqn-mode' uses release "2024-09-10" as version, not 0.1.0, maybe it is better to use it so that `guix refresh' will warn about future updates
Hi, Thanks for the reply and feedback. I'll get on with tidying up my patch, but I think there may have been a misunderstanding: > - emacs-eros 0.1.0 seems necessary as propagated input (we have > 0.0.1-2.dd89102 in the repos) So I decided to work at packaging the '2024-09-10' tag from the upstream project instead of the latest commit on the trunk or develop branch. It looks like the commit adding 'Package-Requires: ... (eros "0.1.0")' came just after the one tagged '2024-09-10', so I didn't think it was necessary to add it as a propagated input. As a sidenote I did successfully package it with an updated emacs-eros before I realised I was on 'trunk' and not a release/tag, so if you really want I could send in a revised patch with bqn-mode on the latest commit with an updated eros > - why do you need to (require 'subr-x) ? this is not a decision of > package maintainers ? Without explicitly requiring it I was unable to run `bqn-comint-bring' in the mode to open an interpreter. I eventually tracked this down to Emacs being totally confused about the macro `thread-last' within `bqn-comint-bring', which is defined in `subr-x.el' but isn't autoloaded. This does give me an idea to open a PR upstream, but that wouldn't solve it for the 2024-09-10 tag of course. For a comparable situation have a look at `emacs-tree-inspector', where something similar is performed. I thought calling Emacs batch mode to edit was neater. I think I should have put in a short comment explaining, my apologies. After some searching around it looks to be something to do with the way Guix's build system byte-compiles the Emacs files —I'm not really sure to be totally honest. > - `guix lint emacs-bqn-mode' uses release "2024-09-10" as version, not > 0.1.0, maybe it is better to use it so that `guix refresh' will warn > about future updates Okay I see what you mean about this, until now I'd been running `./pre-inst-env guix lint emacs-bqn-mode' within a Guix shell container which of course hits some issues. Running it in a plain shell mentions upgrading to 2024-09-10. I'd followed some other examples in `emacs-xyz.scm' where it looked like the tagged name didn't match with the `Version: ' line within the main Emacs Lisp source. See 'emacs-everywhere' for an example. What I hadn't thought about was that in this case there's a tag to work with for version. Before I send in a revised patch, do you mean something like this would work: > (define-public emacs-bqn-mode > (let ((tag "2024-09-10")) > (package > (name "emacs-bqn-mode") > (version tag) > (source > (origin > (method git-fetch) > (uri (git-reference > (url "https://github.com/museoa/bqn-mode") > (commit tag))) > (file-name (git-file-name name version)) > ... ? Again appreciate the feedback and advice, looking forward to hearing back from you soon.
>dim. 23 mars 2025 at 13:09, Lee Thompson <lee.p.thomp@gmail.com> wrote: >> - emacs-eros 0.1.0 seems necessary as propagated input (we have >> 0.0.1-2.dd89102 in the repos) > So I decided to work at packaging the '2024-09-10' tag from the upstream > project instead of the latest commit on the trunk or develop branch. > It looks like the commit adding 'Package-Requires: ... (eros "0.1.0")' > came just after the one tagged '2024-09-10', so I didn't think it was > necessary to add it as a propagated input. You’re right, no need of eros by now. > As a sidenote I did successfully package it with an updated emacs-eros > before I realised I was on 'trunk' and not a release/tag, so if you > really want I could send in a revised patch with bqn-mode on the latest > commit with an updated eros Better send a dedicated patch with it, now that you have it. It will be useful for next update. >> - why do you need to (require 'subr-x) ? this is not a decision of >> package maintainers ? > Without explicitly requiring it I was unable to run `bqn-comint-bring' > in the mode to open an interpreter. I eventually tracked this down to > Emacs being totally confused about the macro `thread-last' within > `bqn-comint-bring', which is defined in `subr-x.el' but isn't > autoloaded. This does give me an idea to open a PR upstream, but that > wouldn't solve it for the 2024-09-10 tag of course. > For a comparable situation have a look at `emacs-tree-inspector', where > something similar is performed. I thought calling Emacs batch mode to > edit was neater. I think I should have put in a short comment > explaining, my apologies. Indeed, a little comment will help to understand future contributors, they’ll need to remove this line once fixed upstream. >> - `guix lint emacs-bqn-mode' uses release "2024-09-10" as version, not >> 0.1.0, maybe it is better to use it so that `guix refresh' will warn >> about future updates > Okay I see what you mean about this, until now I'd been running > `./pre-inst-env guix lint emacs-bqn-mode' within a Guix shell container > which of course hits some issues. Running it in a plain shell mentions > upgrading to 2024-09-10. Rather use ‘guix shell -CPW’, as stated in the manual, then "./pre ..." > I'd followed some other examples in `emacs-xyz.scm' where it looked like > the tagged name didn't match with the `Version: ' line within the main > Emacs Lisp source. See 'emacs-everywhere' for an example. What I > hadn't thought about was that in this case there's a tag to work with > for version. > > Before I send in a revised patch, do you mean something like this would > work: >> (define-public emacs-bqn-mode >> (let ((tag "2024-09-10")) >> (package >> (name "emacs-bqn-mode") >> (version tag) >> (source >> (origin >> (method git-fetch) >> (uri (git-reference >> (url "https://github.com/museoa/bqn-mode") >> (commit tag))) >> (file-name (git-file-name name version)) >> ... In this case, package seems to use a date tag for releases, so yes, this is the way I’d proceed.
I think I've adjusted according to everything you've mentioned. A v2 patch should arrive shortly, I'll get the eros patch tidied up and sent over also. Thanks for all the help!
diff --git a/gnu/packages/emacs-xyz.scm b/gnu/packages/emacs-xyz.scm index f7459c3c32..30d439172f 100644 --- a/gnu/packages/emacs-xyz.scm +++ b/gnu/packages/emacs-xyz.scm @@ -487,6 +487,46 @@ (define-public emacs-bookmark-plus reading the extensive documentation about BookmarkPlus on the Emacs Wiki.") (license license:gpl3+))) +(define-public emacs-bqn-mode + ;; Latest tagged version + (let ((commit "2024-09-10") + (revision "0")) + (package + (name "emacs-bqn-mode") + (version (git-version "0.1.0" revision commit)) + (source + (origin + (method git-fetch) + (uri (git-reference + (url "https://github.com/museoa/bqn-mode.git") + (commit commit))) + (file-name (git-file-name name version)) + (sha256 + (base32 "0a4whlx8065c15nfyqy8176mwysnc13z4q7mmdfnf6skdnvi2pk6")))) + (build-system emacs-build-system) + (arguments + (list + #:phases + #~(modify-phases %standard-phases + (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")