From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mp1 ([2001:41d0:8:6d80::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by ms0.migadu.com with LMTPS id wBLHFY7IN2HgjAAAgWs5BA (envelope-from ) for ; Tue, 07 Sep 2021 22:16:14 +0200 Received: from aspmx1.migadu.com ([2001:41d0:8:6d80::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by mp1 with LMTPS id SBKPEY7IN2EcJgAAbx9fmQ (envelope-from ) for ; Tue, 07 Sep 2021 20:16:14 +0000 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 B47B7D0E7 for ; Tue, 7 Sep 2021 22:16:13 +0200 (CEST) Received: from localhost ([::1]:41294 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1mNhVs-0005df-Rz for larch@yhetil.org; Tue, 07 Sep 2021 16:16:12 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:46500) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1mNhVj-0005cK-66 for guix-patches@gnu.org; Tue, 07 Sep 2021 16:16:03 -0400 Received: from debbugs.gnu.org ([209.51.188.43]:46361) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1mNhVi-0003tE-C8 for guix-patches@gnu.org; Tue, 07 Sep 2021 16:16:02 -0400 Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1mNhVi-0002u6-6f for guix-patches@gnu.org; Tue, 07 Sep 2021 16:16:02 -0400 X-Loop: help-debbugs@gnu.org Subject: [bug#50286] [RFC PATCH] Let 'package-location' returns location of surrounding 'let'. Resent-From: Sarah Morgensen Original-Sender: "Debbugs-submit" Resent-CC: guix-patches@gnu.org Resent-Date: Tue, 07 Sep 2021 20:16:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 50286 X-GNU-PR-Package: guix-patches X-GNU-PR-Keywords: patch To: Ludovic =?UTF-8?Q?Court=C3=A8s?= Cc: Maxime Devos , 50286@debbugs.gnu.org Received: via spool by 50286-submit@debbugs.gnu.org id=B50286.163104575511144 (code B ref 50286); Tue, 07 Sep 2021 20:16:02 +0000 Received: (at 50286) by debbugs.gnu.org; 7 Sep 2021 20:15:55 +0000 Received: from localhost ([127.0.0.1]:57907 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1mNhVb-0002tf-De for submit@debbugs.gnu.org; Tue, 07 Sep 2021 16:15:55 -0400 Received: from out0.migadu.com ([94.23.1.103]:51613) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1mNhVY-0002tW-Fl for 50286@debbugs.gnu.org; Tue, 07 Sep 2021 16:15:54 -0400 X-Report-Abuse: Please report any abuse attempt to abuse@migadu.com and include these headers. DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=mgsn.dev; s=key1; t=1631045751; h=from:from: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: in-reply-to:in-reply-to:references:references; bh=306agVEWYZd7TGmh0Y6CTVt8Q+bYH6WUuMxJkBbCPqc=; b=N1pgBjWYP0EJFHmTzlfbvKqyF12bMv9RB1Asyje8+CeC7BstIXGuc9P/POW4nUJDRNGbte h/u/NHxQkZt7AM/XbQiCuNW38O9/kVJeXLuSLlssSSXDj/YSEMj7m3gUsCTAbptRJIa7/5 XjbOHVNTSJ7aS3/HBXZ84utNJnvGh2w= From: Sarah Morgensen References: <0b61652d751633f78e876a27be88ed14e47527b6.camel@telenet.be> <87o89681br.fsf@gnu.org> <875yvc4254.fsf_-_@gnu.org> Date: Tue, 07 Sep 2021 13:15:48 -0700 In-Reply-To: <875yvc4254.fsf_-_@gnu.org> ("Ludovic =?UTF-8?Q?Court=C3=A8s?="'s message of "Tue, 07 Sep 2021 21:27:35 +0200 (8 minutes, 50 seconds ago)") Message-ID: <86wnnsgn0r.fsf@mgsn.dev> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable X-Migadu-Auth-User: iskarian@mgsn.dev X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-BeenThere: guix-patches@gnu.org List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: guix-patches-bounces+larch=yhetil.org@gnu.org Sender: "Guix-patches" X-Migadu-Flow: FLOW_IN ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=yhetil.org; s=key1; t=1631045773; 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=306agVEWYZd7TGmh0Y6CTVt8Q+bYH6WUuMxJkBbCPqc=; b=UKw5cDzbmyewzLBDBGb1m1oxwUXralQ6twkJ6mCk3AZr3FJoYm0UAnr2qezkmaxSieUR3V rGkQF54PIK5jJI6h79aIl/DpRZcrEphsnDaSNrTLRUjY8flKKWNMNXIT48684GysYRKO0Q 7EBGMH0jx7TruJjOst9z1TiQpm7cjnSbeakH4VIqaOmAz6u0vCSPhjQts9H4P4m5kMGXgI WifwzWg1yIoTuqNzI/68w5es35j3PfdwKk7kCHQVIibVf8lsMfbut9r+/WDa5R5N1iYMKu ghbJRuBr2qVFslQHc4wthVJr1hmWdlqGadpYKHOkjVp7wXwAgKeisdBSvBXiVg== ARC-Seal: i=1; s=key1; d=yhetil.org; t=1631045773; a=rsa-sha256; cv=none; b=MIGkBtaQZalMTZsh9G1qtU+dqe3DJE3I0KURFTnecUR7aWGlkRu/zNZ0Ps2m+JXhy+Emlw 7TtNhJNTV9r777etp5S+LJrPYKwhB091pCEIUZw2s1E596uJaf2a7OTR7cnzkXgX2rFjIM Zi4K0xZADtgi6wKsVGtLCMUeHmNpMObcbCYY11nsfn7NrpQ8bPLO4cHSIyJPlDD6C+uDgo 2NfhE1Cjyg+xtpsytbehfed0NIRc57VN2bgTS+8ezLXf7gPQxHN+AOaBsBJyNJ62/pceXw vWGr+vLdSRMELW1oAocl7jpetj8pggHmHaiz3ZfmJS6MnvJe4eJPu0+TqrVDuQ== ARC-Authentication-Results: i=1; aspmx1.migadu.com; dkim=fail ("headers rsa verify failed") header.d=mgsn.dev header.s=key1 header.b=N1pgBjWY; spf=pass (aspmx1.migadu.com: domain of guix-patches-bounces@gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=guix-patches-bounces@gnu.org X-Migadu-Spam-Score: 0.19 Authentication-Results: aspmx1.migadu.com; dkim=fail ("headers rsa verify failed") header.d=mgsn.dev header.s=key1 header.b=N1pgBjWY; dmarc=fail reason="SPF not aligned (relaxed)" header.from=mgsn.dev (policy=none); spf=pass (aspmx1.migadu.com: domain of guix-patches-bounces@gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=guix-patches-bounces@gnu.org X-Migadu-Queue-Id: B47B7D0E7 X-Spam-Score: 0.19 X-Migadu-Scanner: scn1.migadu.com X-TUID: cAqrZSYwjbfC Hi Ludo, Ludovic Court=C3=A8s writes: > Example: > > scheme@(guile-user)> ,use(gnu packages base) > scheme@(guile-user)> ,use(gnu packages accessibility) > scheme@(guile-user)> ,use(guix) > scheme@(guile-user)> (package-location footswitch) > $1 =3D #< file: "gnu/packages/accessibility.scm" line: 257 colu= mn: 4> > scheme@(guile-user)> (package-definition-location footswitch) > $2 =3D #< file: "gnu/packages/accessibility.scm" line: 254 colu= mn: 0> > scheme@(guile-user)> (package-location hello) > $3 =3D #< file: "gnu/packages/base.scm" line: 79 column: 2> > scheme@(guile-user)> (package-definition-location hello) > $4 =3D #< file: "gnu/packages/base.scm" line: 78 column: 0> > > Thoughts? This is very clever! Thanks for the work on this. I'm not very good with macros, but it *looks* like it should work quite well for our use-case of adjusting a surrounding 'let' expression. And it's less invasive than rewriting 'let'. However... it doesn't work for unexported packages. It looks there are about 200 such packages: --8<---------------cut here---------------start------------->8--- ~/guix$ rg -U '\(define [^\(]+\n.*?\(package' gnu/packages --count --no-fil= ename | awk '{a+=3D$1} END {print a}' 233 --8<---------------cut here---------------end--------------->8--- And, to play the pessimist: What do we get out of this that couldn't be done by "go to package location; read backwards one sexp until we reach a defining form" (like Emacs' 'beginning-of-defun')? -- Sarah