From patchwork Mon Mar 3 02:09:18 2025 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Nicolas Graves X-Patchwork-Id: 39632 Return-Path: X-Original-To: patchwork@mira.cbaines.net Delivered-To: patchwork@mira.cbaines.net Received: by mira.cbaines.net (Postfix, from userid 113) id 9F05727BBEA; Mon, 3 Mar 2025 02:10:58 +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=-7.4 required=5.0 tests=BAYES_00,DKIM_INVALID, DKIM_SIGNED,MAILING_LIST_MULTI,RCVD_IN_DNSWL_BLOCKED,RCVD_IN_MSPIKE_H2, 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 C3F4827BBE2 for ; Mon, 3 Mar 2025 02:10:57 +0000 (GMT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1tovG7-00037F-DU; Sun, 02 Mar 2025 21:10:19 -0500 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 ) id 1tovFs-0002z5-4L for guix-patches@gnu.org; Sun, 02 Mar 2025 21:10:04 -0500 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 ) id 1tovFr-0000sW-Q2 for guix-patches@gnu.org; Sun, 02 Mar 2025 21:10:03 -0500 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=debbugs.gnu.org; s=debbugs-gnu-org; h=MIME-Version:References:In-Reply-To:Date:From:To:Subject; bh=3M2ygZd44i7gqyL1nQmG9PLqA6XFLJW+lWS96Hyx4mw=; b=mvRjjRl0mNnJtIm0IxSHVo3jalGEBqiY11+VGbrZrQPdT4tr1LPgY+hpy+5zna3Qv2n37e6f0Kfb2EONj6ZJx/dVuIk3SBxwz2a+GlVdkBm5Oe7UBBh5bkV/9y6AzOBEvXW8KapkvngJxGAaV/8VtbomwuqVv/P4k91/6wRQpJxmnbbT6oQ9WR4gK+crOmnCSOm0fQbX0gQDq0J3l4xTnl62xx/JKjgIPvg+qxidDQ2r9Wps6tYCF1Fp3y2BkKhHgyMRte5FnVgETWXGNKZ3J49RKad2Zw/faUlPO7DOg64UlCruF29ymS6MT6JOaJu9gfd6ypj3RPh35ip3cALNnA==; Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1tovFq-0007eR-Kt for guix-patches@gnu.org; Sun, 02 Mar 2025 21:10:02 -0500 X-Loop: help-debbugs@gnu.org Subject: [bug#76699] [PATCH 3/5] Remove dash dependency, introduce llama library Resent-From: Nicolas Graves Original-Sender: "Debbugs-submit" Resent-CC: guix-patches@gnu.org Resent-Date: Mon, 03 Mar 2025 02:10:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 76699 X-GNU-PR-Package: guix-patches X-GNU-PR-Keywords: patch To: 76699@debbugs.gnu.org Cc: Nicolas Graves Received: via spool by 76699-submit@debbugs.gnu.org id=B76699.174096778629282 (code B ref 76699); Mon, 03 Mar 2025 02:10:02 +0000 Received: (at 76699) by debbugs.gnu.org; 3 Mar 2025 02:09:46 +0000 Received: from localhost ([127.0.0.1]:40744 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1tovFZ-0007c8-TH for submit@debbugs.gnu.org; Sun, 02 Mar 2025 21:09:46 -0500 Received: from 15.mo583.mail-out.ovh.net ([178.33.107.29]:48287) by debbugs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.84_2) (envelope-from ) id 1tovFU-0007b1-7T for 76699@debbugs.gnu.org; Sun, 02 Mar 2025 21:09:42 -0500 Received: from director7.ghost.mail-out.ovh.net (unknown [10.109.140.229]) by mo583.mail-out.ovh.net (Postfix) with ESMTP id 4Z5j1b1yGGz1T6x for <76699@debbugs.gnu.org>; Mon, 3 Mar 2025 02:09:39 +0000 (UTC) Received: from ghost-submission-5b5ff79f4f-rpnvq (unknown [10.110.178.62]) by director7.ghost.mail-out.ovh.net (Postfix) with ESMTPS id ED6151FDFF; Mon, 3 Mar 2025 02:09:38 +0000 (UTC) Received: from ngraves.fr ([37.59.142.106]) by ghost-submission-5b5ff79f4f-rpnvq with ESMTPSA id UsdfL2IPxWflTA8APzYwNQ (envelope-from ); Mon, 03 Mar 2025 02:09:38 +0000 Authentication-Results: garm.ovh; auth=pass (GARM-106R00644a9a709-2937-4aff-80aa-2eb9f2ba633c, 3FD0527DE2CE9D3C35B0E9483E243F320C79A24B) smtp.auth=ngraves@ngraves.fr X-OVh-ClientIp: 90.92.117.144 Date: Mon, 3 Mar 2025 03:09:18 +0100 Message-ID: <20250303020932.4194-3-ngraves@ngraves.fr> X-Mailer: git-send-email 2.48.1 In-Reply-To: <20250303020932.4194-1-ngraves@ngraves.fr> References: <20250303020932.4194-1-ngraves@ngraves.fr> MIME-Version: 1.0 X-Ovh-Tracer-Id: 1108729936254001890 X-VR-SPAMSTATE: OK X-VR-SPAMSCORE: 49 X-VR-SPAMCAUSE: gggruggvucftvghtrhhoucdtuddrgeefvddrtddtgdeljeekkecutefuodetggdotefrodftvfcurfhrohhfihhlvgemucfqggfjpdevjffgvefmvefgnecuuegrihhlohhuthemucehtddtnecuogfuuhhsphgvtghtffhomhgrihhnucdlgeelmdenucfjughrpefhvfevufffkffojghfgggtgfesthekredtredtjeenucfhrhhomheppfhitgholhgrshcuifhrrghvvghsuceonhhgrhgrvhgvshesnhhgrhgrvhgvshdrfhhrqeenucggtffrrghtthgvrhhnpeetjeeugedvjeduvefhveelffehjefhtdetheetheffkeegveefhfejleetleelueenucffohhmrghinhepghhithhhuhgsrdgtohhmpdhgihhtlhgrsgdrtghomhdpghhithhlrggsrdhiohenucfkphepuddvjedrtddrtddruddpledtrdelvddruddujedrudeggedpfeejrdehledrudegvddruddtieenucevlhhushhtvghrufhiiigvpedtnecurfgrrhgrmhepihhnvghtpeduvdejrddtrddtrddupdhmrghilhhfrhhomhepnhhgrhgrvhgvshesnhhgrhgrvhgvshdrfhhrpdhnsggprhgtphhtthhopedupdhrtghpthhtohepjeeiieelleesuggvsggsuhhgshdrghhnuhdrohhrghdpoffvtefjohhsthepmhhoheekfegmpdhmohguvgepshhmthhpohhuth DKIM-Signature: a=rsa-sha256; bh=3M2ygZd44i7gqyL1nQmG9PLqA6XFLJW+lWS96Hyx4mw=; c=relaxed/relaxed; d=ngraves.fr; h=From; s=ovhmo4487190-selector1; t=1740967779; v=1; b=s0XSgFRB2eHN/w1JvBfny5Q0AKrI20fdhf5l1tshxmwTFW6yP8Elz/Xr3/5YL1ZqaHEqhBjx gyOnaNucEyQpUXsrnk/Z2blCiJLmhPj8GUy3uissimtPi9iKLQE4i3dutJrBMrXl4x2DHnI41fj +wx3uhGlwo09bjv9y2q9VEIvZw/M2L+SEyBrSkofO4UP80tO9vo6WHSU+FKowVPilyXlAIVq1+i 6HvChGWCSNKiMR0irnu34NHL1rEYfCxl2kaT5isMz0M2j50cV1EbRfkXIExrqjGBYSMUEpIDve4 DnH6OB+Lax/OnobsugTJKknUgPQW/f8GTlYB37QxKgYzg== X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-BeenThere: guix-patches@gnu.org List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Reply-to: Nicolas Graves X-ACL-Warn: , Nicolas Graves via Guix-patches X-Patchwork-Original-From: Nicolas Graves via Guix-patches via From: Nicolas Graves 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 --- configure.ac | 16 ++++++++-------- doc/emacs-guix.texi | 8 ++++---- elisp/guix-help.el | 1 - elisp/guix-repl.el | 6 +++--- elisp/guix-ui-generation.el | 1 - elisp/guix-ui-package.el | 12 ++++++------ elisp/guix-ui-profile.el | 28 +++++++++++++++------------- elisp/guix-ui-store-item.el | 2 -- elisp/guix-utils.el | 1 - elisp/guix.el | 2 +- elisp/local.mk | 4 ++-- 11 files changed, 39 insertions(+), 42 deletions(-) diff --git a/configure.ac b/configure.ac index 3461bb3..31c7328 100644 --- a/configure.ac +++ b/configure.ac @@ -109,12 +109,12 @@ AC_ARG_WITH([geiser-lispdir], [geiserlispdir="no"]) AC_SUBST([geiserlispdir]) -AC_ARG_WITH([dash-lispdir], - [AS_HELP_STRING([--with-dash-lispdir], - [directory with dash.el file])], - [dashlispdir="$withval"], - [dashlispdir="no"]) -AC_SUBST([dashlispdir]) +AC_ARG_WITH([llama-lispdir], + [AS_HELP_STRING([--with-llama-lispdir], + [directory with llama.el file])], + [llamalispdir="$withval"], + [llamalispdir="no"]) +AC_SUBST([llamalispdir]) AC_ARG_WITH([bui-lispdir], [AS_HELP_STRING([--with-bui-lispdir], @@ -138,7 +138,7 @@ AC_ARG_WITH([transient-lispdir], AC_SUBST([transientlispdir]) AM_CONDITIONAL([GEISER_DIR], [test "x$geiserlispdir" != "xno"]) -AM_CONDITIONAL([DASH_DIR], [test "x$dashlispdir" != "xno"]) +AM_CONDITIONAL([LLAMA_DIR], [test "x$llamalispdir" != "xno"]) AM_CONDITIONAL([BUI_DIR], [test "x$builispdir" != "xno"]) AM_CONDITIONAL([EDITINDIRECT_DIR], [test "x$editindirectlispdir" != "xno"]) AM_CONDITIONAL([TRANSIENT_DIR], [test "x$transientlispdir" != "xno"]) @@ -148,7 +148,7 @@ dnl byte-compilation. Otherwise, "emacs" will be used, and it will dnl hopefully find these packages in its 'load-path'. AM_CONDITIONAL([EMACS_Q], [test "x$geiserlispdir" != "xno" -a \ - "x$dashlispdir" != "xno" -a \ + "x$llamalispdir" != "xno" -a \ "x$builispdir" != "xno" -a \ "x$editindirectlispdir" != "xno" -a \ "x$transientlispdir" != "xno"]) diff --git a/doc/emacs-guix.texi b/doc/emacs-guix.texi index 6bb3810..1953b09 100644 --- a/doc/emacs-guix.texi +++ b/doc/emacs-guix.texi @@ -176,8 +176,8 @@ from the Guix Guile code. So without Geiser, you can use the same features as without Guix. @item -@uref{https://github.com/magnars/dash.el, dash library}, version -2.11.0 or later. +@uref{https://github.com/tarsius/llama, llama library}, version +0.6.1 or later. @item @uref{https://gitlab.com/alezost-emacs/bui, BUI library}, version @@ -1091,8 +1091,8 @@ easy accessible key combination, for example, to @kbd{@key{super}-g}: (global-set-key (kbd "s-g") 'guix) @end example -@node Guix Keyboard-driven Menu -@section Guix Keyboard-driven Menu +@node Keyboard-driven Menu +@section Keyboard-driven Menu @findex guix-command There is one rather special transient suffix in @kbd{M-x@tie{}guix}. It diff --git a/elisp/guix-help.el b/elisp/guix-help.el index 53ccd3a..f8be213 100644 --- a/elisp/guix-help.el +++ b/elisp/guix-help.el @@ -23,7 +23,6 @@ ;;; Code: -(require 'dash) (require 'bui) (require 'guix nil t) (require 'guix-utils) diff --git a/elisp/guix-repl.el b/elisp/guix-repl.el index 846db60..0ebf603 100644 --- a/elisp/guix-repl.el +++ b/elisp/guix-repl.el @@ -48,7 +48,6 @@ ;;; Code: -(require 'dash) (require 'geiser-mode) (require 'geiser-guile) (require 'guix nil t) @@ -57,6 +56,7 @@ (require 'guix-external) (require 'guix-profiles) (require 'guix-utils) +(require 'llama) (defvar guix-load-path nil "Directory or a list of directories prepended to Guile's `%load-path'. @@ -209,8 +209,8 @@ After setting this variable, you need to kill (lcp (if guix-load-compiled-path (guix-list-maybe guix-load-compiled-path) lp))) - (append (--mapcat (list "-L" (guix-file-name it)) lp) - (--mapcat (list "-C" (guix-file-name it)) lcp)))) + (append (apply #'append (list "-L" (##guix-file-name %1)) lp) + (apply #'append (list "-C" (##guix-file-name %1)) lcp)))) "-L" ,guix-scheme-directory ,@(and guix-config-scheme-compiled-directory (list "-C" guix-config-scheme-compiled-directory)) diff --git a/elisp/guix-ui-generation.el b/elisp/guix-ui-generation.el index 7d10d90..ba28814 100644 --- a/elisp/guix-ui-generation.el +++ b/elisp/guix-ui-generation.el @@ -25,7 +25,6 @@ ;;; Code: (require 'cl-lib) -(require 'dash) (require 'bui) (require 'guix nil t) (require 'guix-ui) diff --git a/elisp/guix-ui-package.el b/elisp/guix-ui-package.el index f861820..293e597 100644 --- a/elisp/guix-ui-package.el +++ b/elisp/guix-ui-package.el @@ -25,7 +25,6 @@ ;;; Code: (require 'cl-lib) -(require 'dash) (require 'bui) (require 'guix nil t) (require 'guix-ui) @@ -39,6 +38,7 @@ (require 'guix-location) (require 'guix-package) (require 'guix-profiles) +(require 'llama) (guix-ui-define-entry-type package) (guix-ui-define-entry-type output) @@ -102,14 +102,14 @@ is found and `guix-package-list-show-single' is nil." (defun guix-package-entry-installed-outputs (entry) "Return a list of installed outputs for the package ENTRY." - (--map (bui-entry-non-void-value it 'output) - (bui-entry-non-void-value entry 'installed))) + (mapcar (##bui-entry-non-void-value %1 'output) + (bui-entry-non-void-value entry 'installed))) (defun guix-read-package-name-from-entries (entries) "Prompt for a package name and return it. Names are completed from package ENTRIES." (completing-read "Package: " - (--map (bui-entry-value it 'name) entries))) + (mapcar (##bui-entry-value %1 'name) entries))) (defun guix-read-package-entry-by-name (&optional entries) "Return an entry from package ENTRIES (current entries by default). @@ -1165,8 +1165,8 @@ Colorize it with an appropriate face if needed." (defun guix-package-list-get-installed-outputs (installed &optional _) "Return string with outputs from INSTALLED entries." (bui-get-string - (--map (bui-entry-non-void-value it 'output) - installed))) + (mapcar (##bui-entry-non-void-value %1 'output) + installed))) (defun guix-package-list-marking-check () "Signal an error if marking is disabled for the current buffer." diff --git a/elisp/guix-ui-profile.el b/elisp/guix-ui-profile.el index 2f17b38..0923ba5 100644 --- a/elisp/guix-ui-profile.el +++ b/elisp/guix-ui-profile.el @@ -26,13 +26,13 @@ ;;; Code: -(require 'dash) (require 'bui) (require 'guix nil t) (require 'guix-profiles) (require 'guix-read) (require 'guix-utils) (require 'guix-misc) +(require 'llama) (guix-define-groups profile) @@ -55,15 +55,15 @@ properly.") "Return a list of all profiles." (or guix-profiles (setq guix-profiles - (--filter - (and it (file-exists-p it)) + (seq-filter + (##and %1 (file-exists-p %1)) (delete-dups - (-cons* guix-default-user-profile - guix-default-pulled-profile - guix-system-profile - guix-home-profile - (--when-let (getenv "GUIX_PROFILE") - (guix-file-name it)) + (append (list guix-default-user-profile + guix-default-pulled-profile + guix-system-profile + guix-home-profile + (when-let ((profile (getenv "GUIX_PROFILE"))) + (guix-file-name profile))) (guix-eval-read "(user-profiles)"))))))) (defun guix-profile->entry (profile) @@ -107,8 +107,8 @@ are multiple entries, prompt for a profile name and return it." (or entries (setq entries (bui-current-entries))) (if (cdr entries) (completing-read "Profile: " - (--map (bui-entry-value it 'profile) - entries)) + (mapcar (##bui-entry-value %1 'profile) + entries)) (bui-entry-value (car entries) 'profile))) @@ -208,8 +208,10 @@ get the information." (lambda (entry) (let ((id (bui-entry-id entry))) (cons `(current . ,(equal id current-id)) - (--remove-first (eq (car it) 'current) - entry)))) + (seq-remove-at-position + (seq-filter (##eq (car %1) 'current) + entry) + 0)))) (bui-current-entries)))) (setf (bui-item-entries bui-item) new-entries)) diff --git a/elisp/guix-ui-store-item.el b/elisp/guix-ui-store-item.el index 13a2d78..91c1d96 100644 --- a/elisp/guix-ui-store-item.el +++ b/elisp/guix-ui-store-item.el @@ -1,7 +1,6 @@ ;;; guix-ui-store-item.el --- Interface to display store items -*- lexical-binding: t -*- ;; Copyright © 2018 Alex Kost -;; Copyright © 2025 Nicolas Graves ;; This file is part of Emacs-Guix. @@ -27,7 +26,6 @@ (require 'cl-lib) (require 'ffap) -(require 'dash) (require 'bui) (require 'guix-package) (require 'guix-guile) diff --git a/elisp/guix-utils.el b/elisp/guix-utils.el index 5535eb9..1d0db3f 100644 --- a/elisp/guix-utils.el +++ b/elisp/guix-utils.el @@ -24,7 +24,6 @@ ;;; Code: (require 'cl-lib) -(require 'dash) (require 'bui-utils) (require 'guix nil t) diff --git a/elisp/guix.el b/elisp/guix.el index 2686a24..6e0ebc8 100644 --- a/elisp/guix.el +++ b/elisp/guix.el @@ -6,7 +6,7 @@ ;; Version: 0.5.2 ;; URL: https://emacs-guix.gitlab.io/website/ ;; Keywords: tools -;; Package-Requires: ((emacs "24.3") (dash "2.11.0") (geiser "0.8") (bui "1.2.0") (transient "0.8.4") (edit-indirect "0.1.4")) +;; Package-Requires: ((emacs "24.3") (llama "0.6.1") (geiser "0.8") (bui "1.2.0") (transient "0.8.4") (edit-indirect "0.1.4")) ;; This file is part of Emacs-Guix. diff --git a/elisp/local.mk b/elisp/local.mk index 4efbae5..b5b10c0 100644 --- a/elisp/local.mk +++ b/elisp/local.mk @@ -28,8 +28,8 @@ if GEISER_DIR AM_ELCFLAGS += -L "$(geiserlispdir)" endif -if DASH_DIR - AM_ELCFLAGS += -L "$(dashlispdir)" +if LLAMA_DIR + AM_ELCFLAGS += -L "$(llamalispdir)" endif if BUI_DIR