From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mp10.migadu.com ([2001:41d0:306:2d92::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by ms9.migadu.com with LMTPS id +B9QLoLZ7GReEgAAG6o9tA:P1 (envelope-from ) for ; Mon, 28 Aug 2023 19:29:38 +0200 Received: from aspmx1.migadu.com ([2001:41d0:306:2d92::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by mp10.migadu.com with LMTPS id +B9QLoLZ7GReEgAAG6o9tA (envelope-from ) for ; Mon, 28 Aug 2023 19:29:38 +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 3D80341DB8 for ; Mon, 28 Aug 2023 19:29:38 +0200 (CEST) Authentication-Results: aspmx1.migadu.com; dkim=fail ("headers rsa verify failed") header.d=gmail.com header.s=20221208 header.b=kJ28nNeZ; 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=1693243778; h=from:from:sender:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:cc:mime-version:mime-version: 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=eqf7YTMwt8MIL6Ndrup6WM2BiBZNYnQF69JKr6+nMRo=; b=KWAODBSD9rS+d/d+S0+UNKhD+HSLp1qSXWw68//uMy9+ZJEZv2dUA602+DzfNvFe+j1PJt MgGgOrALNSd3njddfjM0pDxS4ml7t+QfI314YlKibqBns/CyvPde97hCyijPXtSolsGuAX ECWJw+2ozkBjM2PlbcigmsUzwg9zMjK+FIVGEuLJ3JjQBouWoR7suOXJoH0G2A0LX7nH9D mi3rhyXtMF4s6EzirmJUCUa8vmv2mzKtZg5Ii2b3JulopNCgvMXbqH3gQQ89Cy33w5U6n8 ylvI/8XULYk5hkSYJ2jgB94AVZ6GnA3Xuydb1hHtPcJQLQt5TL2jqXIfuQqxtw== ARC-Authentication-Results: i=1; aspmx1.migadu.com; dkim=fail ("headers rsa verify failed") header.d=gmail.com header.s=20221208 header.b=kJ28nNeZ; 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-Seal: i=1; s=key1; d=yhetil.org; t=1693243778; a=rsa-sha256; cv=none; b=BIQD4b7vNAD9lAkDaD3CY+E98AG8PPEqWPQ5CrF2/Dgv6PHCMxvTMXeBGMReGk6uWUBdAF BvIa5XZghB/3TKkMqrPEnjjhPkV0CXhFxT+z1TYY32BYq9nctFZduYLXVASfHAkRd5J/ei Z9Xtt/q7AR0QrN79/upHG8YsAnEQ2c9Wb4yhsp28Uj8tH1VlfuR9XhgPF6rvmuKulOBe46 V1SBpAdWOT/lnm4kgeCwxRfq38gojOdkdkeb3WSBPAA9+HOiWonaioFfPfhGPWu5UuOVcX klJJrrBXhh7ZS6aM1KpDaqLj/7kd1C2/9aCauCmWxhdq7/CjmurriArzy4UGEw== Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1qae1M-0002DI-Rr; Mon, 28 Aug 2023 11:19:16 -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 1qae14-00021t-Bd for bug-guix@gnu.org; Mon, 28 Aug 2023 11:18:58 -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 1qae14-0006un-34 for bug-guix@gnu.org; Mon, 28 Aug 2023 11:18:58 -0400 Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1qae19-0000FZ-To; Mon, 28 Aug 2023 11:19:03 -0400 X-Loop: help-debbugs@gnu.org Subject: bug#65575: [PATCH v2 4/4] gnu: emacs: Reload subdirs.el files in 'guix-emacs-autoload-packages'. 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 15:19:03 +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.1693235899878 (code B ref 65575); Mon, 28 Aug 2023 15:19:03 +0000 Received: (at 65575) by debbugs.gnu.org; 28 Aug 2023 15:18:19 +0000 Received: from localhost ([127.0.0.1]:48774 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1qae0Q-0000E6-C9 for submit@debbugs.gnu.org; Mon, 28 Aug 2023 11:18:18 -0400 Received: from mail-qt1-x82e.google.com ([2607:f8b0:4864:20::82e]:42051) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1qae0J-0000D9-06 for 65575@debbugs.gnu.org; Mon, 28 Aug 2023 11:18:11 -0400 Received: by mail-qt1-x82e.google.com with SMTP id d75a77b69052e-41205469f4eso14880031cf.0 for <65575@debbugs.gnu.org>; Mon, 28 Aug 2023 08:18:04 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20221208; t=1693235879; x=1693840679; 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=eqf7YTMwt8MIL6Ndrup6WM2BiBZNYnQF69JKr6+nMRo=; b=kJ28nNeZ2tuIFHMh7uFBhoMSVKxHv+00zZKcRyKa4+GfyCbhHsDSF/HX5lnHuSV3+3 fV71t2+VzBGFZEkwFG5EdzoSSz3mm6Y17lgM17ht2DftyDuoP69S0gRGyo3GC3ZwVOmp XKA3+m9JiE8+BHX/fx0u+axXCod+vUj3R+ryvXxbABJKKwCWUbyNFMiMHdIA5aEssH+t c4O56l+Nw22TBwMbDeZ7gp+A+fA02kk0ODvCycN08vou0zSTikMVv5mRJJYZ2pn4b9dM XBTtxJshfCoLlNrF314WC9bomd5qBr9HdYMrq2MYZk9N+gJ2YVfaN1wntAry64YC4HrU Fwqw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1693235879; x=1693840679; 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=eqf7YTMwt8MIL6Ndrup6WM2BiBZNYnQF69JKr6+nMRo=; b=RZGHdb/h1uKpLiKQ9U3w2LQEgK3+VsgQPGQ3akhDY7+CaCqypAP6+lUkD5gevWDVi3 bi/pKkScxg0LrqLiwMHI5OKHzpEyYkp25N/HiHkqpRNh3nqmUtNe/wDs+FWyvs/Uq+Im sJmlkjyy0AbwB+01CSzH2XxSE2EHYs0R2bVFkyYdXbHrWKpsI3bf/VkHD1dqza4U0Epe ZaHlHMk+FUc6G2VGZwAUeT8yLtx/5arMUhGNRcU/zFRYQxeNYXm6Z+pLM+Odkkets974 8bZcB877mpcd5665JI3IYY4SNuj00+mYPSaqFNA64Zvx54bm2lW9v2Ses7bx8oonZWar D+Xg== X-Gm-Message-State: AOJu0YzXi5mdHULCLNBybYvJMp/eHBwz1Q5+cTemRSOS8DAnHDkiE6ai 87LyxNncD/xDEB9+1jONDiV7DAwTyWE= X-Google-Smtp-Source: AGHT+IEGO7xGlh+UFFjPV6SEHySrs3SKOB23ds0MOycITdmpleN9vSSqcGWCeX2CkVE9/GuKcUNiSA== X-Received: by 2002:ac8:5a8f:0:b0:3f8:3090:15c9 with SMTP id c15-20020ac85a8f000000b003f8309015c9mr32412413qtc.30.1693235878497; Mon, 28 Aug 2023 08:17:58 -0700 (PDT) Received: from localhost.localdomain (dsl-10-132-204.b2b2c.ca. [72.10.132.204]) by smtp.gmail.com with ESMTPSA id s14-20020ac85ece000000b00410a9dd3d88sm2364705qtx.68.2023.08.28.08.17.58 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 28 Aug 2023 08:17:58 -0700 (PDT) From: Maxim Cournoyer Date: Mon, 28 Aug 2023 11:16:36 -0400 Message-ID: <6276f07557efac57cc135c1239b074f07281d124.1693235796.git.maxim.cournoyer@gmail.com> X-Mailer: git-send-email 2.41.0 In-Reply-To: <6715bc07d825d632140c63bd98c959d31cc5de47.1693235796.git.maxim.cournoyer@gmail.com> References: <6715bc07d825d632140c63bd98c959d31cc5de47.1693235796.git.maxim.cournoyer@gmail.com> MIME-Version: 1.0 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-Country: US X-Migadu-Flow: FLOW_IN X-Migadu-Scanner: mx2.migadu.com X-Migadu-Spam-Score: 6.28 X-Spam-Score: 6.28 X-Migadu-Queue-Id: 3D80341DB8 X-TUID: fxjHnbJDzXbW This fixes a regression introduced with 79cfe30f3 ("build-system: emacs: Use subdirectories again.") which caused the 'guix-emacs-autoload-packages' to no longer be able to autoload all packages. * gnu/packages/aux-files/emacs/guix-emacs.el (guix-emacs-autoload-packages-called): New variable. (guix-emacs-autoload-packages): Reload subdirs.el files on all but the first call of this procedure, or when a prefix argument is provided. Update doc. * doc/guix.texi (Application Setup): Document that 'guix-emacs-autoload-packages' can be invoked interactively to auto-reload newly installed Emacs packages. --- Changes in v2: - Safely load subdirs.el files - Add 'reload' prefix argument as override for guix-emacs-autoload-packages doc/guix.texi | 11 +++++++---- gnu/packages/aux-files/emacs/guix-emacs.el | 21 ++++++++++++++++++--- 2 files changed, 25 insertions(+), 7 deletions(-) diff --git a/doc/guix.texi b/doc/guix.texi index f82bb99069..66da4f9cd4 100644 --- a/doc/guix.texi +++ b/doc/guix.texi @@ -2167,12 +2167,15 @@ Application Setup Emacs through the @env{EMACSLOADPATH} environment variable, which is set when installing Emacs itself. +@cindex guix-emacs-autoload-packages, refreshing Emacs packages Additionally, autoload definitions are automatically evaluated at the initialization of Emacs, by the Guix-specific -@code{guix-emacs-autoload-packages} procedure. If, for some reason, you -want to avoid auto-loading the Emacs packages installed with Guix, you -can do so by running Emacs with the @option{--no-site-file} option -(@pxref{Init File,,, emacs, The GNU Emacs Manual}). +@code{guix-emacs-autoload-packages} procedure. This procedure can be +interactively invoked to have newly installed Emacs packages discovered, +without having to restart Emacs. If, for some reason, you want to avoid +auto-loading the Emacs packages installed with Guix, you can do so by +running Emacs with the @option{--no-site-file} option (@pxref{Init +File,,, emacs, The GNU Emacs Manual}). @quotation Note Emacs can now compile packages natively. Under the default diff --git a/gnu/packages/aux-files/emacs/guix-emacs.el b/gnu/packages/aux-files/emacs/guix-emacs.el index 84284dde39..aeb85f8487 100644 --- a/gnu/packages/aux-files/emacs/guix-emacs.el +++ b/gnu/packages/aux-files/emacs/guix-emacs.el @@ -64,13 +64,28 @@ The files in the list do not have extensions (.el, .elc)." (expand-file-name "subdirs.el" dir)) (guix-emacs--non-core-load-path)))) +(defvar guix-emacs-autoload-packages-called nil + "True if `guix-emacs-autoload-packages' was already run.") + ;;;###autoload -(defun guix-emacs-autoload-packages () +(defun guix-emacs-autoload-packages (&optional reload) "Autoload Emacs packages found in EMACSLOADPATH. 'Autoload' means to load the 'autoloads' files matching -`guix-emacs-autoloads-regexp'." - (interactive) +`guix-emacs-autoloads-regexp'. When the optional RELOAD prefix +argument is true, reload the subdirs.el files found on the load +path; this behavior is active by default unless you've started +Emacs with the '--no-site-file' option." + (interactive "P") + ;; Reload the subdirs.el files such as the one generated by the Guix profile + ;; hook, so that newly installed Emacs packages located under + ;; sub-directories are put on the load-path without having to restart Emacs. + (if (or reload guix-emacs-autoload-packages-called) + (progn + (mapc #'guix-emacs--load-file-no-error (guix-emacs--subdirs-files)) + (setq load-path (delete-dups load-path))) + (setq guix-emacs-autoload-packages-called t)) + (let ((autoloads (mapcan #'guix-emacs-find-autoloads (guix-emacs--non-core-load-path)))) (mapc #'guix-emacs--load-file-no-error autoloads))) -- 2.41.0