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 sDo/JrDB7GR1EAAAauVa8A:P1 (envelope-from ) for ; Mon, 28 Aug 2023 17:48:00 +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 sDo/JrDB7GR1EAAAauVa8A (envelope-from ) for ; Mon, 28 Aug 2023 17:48:00 +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 32CB249F3F for ; Mon, 28 Aug 2023 17:48:00 +0200 (CEST) Authentication-Results: aspmx1.migadu.com; dkim=fail ("headers rsa verify failed") header.d=gmail.com header.s=20221208 header.b="AP3/En49"; 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=1693237680; 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=0MQ0HwWLERA8+9+em++d73asfZpnn4JlQ64mQbUzFBk=; b=BgFL2IP3pqunHYYLCLmUPIDCNztmu6rNG1R8UtKYpsmejc/cQzNKljPWqZl8h9XiCTof6T 6aydvyRnlrsZPQhD1V3B42C+gV5eZ266dFRa0nEwQta7wqWJBnOZoi1+l2YXU62DkgWD5M u9RbOrDWjP45GpjCgXbJd3GPE2p8/6dT5iQApaY4/F9jaFWIrJbBTiZQCIJGbvTQ2V5R0u ieaTezyCd1lMEorDiCoEG5G2zrWED9mXCyIXMdyPCHVQajBSha8uoLRVM7/HXUK2BVCveE xLVycBTo2p32h0FXR+/PG2GQgrDe+7MY8dtxfx151gqvY8AVHjS5Cu4hzHa2fw== ARC-Seal: i=1; s=key1; d=yhetil.org; t=1693237680; a=rsa-sha256; cv=none; b=jkDi9g1SRA27ohWEsEGR/gJBzaHwm26l0UYy0Enz2hfEfwTsa5z4lkXKWE0xb4KbGlSIWE mqcNjty8+AReeWebFEDyQ28/b3+fXWtbtm6AJNABvrtJ/CeBz00KpT76dMWTvt/tcEAjoz NcF6Uust8RpbICgTtg8jkjNRrSgjAXWG6pBbTOR54tZHvJWMq86HsqjJEgvv5gRfPcEeEO 2EIgabiH13wUEbwY9iwHDuIz4zMtTeiKj0qvjsVYy6Htg/mPAgkKV9je7LJsr3gBpYOPQk 0oRZafpj041h2hY5lfakGTvW9IS4d9R3dEAe5eOZnFkrExxNtYlAaHd13qlkvA== ARC-Authentication-Results: i=1; aspmx1.migadu.com; dkim=fail ("headers rsa verify failed") header.d=gmail.com header.s=20221208 header.b="AP3/En49"; 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 1qae46-0002Tc-3K; Mon, 28 Aug 2023 11:22:06 -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 1qae3w-0002DK-K7 for bug-guix@gnu.org; Mon, 28 Aug 2023 11:22: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 1qae3w-0007Wi-Bs for bug-guix@gnu.org; Mon, 28 Aug 2023 11:21:56 -0400 Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1qae42-0000Kq-G5 for bug-guix@gnu.org; Mon, 28 Aug 2023 11:22:02 -0400 X-Loop: help-debbugs@gnu.org Subject: bug#65575: [PATCH 3/3] gnu: emacs: Reload subdirs.el files in 'guix-emacs-autoload-packages'. Resent-From: Maxim Cournoyer Original-Sender: "Debbugs-submit" Resent-CC: bug-guix@gnu.org Resent-Date: Mon, 28 Aug 2023 15:22: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: Liliana Marie Prikler Cc: Liliana Marie Prikler , 65575@debbugs.gnu.org Received: via spool by 65575-submit@debbugs.gnu.org id=B65575.16932360651198 (code B ref 65575); Mon, 28 Aug 2023 15:22:02 +0000 Received: (at 65575) by debbugs.gnu.org; 28 Aug 2023 15:21:05 +0000 Received: from localhost ([127.0.0.1]:48789 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1qae37-0000JF-4w for submit@debbugs.gnu.org; Mon, 28 Aug 2023 11:21:05 -0400 Received: from mail-qk1-x72a.google.com ([2607:f8b0:4864:20::72a]:48631) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1qae33-0000IY-Uz for 65575@debbugs.gnu.org; Mon, 28 Aug 2023 11:21:03 -0400 Received: by mail-qk1-x72a.google.com with SMTP id af79cd13be357-76da4437500so177558085a.1 for <65575@debbugs.gnu.org>; Mon, 28 Aug 2023 08:20:55 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20221208; t=1693236050; x=1693840850; h=content-transfer-encoding:mime-version:user-agent:message-id :in-reply-to:date:references:subject:cc:to:from:from:to:cc:subject :date:message-id:reply-to; bh=0MQ0HwWLERA8+9+em++d73asfZpnn4JlQ64mQbUzFBk=; b=AP3/En49nP+fiq0u18jrRvH43zw5lrDyMIco5occnp0/2J3fdDBqVaTnpEDtvFX8Nj wxscu0SSEzAD/GhsoxVgxz+kb9+ZzuUWhmnd6Kh1AtlWy6Wxgie5uQVu+BPciBtyoUid PKsT6LfWXXMcmsuv177gJTBcNStOJ8SwbJl1AS2HqSc+lR/Hskd/LKgbXu3nE9G5txh/ jMk+5goP3D4P5uTJGLGFAzrsOfwHM/UijAEY0sqzSvBYZm/aKdBjIf+jB6l5N32f2lr2 c592wYzE3z5oP27VpKFND0G2RRaVrYqLIIexockHO4aGE0pvzlKGx3qLEeNN6rqTHZsX R1AA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1693236050; x=1693840850; h=content-transfer-encoding:mime-version:user-agent:message-id :in-reply-to:date:references:subject:cc:to:from:x-gm-message-state :from:to:cc:subject:date:message-id:reply-to; bh=0MQ0HwWLERA8+9+em++d73asfZpnn4JlQ64mQbUzFBk=; b=Dr8OM9eIJkucyrzJhoIZOp6smhRmiRC1++CaULyS89az1n3weDlQejh0/0Fk4Yq7Pq m3/H3fk6nl2czF1svDn6Zk88Tvnf9u3E3tJ1H8Ie+WDUwe0WzcjnaNFgM2lAVX7c5+So piZG1p8QzFE3ewV73xeH/npZLykWcwe31MOx9sL/u5AHN1ESYnLFmKwSwKk8uK0Bu36w f/P3Wea01TXYGILnOOmS5c6IpGytP2aZqUO9eiHtANE7xx10SR37cqjZnIvOUu3TjbFF 33U593u6mYagn/cavUwIGOnPJodvmfbjpzBcitu61V8xzMCC5+h8F/nNYAcTKzrj1sOe WGTQ== X-Gm-Message-State: AOJu0YwyKjSap/gFN23zLt8RRYuqoLR9VazqTG9FU4RExq9ZQebbT/ai 3y3kFP3rD0MhCuGD69Rrs/Y= X-Google-Smtp-Source: AGHT+IEdY5sCM3eYjZ1Fzd1/YjZskd7UMFDRoqncL21HAR2PWcds8m09qIy5euDtb4WIPs6GUvPVng== X-Received: by 2002:ad4:4349:0:b0:647:42bc:d00b with SMTP id q9-20020ad44349000000b0064742bcd00bmr19753048qvs.63.1693236049812; Mon, 28 Aug 2023 08:20:49 -0700 (PDT) Received: from hurd (dsl-10-132-204.b2b2c.ca. [72.10.132.204]) by smtp.gmail.com with ESMTPSA id s4-20020a05620a16a400b0076eed604793sm2409988qkj.130.2023.08.28.08.20.49 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 28 Aug 2023 08:20:49 -0700 (PDT) From: Maxim Cournoyer References: <6715bc07d825d632140c63bd98c959d31cc5de47.1693199493.git.maxim.cournoyer@gmail.com> <84a6b9e11ec0f8fcdd865dae40ab41100a5c763c.1693199493.git.maxim.cournoyer@gmail.com> <88f150c1356008a1d1c4251a8ec98afcd6e1b6f2.camel@ist.tugraz.at> Date: Mon, 28 Aug 2023 11:20:48 -0400 In-Reply-To: <88f150c1356008a1d1c4251a8ec98afcd6e1b6f2.camel@ist.tugraz.at> (Liliana Marie Prikler's message of "Mon, 28 Aug 2023 08:16:53 +0200") Message-ID: <87il8zgpm7.fsf@gmail.com> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/28.2 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable 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: -5.12 X-Spam-Score: -5.12 X-Migadu-Queue-Id: 32CB249F3F X-Migadu-Scanner: mx1.migadu.com X-TUID: xrHwqWiDw/5u Hi Liliana, Liliana Marie Prikler writes: > Hi Maxim, > > Am Montag, dem 28.08.2023 um 01:11 -0400 schrieb Maxim Cournoyer: >> 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 an all but >> the first call of this procedure. >> * doc/guix.texi (Application Setup): Document that >> 'guix-emacs-autoload-packages' can be invoked interactively to auto- >> reload newly installed Emacs packages. >> >> --- > Thank you for looking at this. I agree that even if we don't want to > generally load new packages into existing Emacs processes for the > breakages they might induce, not being able to do so at all is also not > a great option. However, I don't think that tracking is the right > solution here, see below. [...] >> diff --git a/gnu/packages/aux-files/emacs/guix-emacs.el >> b/gnu/packages/aux-files/emacs/guix-emacs.el >> index ed0c913163..b4a4fd1d91 100644 >> --- a/gnu/packages/aux-files/emacs/guix-emacs.el >> +++ b/gnu/packages/aux-files/emacs/guix-emacs.el >> @@ -54,6 +54,9 @@ The files in the list do not have extensions (.el, >> .elc)." >> =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0= =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 (e= xpand-file-name "subdirs.el" dir)) >> =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0= =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 (guix-emacs--n= on-core-load-path)))) >> =C2=A0 >> +(defvar guix-emacs-autoload-packages-called nil >> +=C2=A0 "True if `guix-emacs-autoload-packages' was already run.") >> + >> =C2=A0;;;###autoload >> =C2=A0(defun guix-emacs-autoload-packages () >> =C2=A0=C2=A0 "Autoload Emacs packages found in EMACSLOADPATH. >> @@ -61,6 +64,15 @@ The files in the list do not have extensions (.el, >> .elc)." >> =C2=A0'Autoload' means to load the 'autoloads' files matching >> =C2=A0`guix-emacs-autoloads-regexp'." >> =C2=A0=C2=A0 (interactive) >> +=C2=A0 ;; Reload the subdirs.el files such as the one generated by the >> Guix profile >> +=C2=A0 ;; hook, so that newly installed Emacs packages located under >> +=C2=A0 ;; sub-directories are put on the load-path without having to >> restart Emacs. >> +=C2=A0 (if guix-emacs-autoload-packages-called >> +=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 (progn >> +=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 (mapc #'load-file (guix-emac= s--subdirs-files)) >> +=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 (setq load-path (delete-dups= load-path))) >> +=C2=A0=C2=A0=C2=A0 (setq guix-emacs-autoload-packages-called t)) >> + > Rather than keeping track of whether the function was already called > (which would make debugging more tedious if you also have e.g. broken > packages from another source on your EMACSLOADPATH), I think the user > ought to signal their intent to reload the subdirs files via the > universal argument. > > e.g.=C2=A0 > (defun guix-emacs-autoload-packages (&optional reload) > =C2=A0"..." > (interactive "P") > (when reload (mapc #'load-file (guix-emacs--subdirs-files))) > ...) > > WDYT? The reason for avoiding loading the subdirs.el files on the first call is just an optimization, since it would at this time duplicate work already done by Emacs itself when it first executes. This shouldn't fail; I've now employed the same 'noerror strategy as used for autoloads to ensure that. There's one edge case I've just thought though, which is if a user invoked emacs with the documented '--no-site-file' option disabling loading autoloads; this would cause guix-emacs-autoload-packages-called to be nil. To balance between making things both convenient and flexible, I've preserved the tracking but also added the reload override you suggested. Let me know what you think. Thank you for the review! --=20 Thanks, Maxim