From unknown Sat Jun 21 03:10:39 2025 Content-Disposition: inline Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 X-Mailer: MIME-tools 5.509 (Entity 5.509) Content-Type: text/plain; charset=utf-8 From: bug#66376 <66376@debbugs.gnu.org> To: bug#66376 <66376@debbugs.gnu.org> Subject: Status: [PATCH] fix: correct emacs-guix not finding packages from user channels Reply-To: bug#66376 <66376@debbugs.gnu.org> Date: Sat, 21 Jun 2025 10:10:39 +0000 retitle 66376 [PATCH] fix: correct emacs-guix not finding packages from use= r channels reassign 66376 guix-patches submitter 66376 Sergio Pastor P=C3=A9rez severity 66376 normal tag 66376 patch thanks From debbugs-submit-bounces@debbugs.gnu.org Fri Oct 06 13:22:23 2023 Received: (at submit) by debbugs.gnu.org; 6 Oct 2023 17:22:23 +0000 Received: from localhost ([127.0.0.1]:52556 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1qooWs-0000EJ-QH for submit@debbugs.gnu.org; Fri, 06 Oct 2023 13:22:23 -0400 Received: from lists.gnu.org ([2001:470:142::17]:42482) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1qooWq-0000E7-Sk for submit@debbugs.gnu.org; Fri, 06 Oct 2023 13:22:21 -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 1qooWS-0008KK-L6 for guix-patches@gnu.org; Fri, 06 Oct 2023 13:21:56 -0400 Received: from mail-he1eur04olkn2070.outbound.protection.outlook.com ([40.92.73.70] helo=EUR04-HE1-obe.outbound.protection.outlook.com) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1qooWQ-0003y0-Pb for guix-patches@gnu.org; Fri, 06 Oct 2023 13:21:56 -0400 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=bJDogBVWTE/S0tDiErN51TKRR2Y3a8Y3aGGCyvs5zrbZdlZwVG5WvLBc4ACz+tSE6QvTDvWySJcKnjYcrdOcKyX2rvTmfpCpKZhNupTUcC6kQWt61/C7ZJbGS5RIBm9wB8vuGwNxFs5dpY1LgE6cBkhwGMCi0pb88Ke3zjSy7BRNDbUa8BvIPEZl2e8OPCRKeWfhRKZ1ynjuCdjWLAd6/3JsajiP3KDr0BlYX85aiziNtaCtjSZ744cCZCI59DxOfKgqcn6qgsiE0hDlQStnnd8Z0W8KZFaseBuFdbWII5mslxmG7ZWJQk9AcB+mOv2thi8B1ERc305dcuHCqVvBMw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=yXUbx75bi9LHNaV4ubpmgkuPgKqfcesRPab60YvioKI=; b=avD6jPWPAFnrNDeK+WoDYVQkCClV3tamyA1xWngfzV0c9wB4O6SekflYnTY2rnxBdY8AatrwTL+ABon+7G3dGFV0cAXQkdeMYDMOAhR78gNS5KOh5urfIcSkdAJOJxIH9rz6zc0FyT1An/FtiWX1B2fSgj1g3lnZd9lEPzCGnJjRDWu6HTJHKJrLiPe6jj90GLmtyqhJHWpwzGlKmDQLarF5Bunl6j9AncVk0V/nD8hbWokJVXCVjR7h9JBvjNiHntXKiqd+sOD8o2jT+qunKGaLp2I7KYLhmv2Kx1Ulk2Bg1fLXIurYDAMl1i7sEiXPg6yWrn+9PIuJviPskUR3pg== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=none; dmarc=none; dkim=none; arc=none Received: from DU2P193MB2132.EURP193.PROD.OUTLOOK.COM (2603:10a6:10:2f8::9) by DB9P193MB1259.EURP193.PROD.OUTLOOK.COM (2603:10a6:10:23f::21) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6838.38; Fri, 6 Oct 2023 17:21:52 +0000 Received: from DU2P193MB2132.EURP193.PROD.OUTLOOK.COM ([fe80::5693:2d5:c58c:e127]) by DU2P193MB2132.EURP193.PROD.OUTLOOK.COM ([fe80::5693:2d5:c58c:e127%4]) with mapi id 15.20.6838.033; Fri, 6 Oct 2023 17:21:52 +0000 From: =?UTF-8?q?Sergio=20Pastor=20P=C3=A9rez?= To: guix-patches@gnu.org Subject: [PATCH] fix: correct emacs-guix not finding packages from user channels Date: Fri, 6 Oct 2023 18:52:54 +0200 Message-ID: X-Mailer: git-send-email 2.41.0 Content-Transfer-Encoding: 8bit Content-Type: text/plain X-TMN: [6NtpojrsX6QAt4AQI6bS1X9sVFRoi8d0] X-ClientProxiedBy: MR2P264CA0186.FRAP264.PROD.OUTLOOK.COM (2603:10a6:501::25) To DU2P193MB2132.EURP193.PROD.OUTLOOK.COM (2603:10a6:10:2f8::9) X-Microsoft-Original-Message-ID: <20231006172116.22755-1-sergio.pastorperez@outlook.es> MIME-Version: 1.0 X-MS-Exchange-MessageSentRepresentingType: 1 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: DU2P193MB2132:EE_|DB9P193MB1259:EE_ X-MS-Office365-Filtering-Correlation-Id: fb32caf1-7e28-442b-9c33-08dbc690bafc X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: 4bDsMwabFZvHtJ98Qdrm69L9QgGxKlVg6zwOUUWXsFuxDfxVv+Rj8cCDWyNbnmWPK8vdlwWmyG4hki3VVl2Qw+1CGafVPdbwrxOASXdi3WI+oDqPYhS+biAPHlylt2A97wuJkz9iRP/Z0J22jGbuEDwnK4NJIQ/qG/hemBCty5wsH+FfFm1/sySJqZLSEWChPW65K7ML0zwCFP5OXbt6YFpZh2et6fR9UhnDkpyjhBD7ZIoCmQlX9N26klgKAkWt7HkeA+v+21kyjBSBkQlXqjjf3/ZFIWwgFW5IFeINK9luzHTRXi9HMR+1AivbN5EapZCH0uq9tx9QgW1RqPVVbPkR/pLxsTXxfQBJUR8Jvh8jHOJmbfy4gwMcrH1+fKrD3u8NJnu1N9mV1WBC+AUyUfBjq0NIhKbQXpYvzEYiMddg8aWutB4RgQFXfnClg+dHINGC0gS9TP7ok9eJi0Vv496vBvZcqXadV4L296nM9eimy5qZiaTkpmNxbBYyXN5Prs+2Ve40DhQZSXhkK8rfko5ntmhHdBGIgl3MZ6rQfV9chOSXh6+p+07ZZRgE1LuwFN5fgclZ8IFFgbd4aexnqpFw0O5gZ6dSDkk3cvp/Cv0= X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: =?us-ascii?Q?ZkSOA13kafQHZwwvYsNA6yscbHSeeN+z+UU4+VrH61/xcwJPSgmKZTRgdATh?= =?us-ascii?Q?BUE9APW3dpgY2+TePrfH97KmZZ0+YehigAh4BHNEL1uB4NZmZuL+ag5BnNZx?= =?us-ascii?Q?IcfxSQDkaHv0nhl35AqyeSadz3uHYzhKMHkFtxO8vuyKegYcyYZrKYhruzqq?= =?us-ascii?Q?8PhjhqyDNX9NUTKPp6ixubzhriL8g09mW3au7LeyhvIWbKcWi9xcLqy7Mq5B?= =?us-ascii?Q?Jw4qbP5uwAjZXZyonleKe2loxV2ZUZEu86bRGZhmDhpIO+/pLGWvon1q1rLW?= =?us-ascii?Q?5G5OXYoAKuF9DNI4o62mMAYlGnHGn0XGdzpdXav76wCmbxEsmvVzAiN11vT7?= =?us-ascii?Q?lUeJo0iGvPjb8vXG1JALil8jjFrO2ewZHAW9RNJOBI7GxLpqfe9DlmxXGb/4?= =?us-ascii?Q?VvJSSq86ooPKHdjIjJnpHyAAoph/eqzOAnvzFrhOv5YYQVfUnq3OMGMJI872?= =?us-ascii?Q?ifbBCABGz8aqDhiGXhEuw/tN8EqpJqb4/kHHLFq75c60VxHpblXdGU5jzRes?= =?us-ascii?Q?qvqWWuXTW4Nj36vWjXA6KKZ+/+OUkP6mc7zv/38AhjQCgBux5RFcfGn3m98T?= =?us-ascii?Q?jmx1b7L48aKBJUhZcm5StCRpbkJP76xA+6JqOjUcYeKAXFKsvoFTjKDn8Uoe?= =?us-ascii?Q?oM2p3WEuLD5+JzGIqaqCtIqak4wjmPxTYxvxAfwklWscDfeEmQkln7wb8Tv3?= =?us-ascii?Q?vRQ5W9G1NgvoIL4PR+HSgq3wXjJiNBd41QykAy1Zya9IpI35ZN6izpcVSUbE?= =?us-ascii?Q?3/Be5TNdgwkU1Hu60iFx1JWAJgfilgonG5/DEAvMcyyq/Vz207zNOlcU23Ey?= =?us-ascii?Q?BZFONVwzPa2UGGjVKpj6G4g8zfxljkyY1NCVvwDpgbB9u72MhD0NpIh5yW/R?= =?us-ascii?Q?xhLWZ/oQyd2oWPqJZ38vhcWKUeTMYT4hWOCG1fF+SuZAIy3QN1qrI64ENLpC?= =?us-ascii?Q?a1XEqfcQg6gQaAQ3g/dDONUzhzjjazPU6aduplyawBVzluEDWsu8wJaot2Dl?= =?us-ascii?Q?OSAeNgc8Y21Fsgl5gi05Ir42mx6w/HxV+fSjFJiDiXw9J7dtp8Ituc730yuY?= =?us-ascii?Q?QAjWN9netgWGYfc3jzFMt/a9tY4+n/I25r/qRAbuurg7PkfG3k0/oPiJ+1Zh?= =?us-ascii?Q?iTEW+fi5zmZEWKcCYFLoc/TSuc4s76df9BTZbVx8oGR8TKnRsf+bqoB9W+jO?= =?us-ascii?Q?mRbACg9vc4m99DOwjIFLYxl7DSqcD5qiN9jBf1vwVJDVGqbctOkKJ4D4KtE?= =?us-ascii?Q?=3D?= X-OriginatorOrg: sct-15-20-4755-11-msonline-outlook-80ceb.templateTenant X-MS-Exchange-CrossTenant-Network-Message-Id: fb32caf1-7e28-442b-9c33-08dbc690bafc X-MS-Exchange-CrossTenant-AuthSource: DU2P193MB2132.EURP193.PROD.OUTLOOK.COM X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 06 Oct 2023 17:21:52.0436 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 84df9e7f-e9f6-40af-b435-aaaaaaaaaaaa X-MS-Exchange-CrossTenant-RMS-PersistedConsumerOrg: 00000000-0000-0000-0000-000000000000 X-MS-Exchange-Transport-CrossTenantHeadersStamped: DB9P193MB1259 Received-SPF: pass client-ip=40.92.73.70; envelope-from=sergio.pastorperez@outlook.es; helo=EUR04-HE1-obe.outbound.protection.outlook.com X-Spam_score_int: -23 X-Spam_score: -2.4 X-Spam_bar: -- X-Spam_report: (-2.4 / 5.0 requ) BAYES_00=-1.9, FREEMAIL_FROM=0.001, RCVD_IN_DNSWL_NONE=-0.0001, RCVD_IN_MSPIKE_H2=-0.499, SPF_HELO_PASS=-0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-Spam-Score: 3.0 (+++) X-Spam-Report: Spam detection software, running on the system "debbugs.gnu.org", has NOT identified this incoming email as spam. The original message has been attached to this so you can view it or label similar future email. If you have any questions, see the administrator of that system for details. Content preview: --- Hi. I've noticed that `emacs-guix' is not able to fetch packages from user channels. This is a quick fix that could be implemented much easier with some help. As you can see, there is lots of redundant code from modules of the guix core, such as: 'gnu/packages.scm' as well as 'guix/describe.scm'. Content analysis details: (3.0 points, 10.0 required) pts rule name description ---- ---------------------- -------------------------------------------------- 0.0 FREEMAIL_FROM Sender email is commonly abused enduser mail provider (sergio.pastorperez[at]outlook.es) -0.0 SPF_HELO_PASS SPF: HELO matches SPF record 1.0 SPF_SOFTFAIL SPF: sender does not match SPF record (softfail) 2.0 SPOOFED_FREEMAIL No description available. X-Debbugs-Envelope-To: submit Cc: =?UTF-8?q?Sergio=20Pastor=20P=C3=A9rez?= X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -0.0 (/) --- Hi. I've noticed that `emacs-guix' is not able to fetch packages from user channels. This is a quick fix that could be implemented much easier with some help. As you can see, there is lots of redundant code from modules of the guix core, such as: 'gnu/packages.scm' as well as 'guix/describe.scm'. The issue is that neither of the functions exposed, which are used on the call hierarchy, accept a parameter for targeting a profile so all this functions need to be reimplemented to change the lowest function on the call hierarchy. I thought of using: --8<---------------cut here---------------start------------->8--- (module-define! (resolve-module '(guix describe)) 'current-profile (lambda () "Return the profile (created by 'guix pull') the calling process lives in, or #f if this is not applicable." (find (lambda (str) (string-contains str "current-guix")) (user-profiles)))) --8<---------------cut here---------------end--------------->8--- But this is not possible since most of the functions up in the call hierarchy are memoized with `mlambda'. For now this is what I'm using for myself. I submit this patch hopping that someone will have a more elegant solution. Will it be okay to redefine the functions from the guix core into generic ones that accept a profile as a parameter? The ones we have could just call the more generic one with a specific parameter so they will be the 'curried' versions. What do you think? Any ideas? Have a nice day, Sergio. scheme/emacs-guix/packages.scm | 14 ++++-- scheme/emacs-guix/profiles.scm | 79 +++++++++++++++++++++++++++++++++- 2 files changed, 88 insertions(+), 5 deletions(-) diff --git a/scheme/emacs-guix/packages.scm b/scheme/emacs-guix/packages.scm index aba04d8..928a99d 100644 --- a/scheme/emacs-guix/packages.scm +++ b/scheme/emacs-guix/packages.scm @@ -338,6 +340,7 @@ See `fold-packages' for the meaning of SELECT?." (cons pkg res) res)) '() + all-current-guix-package-modules #:select? select?)) (define (filter-packages-by-output packages output) @@ -783,7 +786,8 @@ get information with all available parameters, which are: 'id', 'name', "Return a list of names of available packages." (fold-packages (lambda (pkg res) (cons (package-name pkg) res)) - '())) + '() + all-current-guix-package-modules)) (define (package-names*) "Return to emacs side a list of names of available packages." @@ -792,7 +796,8 @@ get information with all available parameters, which are: 'id', 'name', (define (number-of-packages) "Return the number of available packages." (fold-packages (lambda (_ sum) (1+ sum)) - 0)) + 0 + all-current-guix-package-modules)) ;;; Package locations @@ -809,7 +814,8 @@ get information with all available parameters, which are: 'id', 'name', (let ((file (location-file (package-location package)))) (vhash-cons file package table))) - vlist-null))) + vlist-null + all-current-guix-package-modules))) (files (delay (vhash-fold (lambda (file _ result) (if (member file result) diff --git a/scheme/emacs-guix/profiles.scm b/scheme/emacs-guix/profiles.scm index 4792b25..5c9b224 100644 --- a/scheme/emacs-guix/profiles.scm +++ b/scheme/emacs-guix/profiles.scm @@ -27,6 +27,12 @@ (define-module (emacs-guix profiles) #:use-module (ice-9 match) #:use-module (srfi srfi-1) + #:use-module (srfi srfi-71) + #:use-module ((gnu packages) + #:select (%default-package-module-path)) + #:use-module ((guix discovery) + #:select (all-modules)) + #:use-module (guix memoization) #:use-module (guix profiles) #:use-module (guix search-paths) #:use-module ((guix scripts package) @@ -39,7 +45,8 @@ manifest-entry-dependencies-file-names search-paths-specifications search-paths - user-profiles)) + user-profiles + all-current-guix-package-modules)) ;;; Manifest entries @@ -154,4 +161,74 @@ Each specification is (VARIABLE SEPARATOR PATH) list." (generation-profile root))) (gc-roots)))) +(define current-guix-profile + (mlambda () + "Return the profile (created by 'guix pull') the calling process lives in, +or #f if this is not applicable." + (find (lambda (str) + (string-contains str "current-guix")) + (user-profiles)))) + +(define current-guix-profile-entries + (mlambda () + "Return the list of entries in the 'guix pull' profile the calling process +lives in, or the empty list if this is not applicable." + (match (current-guix-profile) + (#f '()) + (profile + (let ((manifest (profile-manifest profile))) + (manifest-entries manifest)))))) + +(define current-guix-channel-entries + (mlambda () + "Return manifest entries corresponding to extra channels--i.e., not the +'guix' channel." + (remove (lambda (entry) + (or (string=? (manifest-entry-name entry) "guix") + + ;; If ENTRY lacks the 'source' property, it's not an entry + ;; from 'guix pull'. See . + (not (assq 'source (manifest-entry-properties entry))))) + (current-guix-profile-entries)))) + +(define (current-guix-package-path-entries) + "Return two values: the list of package path entries to be added to the +package search path, and the list to be added to %LOAD-COMPILED-PATH. These +entries are taken from the 'guix pull' profile the calling process lives in, +when applicable." + ;; Filter out Guix itself. + (unzip2 (map (lambda (entry) + (list (string-append (manifest-entry-item entry) + "/share/guile/site/" + (effective-version)) + (string-append (manifest-entry-item entry) + "/lib/guile/" (effective-version) + "/site-ccache"))) + (current-guix-channel-entries)))) + +(define %current-guix-package-module-path + ;; Search path for package modules. Each item must be either a directory + ;; name or a pair whose car is a directory and whose cdr is a sub-directory + ;; to narrow the search. + (let* ((not-colon (char-set-complement (char-set #\:))) + (environment (string-tokenize (or (getenv "GUIX_PACKAGE_PATH") "") + not-colon)) + (channels-scm channels-go (current-guix-package-path-entries))) + ;; Automatically add channels and items from $GUIX_PACKAGE_PATH to Guile's + ;; search path. For historical reasons, $GUIX_PACKAGE_PATH goes to the + ;; front; channels go to the back so that they don't override Guix' own + ;; modules. + (set! %load-path + (append environment %load-path channels-scm)) + (set! %load-compiled-path + (append environment %load-compiled-path channels-go)) + + (make-parameter + (append environment + %default-package-module-path + channels-scm)))) + +(define all-current-guix-package-modules + (all-modules (%current-guix-package-module-path))) + ;;; profiles.scm ends here -- 2.41.0 From debbugs-submit-bounces@debbugs.gnu.org Tue May 06 04:55:51 2025 Received: (at 66376) by debbugs.gnu.org; 6 May 2025 08:55:52 +0000 Received: from localhost ([127.0.0.1]:50871 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1uCE5d-0007k4-D0 for submit@debbugs.gnu.org; Tue, 06 May 2025 04:55:51 -0400 Received: from mail-ed1-x52f.google.com ([2a00:1450:4864:20::52f]:43414) by debbugs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.84_2) (envelope-from ) id 1uCE5Y-0007jZ-7Y for 66376@debbugs.gnu.org; Tue, 06 May 2025 04:55:46 -0400 Received: by mail-ed1-x52f.google.com with SMTP id 4fb4d7f45d1cf-5e5deb6482cso11729497a12.1 for <66376@debbugs.gnu.org>; Tue, 06 May 2025 01:55:44 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=sarg.org.ru; s=google; t=1746521738; x=1747126538; darn=debbugs.gnu.org; h=content-transfer-encoding:mime-version:message-id:date:user-agent :subject:cc:to:from:from:to:cc:subject:date:message-id:reply-to; bh=tjHtA4Q/lgxztNAOU6fVjeoc5SLYDH1VznxxuR1ntTA=; b=SEvfMTmOp3YCUrW4iyvxNX0xKMfDP5OHL77nyoNTO3iFHjtTVdVVkhHUihsJeZbhyb TsSIAnYXlBlMfvi17zDiQ2KZel/FvgXA+McMpEEdZk1JN2X/PpYuicmadkgjRibY+jVm VXs7swgON1k8KHWv7B9nrA/YVYrEprh+uWZt/Jam5b7CuqRwnIf5DlNoFux31INLkh1Q IbY+jnxSThGQyWSVCMaVJV3mRTkJxaG9PDFOHtQryvdQSXyO/UT3yxzg66Xp0cpsTxuH LNj2drklJl1uQxLAG4ZVBevEGPaQ3oIx9a3RN02NHV+wU2TvhT5pLSIAz/tjVI1GFasf BoEQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1746521738; x=1747126538; h=content-transfer-encoding:mime-version:message-id:date:user-agent :subject:cc:to:from:x-gm-message-state:from:to:cc:subject:date :message-id:reply-to; bh=tjHtA4Q/lgxztNAOU6fVjeoc5SLYDH1VznxxuR1ntTA=; b=igOalHx2BBqiINEgHNfJHyQT1Pyz0+U/SQ1r3aCsiZ/RdCgDkooY36g9Lq/5nhlTqE 1PDGnRyiMxge5KNYpRXb2lFmLLUm90tqDz6vjYmoxdNQwJHt/teXYmqpUdvkPwSTGxCs XEgHv3IYHbKDqcGh1MM3dSBD6pyujDRIUWB6nMsbfsvqAGGgQboOSOxLjsxUVzjQlDpt 5RS0MHqiWUxHYGVG327UhSQAwVwsBtEicg2LYocZmw2WTJYzGlkpfkIR07lSQ2Tox5zw W4VHuCPXvZU869HyFllY6K4WrrcWABuuKnpXWrGHQ0QyTPxKW4m0i4vb1kmIzMVGAzfC iOEg== X-Gm-Message-State: AOJu0YzM1nXK468YKmKYtpHM8Bb18YFFjfRJs/7v2s4iPL8bGNkBJg6b D4e3o2xUG+m1fBudjcUqwESYlkNZYsabOAbOsJmJlpS4LE6DkqPYBJ9g6rrU0JE= X-Gm-Gg: ASbGnctIMTGziOHzZFpeIrJJgX5SbYHoMZ03uUedP+XOglK/6R6V1Mh1yEPoHzfEVyn ElAC3CJ+/oXX6euyOBTp5x1fJjQlVVfxDm03mfWqKK0Hx7aunIi2kZvfiEqlimIl1Ab/+GYuhhM CKERRJIKNYbg1CYh8VYNCzjeOBn2WxORi2QLyBccZtRICZrcRXzBbSLd6/4djKNjNeEOK0l4+Zh DkFY3zvZgLlXUgVw8h4hJ3Orzi7Pxfco611w7l6k9l/EKqk4SEwPyucN3KkjvGpSGrzP/qmZ7k/ tuhXhW8oTHqU17LaaY/74wydRg/ycx2WIvSgUQ== X-Google-Smtp-Source: AGHT+IENtCgd4Koss5DvQY5V+ttfI8CJ8F3Cwu9KWJnpt2UV4fDz9TANd3oxF6DLTuDc4FAIorDSZA== X-Received: by 2002:a17:906:9c8b:b0:acf:1646:6021 with SMTP id a640c23a62f3a-ad1d2f2ff6fmr185425466b.25.1746521737542; Tue, 06 May 2025 01:55:37 -0700 (PDT) Received: from localhost ([2a02:2454:a095:5600:a64e:31ff:fe38:fd6c]) by smtp.gmail.com with ESMTPSA id a640c23a62f3a-ad18914d067sm662914566b.3.2025.05.06.01.55.36 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 06 May 2025 01:55:37 -0700 (PDT) From: Sergey Trofimov To: Sergio Pastor =?utf-8?Q?P=C3=A9rez?= Subject: Re: [bug#66376] [PATCH] fix: correct emacs-guix not finding packages from user channels User-Agent: mu4e 1.12.9; emacs 30.0.92 Date: Tue, 06 May 2025 10:55:35 +0200 Message-ID: <87msbqqfso.fsf@sarg.org.ru> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Spam-Score: 0.0 (/) X-Debbugs-Envelope-To: 66376 Cc: 66376@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.0 (-) Hi Sergio, Sergio Pastor Pérez writes: > --- > Hi. > > I've noticed that `emacs-guix' is not able to fetch packages from user > channels. This is a quick fix that could be implemented much easier with some > help. > > As you can see, there is lots of redundant code from modules of the guix core, > such as: 'gnu/packages.scm' as well as 'guix/describe.scm'. > > The issue is that neither of the functions exposed, which are used on the call > hierarchy, accept a parameter for targeting a profile so all this functions need > to be reimplemented to change the lowest function on the call hierarchy. > > I thought of using: > > (module-define! (resolve-module '(guix describe)) 'current-profile > (lambda () > "Return the profile (created by 'guix pull') the calling process lives in, > or #f if this is not applicable." > (find (lambda (str) > (string-contains str "current-guix")) > (user-profiles)))) > > > But this is not possible since most of the functions up in the call hierarchy > are memoized with `mlambda'. > > For now this is what I'm using for myself. I submit this patch hopping that someone will have a more elegant solution. > > Will it be okay to redefine the functions from the guix core into generic ones > that accept a profile as a parameter? > > The ones we have could just call the more generic one with a specific parameter > so they will be the 'curried' versions. > > What do you think? Any ideas? > %package-module-path is a parameter, which could be set when initializing the REPL. It would make `fold-packages` use the right list of modules. So try running this just after `M-x guix-switch-to-repl`. Then `M-x guix-package-locations` should show the locations from your channels. --8<---------------cut here---------------start------------->8--- (guix-eval-in-repl (format "((@ (gnu packages) %%package-module-path) '%S)" (append (guix-list-maybe guix-load-path) (guix-list-maybe (when guix-repl-use-latest (guix-guile-site-directory guix-pulled-profile)))))) --8<---------------cut here---------------end--------------->8---