From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mp12.migadu.com ([2001:41d0:403:4789::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by ms9.migadu.com with LMTPS id IIrvFfMw7GSCPAEAauVa8A:P1 (envelope-from ) for ; Mon, 28 Aug 2023 07:30:27 +0200 Received: from aspmx1.migadu.com ([2001:41d0:403:4789::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by mp12.migadu.com with LMTPS id IIrvFfMw7GSCPAEAauVa8A (envelope-from ) for ; Mon, 28 Aug 2023 07:30:27 +0200 Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by aspmx1.migadu.com (Postfix) with ESMTPS id 9A8083D190 for ; Mon, 28 Aug 2023 07:30:26 +0200 (CEST) Authentication-Results: aspmx1.migadu.com; dkim=fail ("headers rsa verify failed") header.d=gmail.com header.s=20221208 header.b=N2iK0Jiy; spf=pass (aspmx1.migadu.com: domain of "bug-guix-bounces+larch=yhetil.org@gnu.org" designates 209.51.188.17 as permitted sender) smtp.mailfrom="bug-guix-bounces+larch=yhetil.org@gnu.org"; dmarc=fail reason="SPF not aligned (relaxed)" header.from=gmail.com (policy=none) ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=yhetil.org; s=key1; t=1693200627; h=from:from:sender:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:cc:mime-version:mime-version: content-type:content-type: content-transfer-encoding:content-transfer-encoding:resent-cc: resent-from:resent-sender:resent-message-id:in-reply-to:in-reply-to: references:references:list-id:list-help:list-unsubscribe: list-subscribe:list-post:dkim-signature; bh=41tjjtTbaNGb0ELzTQdK7kuFKpbFIcjfafZL4pMIdU8=; b=E7Lu/CHPv/xxXN2GovZ4oiDd/UR3Yfg1LJ2Gu1SCg+T4S0N3+bS8145229SbjWhImkOZlg G6I6+6piqMA8auCbd+WDBIzw8348BaEVgXPXr3b1lKpTYlvoBy1YltbUR9fOtg4SCjNtoc AUKzRiyL13+qjwWKlfo0E1nmpperNOyWCGg4eRIo07u5DQq+uCbEyZG1HajywBgUq7o0cC OpCVHHk0a0VI1tv6w1vKrMn4G6BU5DH5ho+TMagf4sxbrvgPkUha5AXVioO5FnPe32FFuc KH6ElaZFJenJqgtO7x6nylD+64JpGQ0slzgyOvvDMleG39pQA4PI9+7oShtMxg== ARC-Seal: i=1; s=key1; d=yhetil.org; t=1693200627; a=rsa-sha256; cv=none; b=F62yr3UmMIPH1X3jTmmto2QDu3dqcxA218iFvBxTHLFp0BQSgUziw4yCELcVIxk7CpfnuV zz28g9/LXhRW657BNBK9x2a/SZ5+2itZFC1G0iN7NaX5QAOjQHVmdOHCteXNRPtuLfrXb6 5j41FyTnqe/KlgRA2ZZrl62+AbFhSuRpQhbGlPJSmy8x6PpKs1iZHc3VgckymhpLcmnC0h UVsRCfYrqQCVNeMVFqo+V7bTLaf4VmnHukGnuozKW9tL8BSZWYM49yi2mlxb1c1btTV2go P8SScMh8T6IDwWdVtNneZcS8bvUDl0zzOM+QC58MtPGtMY6R/71N/oGstNL9oQ== ARC-Authentication-Results: i=1; aspmx1.migadu.com; dkim=fail ("headers rsa verify failed") header.d=gmail.com header.s=20221208 header.b=N2iK0Jiy; spf=pass (aspmx1.migadu.com: domain of "bug-guix-bounces+larch=yhetil.org@gnu.org" designates 209.51.188.17 as permitted sender) smtp.mailfrom="bug-guix-bounces+larch=yhetil.org@gnu.org"; dmarc=fail reason="SPF not aligned (relaxed)" header.from=gmail.com (policy=none) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1qaUYi-0007x0-FF; Mon, 28 Aug 2023 01:13:04 -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 ) id 1qaUYe-0007wR-UX for bug-guix@gnu.org; Mon, 28 Aug 2023 01:13:01 -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 ) id 1qaUYc-0005Dr-6G for bug-guix@gnu.org; Mon, 28 Aug 2023 01:13:00 -0400 Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1qaUYg-0006FJ-UM; Mon, 28 Aug 2023 01:13:02 -0400 X-Loop: help-debbugs@gnu.org Subject: bug#65575: [PATCH 2/3] gnu: emacs: Factorize a 'guix-emacs--subdirs-files' procedure. Resent-From: Maxim Cournoyer Original-Sender: "Debbugs-submit" Resent-CC: andrew@trop.in, cox.katherine.e+guix@gmail.com, liliana.prikler@gmail.com, bug-guix@gnu.org Resent-Date: Mon, 28 Aug 2023 05:13:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 65575 X-GNU-PR-Package: guix X-GNU-PR-Keywords: To: 65575@debbugs.gnu.org Cc: Maxim Cournoyer , Andrew Tropin , Katherine Cox-Buday , Liliana Marie Prikler X-Debbugs-Original-Xcc: Andrew Tropin , Katherine Cox-Buday , Liliana Marie Prikler Received: via spool by 65575-submit@debbugs.gnu.org id=B65575.169319954823949 (code B ref 65575); Mon, 28 Aug 2023 05:13:02 +0000 Received: (at 65575) by debbugs.gnu.org; 28 Aug 2023 05:12:28 +0000 Received: from localhost ([127.0.0.1]:46696 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1qaUY7-0006EC-H5 for submit@debbugs.gnu.org; Mon, 28 Aug 2023 01:12:27 -0400 Received: from mail-qk1-x72a.google.com ([2607:f8b0:4864:20::72a]:46235) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1qaUY2-0006Dd-Q2 for 65575@debbugs.gnu.org; Mon, 28 Aug 2023 01:12:24 -0400 Received: by mail-qk1-x72a.google.com with SMTP id af79cd13be357-76ef8b91a72so189884185a.0 for <65575@debbugs.gnu.org>; Sun, 27 Aug 2023 22:12:16 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20221208; t=1693199531; x=1693804331; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=41tjjtTbaNGb0ELzTQdK7kuFKpbFIcjfafZL4pMIdU8=; b=N2iK0JiyhKWm2JVuZv4HMq6MsSAKGTyLAZjqB7Ysxz+oZuYRsEMyJWrRbGYNzGy9P1 tp3uvpwbnPxxQHCytcjYLtVbsQA2jYd9d2BjglVCPSJz9toDyVII6rDoWkHQI8BTU1xo acoVyel7K3ryjujbCeippAcf3osc5DI0tTSFtRJbYJX12oxUK8/VmmprPQYO1v+7EE1A KOIbiGEhYRMnkAdYTDyFTY9xEDpEXw1IsfaQnYrY65xa+mw+jBrn3/hnIan8TSevmyJZ jJk7ONEoHdz4B8Z1FDlE2kvccNSRHhDAl7jdAMExA4UIjsV6SDrh46t3ylEQbtsUvc0I chvA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1693199531; x=1693804331; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=41tjjtTbaNGb0ELzTQdK7kuFKpbFIcjfafZL4pMIdU8=; b=j+8dC3Q++gb5WI+Ufso8AnSKJgUeeqIH1kxjqeZcWdQAZH9hOABvzeIZPTpxneCaEU Bht9l8GYJCaQ95Zj9iYFnhC4Chr7959EqJHaVjFfiGU8sx1u6/6hfsQB8XfuK60zP0Ur zbUTjbVeDdo7cxu96QLPNJHLosQtYK9Y5Poj/89ij/7s2jN+w+XT/iF5UzBURMpn5nen Z6wYFpnszAkil++oKAr7TooIH+/XxtSoYY05xQyfzIumVlounGLxO+cNfVqd0zlIDG9L 3P68AcSIXyIEc5HJKf5fR9JdHsoCMaWDuqKqlemjymPFDACb6kNfK75RI+I4MPScDczi JlkQ== X-Gm-Message-State: AOJu0YysWnI583LjPZhktZ2hMR4tCRwxa1Qmf7L1vWAaCBYiT22pxVYb CGIlXbYNG/Nvl12CWXE972aq4mjM5iM= X-Google-Smtp-Source: AGHT+IGA9G8KW+1dWu1zxs8UUK3BazmIDvzNpchV7fAvkerE8iiTjvbm9rHsualuueeZKQFVM7dwBw== X-Received: by 2002:a0c:f28a:0:b0:64f:3c7a:fc57 with SMTP id k10-20020a0cf28a000000b0064f3c7afc57mr26599942qvl.26.1693199530881; Sun, 27 Aug 2023 22:12:10 -0700 (PDT) Received: from localhost.localdomain (dsl-155-106.b2b2c.ca. [66.158.155.106]) by smtp.gmail.com with ESMTPSA id z14-20020a0cf00e000000b0064f4d3bc78csm2312497qvk.61.2023.08.27.22.12.10 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 27 Aug 2023 22:12:10 -0700 (PDT) From: Maxim Cournoyer Date: Mon, 28 Aug 2023 01:11:33 -0400 Message-ID: <633948875c3119ecb741940aa54ead7d1896b893.1693199493.git.maxim.cournoyer@gmail.com> X-Mailer: git-send-email 2.41.0 In-Reply-To: <6715bc07d825d632140c63bd98c959d31cc5de47.1693199493.git.maxim.cournoyer@gmail.com> References: <6715bc07d825d632140c63bd98c959d31cc5de47.1693199493.git.maxim.cournoyer@gmail.com> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-BeenThere: bug-guix@gnu.org List-Id: Bug reports for GNU Guix List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: bug-guix-bounces+larch=yhetil.org@gnu.org Sender: bug-guix-bounces+larch=yhetil.org@gnu.org X-Migadu-Flow: FLOW_IN X-Migadu-Country: US X-Migadu-Spam-Score: -3.62 X-Spam-Score: -3.62 X-Migadu-Queue-Id: 9A8083D190 X-Migadu-Scanner: mx1.migadu.com X-TUID: ueUgfKM3iHKR * gnu/packages/aux-files/emacs/guix-emacs.el (guix-emacs--subdirs-files): New procedure. (guix-emacs-load-package-descriptors): Use it. --- gnu/packages/aux-files/emacs/guix-emacs.el | 33 +++++++++++++--------- 1 file changed, 19 insertions(+), 14 deletions(-) diff --git a/gnu/packages/aux-files/emacs/guix-emacs.el b/gnu/packages/aux-files/emacs/guix-emacs.el index c98e7fe369..ed0c913163 100644 --- a/gnu/packages/aux-files/emacs/guix-emacs.el +++ b/gnu/packages/aux-files/emacs/guix-emacs.el @@ -3,7 +3,7 @@ ;; Copyright © 2014, 2015, 2016, 2017 Alex Kost ;; Copyright © 2017 Kyle Meyer -;; Copyright © 2019 Maxim Cournoyer +;; Copyright © 2019, 2023 Maxim Cournoyer ;; This file is part of GNU Guix. @@ -47,6 +47,13 @@ The files in the list do not have extensions (.el, .elc)." (string-match-p "/share/emacs/site-lisp" dir)) load-path)) +(defun guix-emacs--subdirs-files () + "Return the Guix subdirs.el files found on the (non-core) load path." + (seq-filter #'file-exists-p + (mapcar (lambda (dir) + (expand-file-name "subdirs.el" dir)) + (guix-emacs--non-core-load-path)))) + ;;;###autoload (defun guix-emacs-autoload-packages () "Autoload Emacs packages found in EMACSLOADPATH. @@ -63,19 +70,17 @@ The files in the list do not have extensions (.el, .elc)." ;;;###autoload (defun guix-emacs-load-package-descriptors () "Load descriptors for packages found in EMACSLOADPATH via subdirs.el." - (dolist (dir (guix-emacs--non-core-load-path)) - (let ((subdirs-file (expand-file-name "subdirs.el" dir))) - (when (file-exists-p subdirs-file) - (with-temp-buffer - (insert-file-contents subdirs-file) - (goto-char (point-min)) - (let ((subdirs (read (current-buffer)))) - (and (equal (car-safe subdirs) 'normal-top-level-add-to-load-path) - (equal (car-safe (cadr subdirs)) 'list) - (dolist (subdir (cdadr subdirs)) - (let ((pkg-dir (expand-file-name subdir dir))) - (when (file-directory-p pkg-dir) - (package-load-descriptor pkg-dir))))))))))) + (dolist (subdirs-file (guix-emacs--subdirs-files)) + (with-temp-buffer + (insert-file-contents subdirs-file) + (goto-char (point-min)) + (let ((subdirs (read (current-buffer)))) + (and (equal (car-safe subdirs) 'normal-top-level-add-to-load-path) + (equal (car-safe (cadr subdirs)) 'list) + (dolist (subdir (cdadr subdirs)) + (let ((pkg-dir (expand-file-name subdir dir))) + (when (file-directory-p pkg-dir) + (package-load-descriptor pkg-dir))))))))) ;; If emacs built with tree-sitter, read the value of the environment variable ;; to make tree-sitter grammars available in emacs out-of-the-box. -- 2.41.0