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 aMQOAbpu8WTbDAAAauVa8A:P1 (envelope-from ) for ; Fri, 01 Sep 2023 06:55:22 +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 aMQOAbpu8WTbDAAAauVa8A (envelope-from ) for ; Fri, 01 Sep 2023 06:55:22 +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 CD4E64101A for ; Fri, 1 Sep 2023 06:55:21 +0200 (CEST) Authentication-Results: aspmx1.migadu.com; dkim=fail ("headers rsa verify failed") header.d=gmail.com header.s=20221208 header.b=czvnjMLS; dmarc=fail reason="SPF not aligned (relaxed)" header.from=gmail.com (policy=none); 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" ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=yhetil.org; s=key1; t=1693544121; 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=xe1xbdH/xT6jJNQNNe0POzpfV4nQ9OGL1SU1eZJ9fOA=; b=dFcEsYPKRBRcZzcdLua95wIshMf1kY5mZtmGmEcBnA0hd7eYSCA1lpLOw8F/NL/v9sjpgX mQeA2d8xls9rFLB9JRt3/W9wVOTGsowI2i3+tIBS1Icw/0Uu64PWywKEkJUS0VXeyfT1rw qvlW0yD3A9X6wnABo7LgLWj6UwZKDY3x592PzIYsMOyr+644seb2Tfb0+WDSGt3M1NrzQ3 v+wL84O5pRRR33VKX46sr5HVWMN+6Gjjg+d0XcUTgu7KDKnaLkoMOj8ItfhhdEfKS6H36e Xpjt2oA033HlJPTgHwag8b0x01ip1R9IP018TrA22WhzO6iV9/geNWRbkzaU5w== ARC-Authentication-Results: i=1; aspmx1.migadu.com; dkim=fail ("headers rsa verify failed") header.d=gmail.com header.s=20221208 header.b=czvnjMLS; dmarc=fail reason="SPF not aligned (relaxed)" header.from=gmail.com (policy=none); 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" ARC-Seal: i=1; s=key1; d=yhetil.org; t=1693544121; a=rsa-sha256; cv=none; b=sZMhkMjdGrRkN7Ywn5PadBMuu9cbyK+nl/wHr7aNtuHxIbm/k0zWN6Lqx9rcjhC0muMilt ZTGjt6opo4k58RjOEXmp6UMfyPIK1rSe0KmKtc9BxlHj1WamphHGvsJ4F72/BKf4utpG3+ lOY2bO/fkFI4zu16zEtE8g2SXzZovEDFxKmqA60lcnFPbS9vXlFH+40kxhnNhTy6fLKzX+ vPoG/EczkF7fJ9ooOPmhJ32YDPEeL8yYzowPKQpzFaYuXqNFdQLATio2N2ikGY05P9Kqhu nFDo/rAVjdz3E7ovZvVXoEbu/yErSiCXIIG7LUJkanRhbkG/NKEyD/enp6D9Mg== Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1qbwBM-0003mZ-FH; Fri, 01 Sep 2023 00:54:56 -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 1qbwBK-0003lS-EF for bug-guix@gnu.org; Fri, 01 Sep 2023 00:54:54 -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 1qbwBK-0006UI-5X for bug-guix@gnu.org; Fri, 01 Sep 2023 00:54:54 -0400 Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1qbwBT-00019X-1z; Fri, 01 Sep 2023 00:55:03 -0400 X-Loop: help-debbugs@gnu.org Subject: bug#65575: [PATCH v3 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: Fri, 01 Sep 2023 04:55: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.16935440774367 (code B ref 65575); Fri, 01 Sep 2023 04:55:03 +0000 Received: (at 65575) by debbugs.gnu.org; 1 Sep 2023 04:54:37 +0000 Received: from localhost ([127.0.0.1]:59655 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1qbwB3-00018M-Cl for submit@debbugs.gnu.org; Fri, 01 Sep 2023 00:54:37 -0400 Received: from mail-qt1-x829.google.com ([2607:f8b0:4864:20::829]:61465) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1qbwB1-00017f-Jf for 65575@debbugs.gnu.org; Fri, 01 Sep 2023 00:54:36 -0400 Received: by mail-qt1-x829.google.com with SMTP id d75a77b69052e-4132c2cee1dso10309841cf.2 for <65575@debbugs.gnu.org>; Thu, 31 Aug 2023 21:54:26 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20221208; t=1693544061; x=1694148861; darn=debbugs.gnu.org; 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=xe1xbdH/xT6jJNQNNe0POzpfV4nQ9OGL1SU1eZJ9fOA=; b=czvnjMLS7o9wxa4dAwBzSsAmGDnejL49NbHxRmlH6fVDj1bmFEdACBsZZtfHZR9dmN cQ8SiMcL+23v1YMA4XfOKF33HasDasgF47OgFIVO2/lNyKqKNfEt5M1wZPSGL1ao1MJQ veX0o5riGnBg/OO7dlRPeSF7RqwZRuH3z1/gnLU+0Sm1Dq2irCTB0whTqKGC/ByKEIxJ r7vrvxxc3wwNhuRXZVwX8Mn9pvXIt3cURMuJODHn3m5zEAFTgJmoDCjEX0BAAnhzSQP4 rF12SbrjlF542ts4+WoaYgRZSTUjJEWuwGqjGO/YcCpKcftp1JqhdirXigTp6O99RWDL cCnA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1693544061; x=1694148861; 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=xe1xbdH/xT6jJNQNNe0POzpfV4nQ9OGL1SU1eZJ9fOA=; b=STAtE5bP1+jUnKNkVUTtT867h3vMU11gNXi6IM7jsGAwRgVqXzGCjGTvk8UUSj4jOC 7Lc00b/654b0jz6vybjNHqai3lf+m2CvnMiotmxEFUfu8urNgxQoZBm67+qPIbBZi4jz 5G2hu8I20RnFGwyhgqHc79bk+DedGOSgDa7BcbhQ52WTgrNErsZORD3ZwVdffKfReO4e US7RZvBW62ltLyhR+jHVEYFAFwYhdq1UwCHUVU2gWIn/sB5KI7v7++5y8sxv0B1iGJst LFckFJZrFefx5oygm5gChVkMwZMhozlwBr5e1Vwxvz0nN29hWOUIYM1k52MJvGu7H4Nd y09g== X-Gm-Message-State: AOJu0YwZectn9DL5Qbs/G3+uaAvTNd40uk75u+22u8xLEOW+V4BhBweX BQ4yddq8o19cK8fZJp56sjOY2y+Ioyg= X-Google-Smtp-Source: AGHT+IHPzl0n/V7ky0oOJPx1bh5rBgridIBIirq/0Z4OizSNEbI7VaAVBC1kk3/IhOFv509b/6Vy9Q== X-Received: by 2002:ac8:5bc3:0:b0:40f:ffd3:61fc with SMTP id b3-20020ac85bc3000000b0040fffd361fcmr1799630qtb.9.1693544060926; Thu, 31 Aug 2023 21:54:20 -0700 (PDT) Received: from localhost.localdomain (dsl-10-128-23.b2b2c.ca. [72.10.128.23]) by smtp.gmail.com with ESMTPSA id v15-20020ac8748f000000b00410ad87b1e0sm1176627qtq.46.2023.08.31.21.54.20 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 31 Aug 2023 21:54:20 -0700 (PDT) From: Maxim Cournoyer Date: Fri, 1 Sep 2023 00:53:21 -0400 Message-ID: X-Mailer: git-send-email 2.41.0 In-Reply-To: References: 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-Flow: FLOW_IN X-Migadu-Country: US X-Migadu-Scanner: mx1.migadu.com X-Migadu-Spam-Score: -3.12 X-Spam-Score: -3.12 X-Migadu-Queue-Id: CD4E64101A X-TUID: cYj4Os3Of6u2 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): Reload subdirs.el files unless NO-RELOAD 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. * gnu/packages/emacs.scm (emacs) [arguments] : Call guix-emacs-autoload-packages with an argument in the site-start.el file. --- Changes in v3: - Invert argument logic of guix-emacs-autoload-packages - Drop the guix-emacs-autoload-packages-called state variable - Adjust site-start.el file in Emacs package 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 | 15 ++++++++++++--- gnu/packages/emacs.scm | 2 +- 3 files changed, 20 insertions(+), 8 deletions(-) diff --git a/doc/guix.texi b/doc/guix.texi index 04e5875925..939e669fee 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..c253e64df8 100644 --- a/gnu/packages/aux-files/emacs/guix-emacs.el +++ b/gnu/packages/aux-files/emacs/guix-emacs.el @@ -65,12 +65,21 @@ The files in the list do not have extensions (.el, .elc)." (guix-emacs--non-core-load-path)))) ;;;###autoload -(defun guix-emacs-autoload-packages () +(defun guix-emacs-autoload-packages (&optional no-reload) "Autoload Emacs packages found in EMACSLOADPATH. 'Autoload' means to load the 'autoloads' files matching -`guix-emacs-autoloads-regexp'." - (interactive) +`guix-emacs-autoloads-regexp'. By default, the subdirs.el files +found on the load path are reloaded to discover newly installed +packages, unless NO-RELOAD is provided." + (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. + (unless no-reload + (mapc #'guix-emacs--load-file-no-error (guix-emacs--subdirs-files)) + (setq load-path (delete-dups load-path))) + (let ((autoloads (mapcan #'guix-emacs-find-autoloads (guix-emacs--non-core-load-path)))) (mapc #'guix-emacs--load-file-no-error autoloads))) diff --git a/gnu/packages/emacs.scm b/gnu/packages/emacs.scm index d3689c2474..d9af6b96a7 100644 --- a/gnu/packages/emacs.scm +++ b/gnu/packages/emacs.scm @@ -244,7 +244,7 @@ (define-public emacs (display (string-append "(when (require 'guix-emacs nil t)\n" - " (guix-emacs-autoload-packages)\n" + " (guix-emacs-autoload-packages 'no-reload)\n" " (advice-add 'package-load-all-descriptors" " :after #'guix-emacs-load-package-descriptors))")))) ;; Remove the extraneous subdirs.el file, as it causes Emacs to -- 2.41.0