GNU bug report logs - #68412
[PATCH] scripts: edit: Accept generic formatting parameter.

Please note: This is a static page, with minimal formatting, updated once a day.
Click here to see this page with the latest information and nicer formatting.

Package: guix-patches; Reported by: Liliana Marie Prikler <liliana.prikler@HIDDEN>; Keywords: patch; dated Fri, 12 Jan 2024 23:47:01 UTC; Maintainer for guix-patches is guix-patches@HIDDEN.

Message received at 68412 <at> debbugs.gnu.org:


Received: (at 68412) by debbugs.gnu.org; 8 Feb 2024 18:09:33 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Thu Feb 08 13:09:33 2024
Received: from localhost ([127.0.0.1]:33584 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1rY8q5-00058j-0Z
	for submit <at> debbugs.gnu.org; Thu, 08 Feb 2024 13:09:33 -0500
Received: from mail-ej1-x644.google.com ([2a00:1450:4864:20::644]:50628)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <liliana.prikler@HIDDEN>) id 1rY8q3-00058X-82
 for 68412 <at> debbugs.gnu.org; Thu, 08 Feb 2024 13:09:32 -0500
Received: by mail-ej1-x644.google.com with SMTP id
 a640c23a62f3a-a28a6cef709so7941666b.1
 for <68412 <at> debbugs.gnu.org>; Thu, 08 Feb 2024 10:09:16 -0800 (PST)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
 d=gmail.com; s=20230601; t=1707415751; x=1708020551; darn=debbugs.gnu.org;
 h=mime-version:user-agent:content-transfer-encoding:references
 :in-reply-to:date:cc:to:from:subject:message-id:from:to:cc:subject
 :date:message-id:reply-to;
 bh=TY4zlW8TJ4Vv4265F/TskC8Hd/XPj1gjtjvOqeEwJ1k=;
 b=DUTq0AI+6EqUm0j+18OQVduo07VJ6MRjwXnVwyR34WfVTT3CV1GxvrcpoxrtD6jaFa
 O/cEpS9pREtVYgoS7LVEBpqzIkMOm2A9AyPua4q/EIVlb74QT1ihEUBhGnQ9Ra9ppsY9
 Y6D5kuggZH+qu2cxY4x0YfAiko+S366Gg4PKNMozgH4DfM417D2KfXUevfn4vU+XKKlZ
 98GXYxl5Jg8/mtQPdzdgyFgH8SEYgoR3AkR12Q5rqCLm3uKCbTbtSjEXXeXvhCMzqVOw
 zSTK1mpeEYglkU9wz1FCI4yj0L6OR3FoHZMNEGgoJ1bPEhkZDLhqeRrBWCaP3ClxXS2R
 jwkg==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
 d=1e100.net; s=20230601; t=1707415751; x=1708020551;
 h=mime-version:user-agent:content-transfer-encoding:references
 :in-reply-to:date:cc:to:from:subject:message-id:x-gm-message-state
 :from:to:cc:subject:date:message-id:reply-to;
 bh=TY4zlW8TJ4Vv4265F/TskC8Hd/XPj1gjtjvOqeEwJ1k=;
 b=DlkbrXUGZ86MM8NHG809M8RbBIdAXvr70rV5JrP3jRN6fvNrGOllB6/BFqjQCKLJqQ
 IZ9uC/vKMl0qzpV7HrdfotTRnMaOGyvgAL+/JDwuyn1MNYQb6vX6Kqtr5kWerJ02Q4ZG
 XjB+tJSEt19Ci1R5/cKMlHVv0qopy6I5T9KoQExjxo66syMcedkQ0H0dRe6VgncjmGw3
 0ErW1yGwX1nvrMxwEvUy/E/qqEdyZY/A2XdM/WrRiC8qNEccXK0u+dwQkHgwT8ayJVnc
 ryQkVszGBkjTcphlOhCF4RVP9X3oOzE3pfOVUMr5IpxAG0GHt3CI9NGFBsnyuYEeMZwd
 DZZw==
X-Gm-Message-State: AOJu0YzfixDwhcHS1qXP4R7q0Z+9WTI5ro6npvFEqScCoMBs7iOsunH9
 KA/hFzoJA5TaIkUp7ETlj6DBxbjAPP/lF+6cF6MCOqy/n9osZDHT
X-Google-Smtp-Source: AGHT+IH0M9lCErlRL2DC5wnzSyn7QvrZXsz1FUZjYxqbqlSYyz7Q5tC+Qj+P0IO9rpdO8hdHUgSHzA==
X-Received: by 2002:a17:906:d0ce:b0:a38:5b3e:6fd9 with SMTP id
 bq14-20020a170906d0ce00b00a385b3e6fd9mr69402ejb.67.1707415750759; 
 Thu, 08 Feb 2024 10:09:10 -0800 (PST)
X-Forwarded-Encrypted: i=1;
 AJvYcCXEPwVgRXg0kq3VCuTbhBf5tj3Y+GSRW6jy8YoGLYPb7gnAkgRBGSZ56YUEUC47gvDzL80r8iGACJO1tYi9i50jaqzJkYc=
Received: from lumine.fritz.box (85-127-52-93.dsl.dynamic.surfer.at.
 [85.127.52.93]) by smtp.gmail.com with ESMTPSA id
 vk6-20020a170907cbc600b00a38e7459175sm292821ejc.126.2024.02.08.10.09.10
 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256);
 Thu, 08 Feb 2024 10:09:10 -0800 (PST)
Message-ID: <15c08b6053676777c8457ff247b0ab214465cedc.camel@HIDDEN>
Subject: Re: [bug#68412] [PATCH v2] scripts: edit: Accept generic formatting
 parameter.
From: Liliana Marie Prikler <liliana.prikler@HIDDEN>
To: Ludovic =?ISO-8859-1?Q?Court=E8s?= <ludo@HIDDEN>
Date: Thu, 08 Feb 2024 19:09:09 +0100
In-Reply-To: <87h6ij3of4.fsf@HIDDEN>
References: <9a666abbf1cb4b7548c1a117eaa04b0de02145ae.1705103171.git.liliana.prikler@HIDDEN>
 <86b13fd4916ffecb1947d0879805a6d0c32542bf.1706386650.git.liliana.prikler@HIDDEN>
 <87v87ciedd.fsf@HIDDEN>
 <8422a68ebc6545a4587232c404efcfee86337df3.camel@HIDDEN>
 <87h6ij3of4.fsf@HIDDEN>
Content-Type: text/plain; charset="UTF-8"
Content-Transfer-Encoding: quoted-printable
User-Agent: Evolution 3.46.4 
MIME-Version: 1.0
X-Spam-Score: -0.0 (/)
X-Debbugs-Envelope-To: 68412
Cc: 68412 <at> debbugs.gnu.org, Simon Tournier <zimon.toutoune@HIDDEN>
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -1.0 (-)

Am Mittwoch, dem 07.02.2024 um 23:22 +0100 schrieb Ludovic Court=C3=A8s:
> Hi,
>=20
> Liliana Marie Prikler <liliana.prikler@HIDDEN> skribis:
>=20
> > > Second, I think that using markers that can be interpreted by
> > > Bash
> > > shell can lead to confusion.=C2=A0 For instance,
>=20
> [...]
>=20
> > > $ export GUIX_EDITOR_LOCATION_FORMAT=3D"--line=3D${LINE} ${FILE}"
> > > $ echo $GUIX_EDITOR_LOCATION_FORMAT
> > > --line=3Dfoo bar
> > > --8<---------------cut here---------------end--------------->8---
> > >=20
> > > Well, simple quote versus double quote appears to me subtle.
> > >=20
> > > Since it is an hard text replacement, why not remove $ and just
> > > have the placeholder {LINE} or {FILE}?=C2=A0 Or <LINE> and <FILE>?=C2=
=A0 Or
> > > whatever that is not interpreted by common shells.
> > Because it is only a hard text replacement *for now*.=C2=A0 We might
> > find that there's merit to having gash interpret these later on.=C2=A0 =
I
> > know there's like fifty conventions for formatting strings and we
> > have to pick one, but I'd like to think that this isn't just a
> > pointless exercise in forward compatibility.
>=20
> It=E2=80=99s true that someone not well versed in shell or someone distra=
cted
> could easily find themselves having ${LINE} and ${FILE} shell-
> expanded even though we precisely don=E2=80=99t want that.
>=20
> One way out would be to use a different syntax, say, %LINE% and
> %FILE%.  With the syntax clearly different from shell variables, we=E2=80=
=99d
> avoid those easy mistakes.
>=20
> WDYT?
Well, I said my opinion already in reply to Simon, but if y'all
strongly feel that preventing this confusion is preferable and can
agree to a common syntax, by all means go ahead and commit it with that
change.

I do think there's value in having this interpretable by gash at some
point, but maybe I'm thinking too far into the future.

Cheers




Information forwarded to guix-patches@HIDDEN:
bug#68412; Package guix-patches. Full text available.

Message received at 68412 <at> debbugs.gnu.org:


Received: (at 68412) by debbugs.gnu.org; 7 Feb 2024 22:22:46 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Wed Feb 07 17:22:46 2024
Received: from localhost ([127.0.0.1]:58130 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1rXqJa-0003YG-55
	for submit <at> debbugs.gnu.org; Wed, 07 Feb 2024 17:22:46 -0500
Received: from eggs.gnu.org ([2001:470:142:3::10]:50016)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <ludo@HIDDEN>) id 1rXqJZ-0003Y5-9w
 for 68412 <at> debbugs.gnu.org; Wed, 07 Feb 2024 17:22:45 -0500
Received: from fencepost.gnu.org ([2001:470:142:3::e])
 by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256)
 (Exim 4.90_1) (envelope-from <ludo@HIDDEN>)
 id 1rXqJF-0003JB-SD; Wed, 07 Feb 2024 17:22:26 -0500
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=gnu.org;
 s=fencepost-gnu-org; h=MIME-Version:Date:References:In-Reply-To:Subject:To:
 From; bh=T6/HdaLP/8bMo7lf5hFyQ19gd0XI1ttyD7qWOKbxAeI=; b=IzV+HRu6CN7SFH5WlUKB
 xaXcPPfg8Sz8sHkiE2Z02kT06u1OCNvTF/DGsnGTsFZd1zTPFpP0IbuFn9zkcKdFty0u0jiKJVbAz
 AShRQP5AaU3rsyOy08t0BEcQvDahHogJecbfmDhGkUTumMLRMcHipYfIK/tHlUhH64e2eD6kICSEa
 ufVxYLUdrW+cVhlQfUHVQt73wIukWVyiI9d8oZKAStPyjK6iVviKdd3dwVDYIjEIyVyMalv2om8wA
 UmTHgFoHJTSUc7b4jrf7j3DaTsmlRc2rKYcfeE9mnxR6yoPuJutty0WWJpCJHncg8f8u3k3Upq2Pw
 qr9g3HRZPCA+uA==;
From: =?utf-8?Q?Ludovic_Court=C3=A8s?= <ludo@HIDDEN>
To: Liliana Marie Prikler <liliana.prikler@HIDDEN>
Subject: Re: [bug#68412] [PATCH v2] scripts: edit: Accept generic formatting
 parameter.
In-Reply-To: <8422a68ebc6545a4587232c404efcfee86337df3.camel@HIDDEN>
 (Liliana Marie Prikler's message of "Mon, 29 Jan 2024 18:58:31 +0100")
References: <9a666abbf1cb4b7548c1a117eaa04b0de02145ae.1705103171.git.liliana.prikler@HIDDEN>
 <86b13fd4916ffecb1947d0879805a6d0c32542bf.1706386650.git.liliana.prikler@HIDDEN>
 <87v87ciedd.fsf@HIDDEN>
 <8422a68ebc6545a4587232c404efcfee86337df3.camel@HIDDEN>
X-URL: http://www.fdn.fr/~lcourtes/
X-Revolutionary-Date: Nonidi 19 =?utf-8?Q?Pluvi=C3=B4se?= an 232 de la
 =?utf-8?Q?R=C3=A9volution=2C?= jour de la Pulmonaire
X-PGP-Key-ID: 0x090B11993D9AEBB5
X-PGP-Key: http://www.fdn.fr/~lcourtes/ludovic.asc
X-PGP-Fingerprint: 3CE4 6455 8A84 FDC6 9DB4  0CFB 090B 1199 3D9A EBB5
X-OS: x86_64-pc-linux-gnu
Date: Wed, 07 Feb 2024 23:22:23 +0100
Message-ID: <87h6ij3of4.fsf@HIDDEN>
User-Agent: Gnus/5.13 (Gnus v5.13)
MIME-Version: 1.0
Content-Type: text/plain; charset=utf-8
Content-Transfer-Encoding: quoted-printable
X-Spam-Score: -2.3 (--)
X-Debbugs-Envelope-To: 68412
Cc: 68412 <at> debbugs.gnu.org, Simon Tournier <zimon.toutoune@HIDDEN>
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -3.3 (---)

Hi,

Liliana Marie Prikler <liliana.prikler@HIDDEN> skribis:

>> Second, I think that using markers that can be interpreted by Bash
>> shell can lead to confusion.=C2=A0 For instance,

[...]

>> $ export GUIX_EDITOR_LOCATION_FORMAT=3D"--line=3D${LINE} ${FILE}"
>> $ echo $GUIX_EDITOR_LOCATION_FORMAT
>> --line=3Dfoo bar
>> --8<---------------cut here---------------end--------------->8---
>>=20
>> Well, simple quote versus double quote appears to me subtle.
>>=20
>> Since it is an hard text replacement, why not remove $ and just have
>> the placeholder {LINE} or {FILE}?=C2=A0 Or <LINE> and <FILE>?=C2=A0 Or w=
hatever
>> that is not interpreted by common shells.
> Because it is only a hard text replacement *for now*.  We might find
> that there's merit to having gash interpret these later on.  I know
> there's like fifty conventions for formatting strings and we have to
> pick one, but I'd like to think that this isn't just a pointless
> exercise in forward compatibility.

It=E2=80=99s true that someone not well versed in shell or someone distract=
ed
could easily find themselves having ${LINE} and ${FILE} shell-expanded
even though we precisely don=E2=80=99t want that.

One way out would be to use a different syntax, say, %LINE% and %FILE%.
With the syntax clearly different from shell variables, we=E2=80=99d avoid =
those
easy mistakes.

WDYT?

Ludo=E2=80=99.




Information forwarded to guix-patches@HIDDEN:
bug#68412; Package guix-patches. Full text available.

Message received at 68412 <at> debbugs.gnu.org:


Received: (at 68412) by debbugs.gnu.org; 29 Jan 2024 17:58:51 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Mon Jan 29 12:58:50 2024
Received: from localhost ([127.0.0.1]:33401 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1rUVuE-00067T-C1
	for submit <at> debbugs.gnu.org; Mon, 29 Jan 2024 12:58:50 -0500
Received: from mail-wr1-x441.google.com ([2a00:1450:4864:20::441]:48597)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <liliana.prikler@HIDDEN>) id 1rUVuC-00067D-4i
 for 68412 <at> debbugs.gnu.org; Mon, 29 Jan 2024 12:58:48 -0500
Received: by mail-wr1-x441.google.com with SMTP id
 ffacd0b85a97d-337cc8e72f5so2546579f8f.1
 for <68412 <at> debbugs.gnu.org>; Mon, 29 Jan 2024 09:58:39 -0800 (PST)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
 d=gmail.com; s=20230601; t=1706551113; x=1707155913; darn=debbugs.gnu.org;
 h=mime-version:user-agent:content-transfer-encoding:references
 :in-reply-to:date:cc:to:from:subject:message-id:from:to:cc:subject
 :date:message-id:reply-to;
 bh=QpeJ2p5wAWcDVdiKDjuAbRdS2F7m4KaKVTjVv6TzvEg=;
 b=W+PtfLJJ1qtdxbBGKCYjXuH5gOHzfQcyNMxewiykjKEmeUnuOxwj4LjYI2tLJr/dxF
 hNfsWlChUGfWLK9R3c01tWHPFwNrQDZGYWe65Os6ca5KuPi6SPfUSAPQQ1PhK5oXni5U
 b7ZlybaZGDF1EnEAKw20ZrFcH6WYgJ2JhDsohjc8kFbb/dfutFUgp8X/W4BDqohUj+o5
 /58AWs5zR3486S2VnyAYM9fGI+YwQoH6xgEEW3rmbWTJ6CCWr3SngtYGa4utA1JdApvK
 XGFUTTlIR/cwMqDN1tXaf0lEJ3joxdcKDXMbqWWq5veg8VHWF6ztMZhyOgnaUUNpRa7j
 Wl+A==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
 d=1e100.net; s=20230601; t=1706551113; x=1707155913;
 h=mime-version:user-agent:content-transfer-encoding:references
 :in-reply-to:date:cc:to:from:subject:message-id:x-gm-message-state
 :from:to:cc:subject:date:message-id:reply-to;
 bh=QpeJ2p5wAWcDVdiKDjuAbRdS2F7m4KaKVTjVv6TzvEg=;
 b=vr1LBzHXx0uzbsppGiQymdoifZRG1oWzK+e5OsURi5YRlJeYAslM1thvfoniS1Bzft
 8KDOReFzNtNNwyLaoOd9t+A/Q+BLCgAIN7PRGtqCJVSN3wrhHE4ESHoiIBDlS/YHt4te
 Wkie/dgTXbkiEy0QhVrAAJr8Hit+YpIb7QoJVtt/Z4novKvZ+Pbe+l3hZxYEU+0ikug0
 2YO65MMm0fpFSnG2A/G8qYKp7ZcbwBXhBzsf3y+sg7HVmZX76JVccV1jcjHnLMIwm2qo
 5O9CsgkjaXXV5FDlJG+VLShsQMmEkS29gP5sI67bK+s8/cQHEDItrHMV/3oc0OT0GL8W
 yXvA==
X-Gm-Message-State: AOJu0YwRDxsTK3z3kdZdmmaqtpKeiRE60bD+jzsBIAFvRi7jCOf0Sb2F
 W58pFIvUHfkxSD3NyYREMTp9vIrmYgJwFClXDVGM0iSGYOc8XnSS
X-Google-Smtp-Source: AGHT+IFDQsS54sHkM4hySyA7PWA0qf1JxLMtq2uIftDD25pJb/VQbkdFUdi9a7sZL5FxurIiWD5jkw==
X-Received: by 2002:adf:ae4a:0:b0:337:b9ac:97f6 with SMTP id
 u10-20020adfae4a000000b00337b9ac97f6mr4933541wrd.55.1706551113048; 
 Mon, 29 Jan 2024 09:58:33 -0800 (PST)
Received: from lumine.fritz.box (85-127-52-93.dsl.dynamic.surfer.at.
 [85.127.52.93]) by smtp.gmail.com with ESMTPSA id
 co6-20020a0560000a0600b0033af4df8e1esm1420640wrb.47.2024.01.29.09.58.32
 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256);
 Mon, 29 Jan 2024 09:58:32 -0800 (PST)
Message-ID: <8422a68ebc6545a4587232c404efcfee86337df3.camel@HIDDEN>
Subject: Re: [bug#68412] [PATCH v2] scripts: edit: Accept generic formatting
 parameter.
From: Liliana Marie Prikler <liliana.prikler@HIDDEN>
To: Simon Tournier <zimon.toutoune@HIDDEN>, 68412 <at> debbugs.gnu.org
Date: Mon, 29 Jan 2024 18:58:31 +0100
In-Reply-To: <87v87ciedd.fsf@HIDDEN>
References: <9a666abbf1cb4b7548c1a117eaa04b0de02145ae.1705103171.git.liliana.prikler@HIDDEN>
 <86b13fd4916ffecb1947d0879805a6d0c32542bf.1706386650.git.liliana.prikler@HIDDEN>
 <87v87ciedd.fsf@HIDDEN>
Content-Type: text/plain; charset="UTF-8"
Content-Transfer-Encoding: quoted-printable
User-Agent: Evolution 3.46.4 
MIME-Version: 1.0
X-Spam-Score: -0.0 (/)
X-Debbugs-Envelope-To: 68412
Cc: Ludovic =?ISO-8859-1?Q?Court=E8s?= <ludo@HIDDEN>
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -1.0 (-)

Am Montag, dem 29.01.2024 um 12:10 +0100 schrieb Simon Tournier:
> Hi,
>=20
> On sam., 13 janv. 2024 at 00:35, Liliana Marie Prikler
> <liliana.prikler@HIDDEN> wrote:
>=20
> > +@vindex GUIX_EDITOR_LOCATION_FORMAT
> > +The default convention used by @code{guix edit} when invoking
> > +@code{$EDITOR} is to pass it @code{+@var{line} @var{file}} to open
> > +@var{file} at the given @var{line}.
> > +You can change this convention for editors that do not support it
> > +by setting @env{GUIX_EDITOR_LOCATION_FORMAT}.
> > +For instance, to set things up with kate, use:
> > +
> > +@example
> > +export VISUAL=3Dkate
> > +export GUIX_EDITOR_LOCATION_FORMAT=3D'--line=3D$@{LINE@} $@{FILE@}'
> > +# Assume you want to hack on kate
> > +guix edit kate
> > +@end example
>=20
> First, it appears to me inconsistent to speak about EDITOR and then
> to use VISUAL in the example.=C2=A0 I suggest to have:
>=20
> =C2=A0=C2=A0=C2=A0 The default convention used by @code{guix edit} when i=
nvoking
> =C2=A0=C2=A0=C2=A0 @code{$EDITOR} or @code{VISUAL} is to pass it @code{+@=
var{line}
> @var{file}} to open
>=20
> and the same example.=C2=A0 Or change the example and replace with:
>=20
> =C2=A0=C2=A0=C2=A0 export EDITOR=3Dkate
> =C2=A0=C2=A0=C2=A0 export GUIX_EDITOR_LOCATION_FORMAT=3D'--line=3D$@{LINE=
@} $@{FILE@}'
I think "or VISUAL" would be acceptable, but repeating what we wrote
earlier.  I wouldn't set EDITOR=3Dkate, because it is graphical after
all.

> Second, I think that using markers that can be interpreted by Bash
> shell can lead to confusion.=C2=A0 For instance,
>=20
> =C2=A0=C2=A0=C2=A0 $ LINE=3Dfoo; FILE=3Dbar # somewhere in my config for =
whatever
> reasons
>=20
> then:
>=20
> --8<---------------cut here---------------start------------->8---
> $ export GUIX_EDITOR_LOCATION_FORMAT=3D'--line=3D${LINE} ${FILE}'
> $ echo $GUIX_EDITOR_LOCATION_FORMAT
> --line=3D${LINE} ${FILE}
>=20
> $ export GUIX_EDITOR_LOCATION_FORMAT=3D"--line=3D${LINE} ${FILE}"
> $ echo $GUIX_EDITOR_LOCATION_FORMAT
> --line=3Dfoo bar
> --8<---------------cut here---------------end--------------->8---
>=20
> Well, simple quote versus double quote appears to me subtle.
>=20
> Since it is an hard text replacement, why not remove $ and just have
> the placeholder {LINE} or {FILE}?=C2=A0 Or <LINE> and <FILE>?=C2=A0 Or wh=
atever
> that is not interpreted by common shells.
Because it is only a hard text replacement *for now*.  We might find
that there's merit to having gash interpret these later on.  I know
there's like fifty conventions for formatting strings and we have to
pick one, but I'd like to think that this isn't just a pointless
exercise in forward compatibility.

> > +Note, that Guix only matches the literal strings @code{$@{LINE@}}
> > and
> > +@code{$@{FILE@}} here.=C2=A0 These may look like shell parameters, but
> > their
> > +short form is currently not supported.
>=20
> Therefore, it would make that more clear or even obsolete.
/me hints at "currently"

Cheers




Information forwarded to guix-patches@HIDDEN:
bug#68412; Package guix-patches. Full text available.

Message received at 68412 <at> debbugs.gnu.org:


Received: (at 68412) by debbugs.gnu.org; 29 Jan 2024 14:08:04 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Mon Jan 29 09:08:04 2024
Received: from localhost ([127.0.0.1]:59343 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1rUSIq-0007bg-3o
	for submit <at> debbugs.gnu.org; Mon, 29 Jan 2024 09:08:04 -0500
Received: from mail-ot1-x329.google.com ([2607:f8b0:4864:20::329]:39261)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <zimon.toutoune@HIDDEN>) id 1rUSIk-0007bP-KQ
 for 68412 <at> debbugs.gnu.org; Mon, 29 Jan 2024 09:07:58 -0500
Received: by mail-ot1-x329.google.com with SMTP id
 46e09a7af769-6e12cc26f06so8997a34.1
 for <68412 <at> debbugs.gnu.org>; Mon, 29 Jan 2024 06:07:46 -0800 (PST)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
 d=gmail.com; s=20230601; t=1706537260; x=1707142060; darn=debbugs.gnu.org;
 h=content-transfer-encoding:cc:to:subject:message-id:date:from
 :in-reply-to:references:mime-version:from:to:cc:subject:date
 :message-id:reply-to;
 bh=HunjDFCnqEdtG2fiqoCMtOu8ZlP4qQlEKBiw2Io+EuI=;
 b=gc19KbIwhy4fIyoHlMHwd91Ku/7MTBgrt5dRHGOLfV9+ceVahV4CjbAvT9dPuJDMMg
 61+A28KJj+h6Bb4WMAx9mTnJ0PNqfT/08OiHly50H6I4NFJs89/QoJ+V3kZ0QdxIdT6i
 +xEaDF2gUDL4dzD4zxkKi8ZHX1RF+YWLaKgAR0XUO9gntWG9p2y1kmm095X8ye/jYRdQ
 bBTs5CC60PuwfaH0ju1S+V3Ai3xs1pXLNP6dZAvlrXfpKFWy87J4vRqkM8UBJwlpQOkU
 V5BDk1rfh4+fFyV+keQIcmT051X0F2zf91IDAI667TXy48LA58PadHjgnaYktA4X+DBd
 6y4w==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
 d=1e100.net; s=20230601; t=1706537260; x=1707142060;
 h=content-transfer-encoding:cc:to:subject:message-id:date:from
 :in-reply-to:references:mime-version:x-gm-message-state:from:to:cc
 :subject:date:message-id:reply-to;
 bh=HunjDFCnqEdtG2fiqoCMtOu8ZlP4qQlEKBiw2Io+EuI=;
 b=D3SEtHazhMORpSr/1RvG3JP2vy8B/SWKOrlQX/iLZ3w5+7WSkBehP456Q2z0dQ+DpF
 8h38TXxG6pyYZm11MF/MtZkuBECbv2bAec1OGiIEyRdrSXCUNKGx6vsNxB/5WPvlM0I9
 P/E+7IdbdX7geL9vHFXkHso19yVRVkFlnlNL3Ix5Et8Pa21kt1x3LQoEUF3tPubQnSxI
 /3fN3aXEYoUNLklhnmrok2xhM0bVLtqlthy7nhvr6qrvOqtUAtrgMBwcvJXBrs/TYZjc
 uhj6ngoVd7BfVyrVsXymIfE5nR0WWIXfs1Nh7VXNFXnHvAhS7qY2Ave7LA+DYewNf+Mc
 eFpg==
X-Forwarded-Encrypted: i=0;
 AJvYcCUQziC+VWwgTV49hGNwyywfQP+HkImGBEXG17WzCsSbNl6QQbjHHQ0zMEDkUMUUUJfuF/I03uUbo0C7ZtodomJ26dc1n18=
X-Gm-Message-State: AOJu0YwzVCwLLbbvYDBJV7aZIuYuF3eUzn1sbGh7HScydYjcatLVfFUd
 LyTM1E8PYLMeZX8JLdR8gRgi3uA0qTlEgZRpyxH0k2qg2WvwMxpNj751X3oVKkWcmRYMizFCUCX
 GBa8a59BqoXoz/YyzSK7Oy0UH/mc=
X-Google-Smtp-Source: AGHT+IG+viHhWrdbHQ3UTNvUHe0e+Pn+U3FBKhko8er58B07toMkJwYzUNsZ2UXsSw0E4EjIIMDkCvNbqWqUU6naepo=
X-Received: by 2002:a05:6870:9691:b0:218:51a6:b1d1 with SMTP id
 o17-20020a056870969100b0021851a6b1d1mr5997350oaq.0.1706537260420; Mon, 29 Jan
 2024 06:07:40 -0800 (PST)
MIME-Version: 1.0
References: <86b13fd4916ffecb1947d0879805a6d0c32542bf.1706386650.git.liliana.prikler@HIDDEN>
 <87zfwop91c.fsf@HIDDEN>
In-Reply-To: <87zfwop91c.fsf@HIDDEN>
From: Simon Tournier <zimon.toutoune@HIDDEN>
Date: Mon, 29 Jan 2024 15:07:27 +0100
Message-ID: <CAJ3okZ1CRxwWJMyjJWDZRvu5h67peTvo8FnftZDCB5VgBHd3bA@HIDDEN>
Subject: Re: [PATCH v2] scripts: edit: Accept generic formatting parameter.
To: =?UTF-8?Q?Ludovic_Court=C3=A8s?= <ludo@HIDDEN>
Content-Type: text/plain; charset="UTF-8"
Content-Transfer-Encoding: quoted-printable
X-Spam-Score: -0.0 (/)
X-Debbugs-Envelope-To: 68412
Cc: 68412 <at> debbugs.gnu.org, Liliana Marie Prikler <liliana.prikler@HIDDEN>
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -1.0 (-)

Hi,

On Mon, 29 Jan 2024 at 14:24, Ludovic Court=C3=A8s <ludo@HIDDEN> wrote:

> LGTM!

This does not LGTM for the reason I invoked earlier: single-quote
versus double-quote and the interpretation of ${LINE}.

I think it would be less confusing to have another placeholder, as
just {LINE} or whatever else.

For what my opinion is worth.

Cheers,
simon




Information forwarded to guix-patches@HIDDEN:
bug#68412; Package guix-patches. Full text available.

Message received at 68412 <at> debbugs.gnu.org:


Received: (at 68412) by debbugs.gnu.org; 29 Jan 2024 13:25:04 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Mon Jan 29 08:25:04 2024
Received: from localhost ([127.0.0.1]:59299 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1rURdI-0003Ub-Cn
	for submit <at> debbugs.gnu.org; Mon, 29 Jan 2024 08:25:04 -0500
Received: from eggs.gnu.org ([2001:470:142:3::10]:49880)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <ludo@HIDDEN>) id 1rURdG-0003Tx-TW
 for 68412 <at> debbugs.gnu.org; Mon, 29 Jan 2024 08:25:03 -0500
Received: from fencepost.gnu.org ([2001:470:142:3::e])
 by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256)
 (Exim 4.90_1) (envelope-from <ludo@HIDDEN>)
 id 1rURd3-0004hr-5D; Mon, 29 Jan 2024 08:24:49 -0500
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=gnu.org;
 s=fencepost-gnu-org; h=MIME-Version:Date:References:In-Reply-To:Subject:To:
 From; bh=JgRzLEgvmBis9zKKruVxvfHhgftI5w9+jnShpbc/f+I=; b=Cbec5m9R6t5ATjrlpr8T
 2qDPTlFqdcNHEv0tfByfqPlIqWlcFRANmRj6m5LITP4o6n+sYVTzXpdNAMmDbEcyIuOOUvaSdF5C2
 2wFfAOgjb1AfFQdTR7WgKPABihAM8tFPtqT1jLxjiIx4LAzxhV1FB1w6naUWS0ASRAJvSRtxOe22p
 Y1/DQlGERMVfFGZaA177h3XTJTgcVDtREI1kVxiBQiS8q7TrNWGBzVBhDXIpzVx3gV9v77wL0dxov
 sR/J7PFf5Ut8GS4HA57BzV6+XqsD0eSdB9+scDKJbjHl39SbdK9qav0BLSq/hQdA3NFYxEPDlamgM
 Ymm9BQHl/fCPkA==;
From: =?utf-8?Q?Ludovic_Court=C3=A8s?= <ludo@HIDDEN>
To: Liliana Marie Prikler <liliana.prikler@HIDDEN>
Subject: Re: [PATCH v2] scripts: edit: Accept generic formatting parameter.
In-Reply-To: <86b13fd4916ffecb1947d0879805a6d0c32542bf.1706386650.git.liliana.prikler@HIDDEN>
 (Liliana Marie Prikler's message of "Sat, 13 Jan 2024 00:35:29 +0100")
References: <86b13fd4916ffecb1947d0879805a6d0c32542bf.1706386650.git.liliana.prikler@HIDDEN>
X-URL: http://www.fdn.fr/~lcourtes/
X-Revolutionary-Date: =?utf-8?Q?D=C3=A9cadi?= 10 =?utf-8?Q?Pluvi=C3=B4se?=
 an 232 de la =?utf-8?Q?R=C3=A9volution=2C?= jour de la
 =?utf-8?Q?Cogn=C3=A9e?=
X-PGP-Key-ID: 0x090B11993D9AEBB5
X-PGP-Key: http://www.fdn.fr/~lcourtes/ludovic.asc
X-PGP-Fingerprint: 3CE4 6455 8A84 FDC6 9DB4  0CFB 090B 1199 3D9A EBB5
X-OS: x86_64-pc-linux-gnu
Date: Mon, 29 Jan 2024 14:24:15 +0100
Message-ID: <87zfwop91c.fsf@HIDDEN>
User-Agent: Gnus/5.13 (Gnus v5.13)
MIME-Version: 1.0
Content-Type: text/plain; charset=utf-8
Content-Transfer-Encoding: quoted-printable
X-Spam-Score: -2.3 (--)
X-Debbugs-Envelope-To: 68412
Cc: 68412 <at> debbugs.gnu.org, Simon Tournier <zimon.toutoune@HIDDEN>
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -3.3 (---)

Hi,

Liliana Marie Prikler <liliana.prikler@HIDDEN> skribis:

> This will hopefully end the opening of unwanted files.
>
> * guix/scripts/edit.scm (%location-format): New parameter.
> (location->location-specification): Use %location-format.
> (spawn-editor): Adjust accordingly.
>
> Fixes: Pass special flags to =E2=80=98kate=E2=80=99 <https://bugs.gnu.org=
/44272#14>

LGTM!

>> > Fixes: Pass special flags to =E2=80=98kate=E2=80=99 <https://bugs.gnu.=
org/44272#14>
>>=20
>> Rather: =E2=80=9CFixes <https://issues.guix.gnu.org/44272>.=E2=80=9D
> I'm using a convention that I've proposed earlier in [1].
> Since we're currently adding ChangeIds without any of the supported
> infra (AFAIK), I think following my own proposal here is fair game.

It=E2=80=99s not: conventions, by definition, are agreed upon collectively.
Regardless of the merits of a proposal, we first have to build consensus
for the proposal before starting using it.

Thanks,
Ludo=E2=80=99.




Information forwarded to guix-patches@HIDDEN:
bug#68412; Package guix-patches. Full text available.

Message received at 68412 <at> debbugs.gnu.org:


Received: (at 68412) by debbugs.gnu.org; 29 Jan 2024 11:11:15 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Mon Jan 29 06:11:15 2024
Received: from localhost ([127.0.0.1]:59133 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1rUPXm-0002XU-Ud
	for submit <at> debbugs.gnu.org; Mon, 29 Jan 2024 06:11:15 -0500
Received: from mail-wm1-x334.google.com ([2a00:1450:4864:20::334]:38064)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <zimon.toutoune@HIDDEN>) id 1rUPXl-0002XA-5K
 for 68412 <at> debbugs.gnu.org; Mon, 29 Jan 2024 06:11:13 -0500
Received: by mail-wm1-x334.google.com with SMTP id
 5b1f17b1804b1-40e412c1c58so8129355e9.0
 for <68412 <at> debbugs.gnu.org>; Mon, 29 Jan 2024 03:11:04 -0800 (PST)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
 d=gmail.com; s=20230601; t=1706526659; x=1707131459; darn=debbugs.gnu.org;
 h=mime-version:message-id:date:references:in-reply-to:subject:cc:to
 :from:from:to:cc:subject:date:message-id:reply-to;
 bh=KM2W+RHjs26o7GJLgfCA1e/m2ZOGZ11rcBOqjHBEEUA=;
 b=L84ux5mvM4XItZ5U9eH5NuKFunmGV3TcQczTy0F43Q6D60O3NaWd5k0jNpVnMOdkhm
 vdE99x52mkrlOFKalzbpM03TPPVIarazS78KOJWflgTJKFsj4dqHJypy5bK852xTXcOg
 PMBqQ/eCJHuSxszHw7vTu3Czo5MC1Crsqcy3r8WsBG9Ilo71A4FvSAKG7DNvKkkQaxrU
 felkO6910Wmjlhwytjepn1gMP8yzNFs+mhlBsVtKpoNS382h/ZipEwerrOtrd2S6vVy2
 MQ/VCyHM8FonYvb1s3bjsoFS75XwX8TCCiiD6Qt4tlKAfsuBw0JuhAoWDn2/VvMu14DO
 V5OA==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
 d=1e100.net; s=20230601; t=1706526659; x=1707131459;
 h=mime-version:message-id:date:references:in-reply-to:subject:cc:to
 :from:x-gm-message-state:from:to:cc:subject:date:message-id:reply-to;
 bh=KM2W+RHjs26o7GJLgfCA1e/m2ZOGZ11rcBOqjHBEEUA=;
 b=UnExZxVJlPu0R+/0u/h7lb9BO1fx6GF1YQtmvKvc5pV13eFAFx5sL7eWGPz5AaIS2y
 8W8QXNQiWVNVlhFY+jHMcdeUSwg4uSaapUQw6c7DTRcXa3YAAS6Mx9mJ7alrJnNVxSXo
 9JXSdTAH0JDK2ClFNHTkIraXkyFJy0XopWJlrDjZRX1Pp+ghYh9sQIlv3KcwHalNBLcm
 X90eaeMLgH/f+KC/EWVXhnW7J+qfmWCuTRbNsFM3/i+YBG8/3SYpYak9xhC9M+B2LK6W
 uiyN4MoZ6qHjqZg2Wto8UFC5lNZM16WEezxoHS9iol0yIZG1hJe5pNOehAkBjW3QUaBq
 1X+A==
X-Forwarded-Encrypted: i=0;
 AJvYcCUqHicQjTO3cCutVLS006BfJfgME/Q6fM+mgXLJ8oqBkdSvLVIC+QgyxvX/n1Y+sC4iuGCZ7rDGKvMbztqEA8Bja+dt0V8=
X-Gm-Message-State: AOJu0YzZUvYtZoO9/OJZIeZnXPJeXeUCEMOMQeBXi2ZWRS+Po60GnOsq
 QaASvwQymOhNRaY6u71gNb02w0d8e31nFuau8a7ObI4guPu1UamJ
X-Google-Smtp-Source: AGHT+IHZUtosIMUbpdNvVru8HtykTTCHDCHuqC+gsifU9T3W9TFxeeDJMy+YcxbUHVQlXE45e7RgxA==
X-Received: by 2002:a05:600c:601c:b0:40e:550e:4102 with SMTP id
 az28-20020a05600c601c00b0040e550e4102mr5896229wmb.4.1706526658481; 
 Mon, 29 Jan 2024 03:10:58 -0800 (PST)
Received: from lili ([2a01:e0a:59b:9120:1995:e524:53ec:50f9])
 by smtp.gmail.com with ESMTPSA id
 h17-20020a05600c315100b0040d62f89381sm9834323wmo.35.2024.01.29.03.10.57
 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256);
 Mon, 29 Jan 2024 03:10:58 -0800 (PST)
From: Simon Tournier <zimon.toutoune@HIDDEN>
To: Liliana Marie Prikler <liliana.prikler@HIDDEN>, 68412 <at> debbugs.gnu.org
Subject: Re: [bug#68412] [PATCH v2] scripts: edit: Accept generic formatting
 parameter.
In-Reply-To: <86b13fd4916ffecb1947d0879805a6d0c32542bf.1706386650.git.liliana.prikler@HIDDEN>
References: <9a666abbf1cb4b7548c1a117eaa04b0de02145ae.1705103171.git.liliana.prikler@HIDDEN>
 <86b13fd4916ffecb1947d0879805a6d0c32542bf.1706386650.git.liliana.prikler@HIDDEN>
Date: Mon, 29 Jan 2024 12:10:54 +0100
Message-ID: <87v87ciedd.fsf@HIDDEN>
MIME-Version: 1.0
Content-Type: text/plain
X-Spam-Score: -0.0 (/)
X-Debbugs-Envelope-To: 68412
Cc: Ludovic =?utf-8?Q?Court=C3=A8s?= <ludo@HIDDEN>
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -1.0 (-)

Hi,

On sam., 13 janv. 2024 at 00:35, Liliana Marie Prikler <liliana.prikler@HIDDEN> wrote:

> +@vindex GUIX_EDITOR_LOCATION_FORMAT
> +The default convention used by @code{guix edit} when invoking
> +@code{$EDITOR} is to pass it @code{+@var{line} @var{file}} to open
> +@var{file} at the given @var{line}.
> +You can change this convention for editors that do not support it
> +by setting @env{GUIX_EDITOR_LOCATION_FORMAT}.
> +For instance, to set things up with kate, use:
> +
> +@example
> +export VISUAL=kate
> +export GUIX_EDITOR_LOCATION_FORMAT='--line=$@{LINE@} $@{FILE@}'
> +# Assume you want to hack on kate
> +guix edit kate
> +@end example

First, it appears to me inconsistent to speak about EDITOR and then to
use VISUAL in the example.  I suggest to have:

    The default convention used by @code{guix edit} when invoking
    @code{$EDITOR} or @code{VISUAL} is to pass it @code{+@var{line} @var{file}} to open

and the same example.  Or change the example and replace with:

    export EDITOR=kate
    export GUIX_EDITOR_LOCATION_FORMAT='--line=$@{LINE@} $@{FILE@}'


Second, I think that using markers that can be interpreted by Bash shell
can lead to confusion.  For instance,

    $ LINE=foo; FILE=bar # somewhere in my config for whatever reasons

then:

--8<---------------cut here---------------start------------->8---
$ export GUIX_EDITOR_LOCATION_FORMAT='--line=${LINE} ${FILE}'
$ echo $GUIX_EDITOR_LOCATION_FORMAT
--line=${LINE} ${FILE}

$ export GUIX_EDITOR_LOCATION_FORMAT="--line=${LINE} ${FILE}"
$ echo $GUIX_EDITOR_LOCATION_FORMAT
--line=foo bar
--8<---------------cut here---------------end--------------->8---

Well, simple quote versus double quote appears to me subtle.


Since it is an hard text replacement, why not remove $ and just have the
placeholder {LINE} or {FILE}?  Or <LINE> and <FILE>?  Or whatever that
is not interpreted by common shells.


> +Note, that Guix only matches the literal strings @code{$@{LINE@}} and
> +@code{$@{FILE@}} here.  These may look like shell parameters, but their
> +short form is currently not supported.

Therefore, it would make that more clear or even obsolete.


Cheers,
simon




Information forwarded to guix-patches@HIDDEN:
bug#68412; Package guix-patches. Full text available.

Message received at 68412 <at> debbugs.gnu.org:


Received: (at 68412) by debbugs.gnu.org; 27 Jan 2024 20:27:22 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Sat Jan 27 15:27:22 2024
Received: from localhost ([127.0.0.1]:56002 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1rTpGr-0004EC-U3
	for submit <at> debbugs.gnu.org; Sat, 27 Jan 2024 15:27:22 -0500
Received: from mail-ej1-x644.google.com ([2a00:1450:4864:20::644]:49166)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <liliana.prikler@HIDDEN>) id 1rTpGo-0004Dk-Gs
 for 68412 <at> debbugs.gnu.org; Sat, 27 Jan 2024 15:27:19 -0500
Received: by mail-ej1-x644.google.com with SMTP id
 a640c23a62f3a-a357cba4a32so7106666b.2
 for <68412 <at> debbugs.gnu.org>; Sat, 27 Jan 2024 12:27:11 -0800 (PST)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
 d=gmail.com; s=20230601; t=1706387225; x=1706992025; darn=debbugs.gnu.org;
 h=cc:to:content-transfer-encoding:mime-version:subject:date:from
 :message-id:from:to:cc:subject:date:message-id:reply-to;
 bh=EGaMVwb1gwOvWEf42/JMqeLDVmey4lHs9+h8XkxFy1k=;
 b=U/z0xl6DNTRHT/eoylA/IGPMJtb4nMjFchGUbPnLkUwLlyNP+mXLO+2foh1jLjJyMY
 ZLWW/0s6nsX/GB6HlSYR+FNjhdf8+uM7y2C3PKoKpgJBbEGAFbG65fCpU9HuaWKxQIYm
 TRop1Jix8DqAOrMKwRDjGDutf6sgNkWq3g6xkzEMJthvR/FWcGCnHyotKKWz1mkHUYB2
 mXMpmxpL76ecYBt+p4mjxRiCY9ZnhUDDDZYx9Yck34SG83WekpzbejfMXg25vWevnF61
 cTjMpKQzOHA0gRApm6/304/TCm1MW7gyYMrqRlw8IxbE6ku+KncSjaaustfWQfGof40f
 GMcA==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
 d=1e100.net; s=20230601; t=1706387225; x=1706992025;
 h=cc:to:content-transfer-encoding:mime-version:subject:date:from
 :message-id:x-gm-message-state:from:to:cc:subject:date:message-id
 :reply-to;
 bh=EGaMVwb1gwOvWEf42/JMqeLDVmey4lHs9+h8XkxFy1k=;
 b=bdP+c46+G+1m5OnU47BLjV+kpy7FEBXGjR+lf2J9ggqEJQ3pwtJf/odSzRD9rS//tL
 kMs3/dtT5AwalhUCAtR0XwU+TXffMIYb6rg5+LjJuexcWv/3omdYlt857JaYiQB61bzJ
 rIVs+PzKuCgJoWr/4Q6OF8pVXkPAztuwl7Dx18EfN9lRgkozGGFy44tDyRqZ3kOc0n4Z
 nveojUu6JWreF7ke9/Qu2sPtpLe5zHja4OROVUlPm6bGk0o80eWqe8XEOkxXgCQ9iolD
 jHW2rK/e+EpRxPzhXb5fASNB8uXRMWK8BsQ0vkcZW4UTkLk2Pn1YC0QPzG+H/vyaDLlA
 VsXA==
X-Gm-Message-State: AOJu0YyNSeaS/BtnMzjMuChvtI3yQcbPQVlYucnh1O0e6l66ThMcmEx2
 O8mMAwaQAqDULsw1AfpTcJ8zQ/KoJ9r6i0PAYO7ZTfG7BccKVkGydnwcrFn9PQE=
X-Google-Smtp-Source: AGHT+IEAHLQwq9G/r7jfp0r2u5olLVqr0gADjiOwuuQ8UoSWaurgBfVcbfrKcjd1jozn7nzcHeSvFQ==
X-Received: by 2002:a17:906:6953:b0:a34:af8a:ee3d with SMTP id
 c19-20020a170906695300b00a34af8aee3dmr1466685ejs.16.1706387225197; 
 Sat, 27 Jan 2024 12:27:05 -0800 (PST)
Received: from lumine.fritz.box (85-127-52-93.dsl.dynamic.surfer.at.
 [85.127.52.93]) by smtp.gmail.com with ESMTPSA id
 rs10-20020a170907036a00b00a316a652c6csm2069718ejb.70.2024.01.27.12.27.04
 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256);
 Sat, 27 Jan 2024 12:27:04 -0800 (PST)
Message-ID: <86b13fd4916ffecb1947d0879805a6d0c32542bf.1706386650.git.liliana.prikler@HIDDEN>
From: Liliana Marie Prikler <liliana.prikler@HIDDEN>
Date: Sat, 13 Jan 2024 00:35:29 +0100
Subject: [PATCH v2] scripts: edit: Accept generic formatting parameter.
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
to: 68412 <at> debbugs.gnu.org
X-Spam-Score: 2.1 (++)
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: This will hopefully end the opening of unwanted files. *
 guix/scripts/edit.scm
 (%location-format): New parameter. (location->location-specification): Use
 %location-format. (spawn-editor): Adjust accordingly. 
 Content analysis details:   (2.1 points, 10.0 required)
 pts rule name              description
 ---- ---------------------- --------------------------------------------------
 -0.0 SPF_PASS               SPF: sender matches SPF record
 2.1 DATE_IN_PAST_96_XX     Date: is 96 hours or more before Received:
 date
 0.0 SPF_HELO_NONE          SPF: HELO does not publish an SPF Record
 0.0 FREEMAIL_FROM          Sender email is commonly abused enduser mail
 provider (liliana.prikler[at]gmail.com)
 -0.0 RCVD_IN_DNSWL_NONE     RBL: Sender listed at https://www.dnswl.org/,
 no trust [2a00:1450:4864:20:0:0:0:644 listed in]
 [list.dnswl.org]
 -0.0 T_SCC_BODY_TEXT_LINE   No description available.
X-Debbugs-Envelope-To: 68412
Cc: Ludovic =?ISO-8859-1?Q?Court=E8s?= <ludo@HIDDEN>,
 Simon Tournier <zimon.toutoune@HIDDEN>
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: 1.1 (+)
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:  This will hopefully end the opening of unwanted files. * guix/scripts/edit.scm
    (%location-format): New parameter. (location->location-specification): Use
    %location-format. (spawn-editor): Adjust accordingly. 
 
 Content analysis details:   (1.1 points, 10.0 required)
 
  pts rule name              description
 ---- ---------------------- --------------------------------------------------
 -0.0 RCVD_IN_DNSWL_NONE     RBL: Sender listed at https://www.dnswl.org/,
                              no trust
                             [2a00:1450:4864:20:0:0:0:644 listed in]
                             [list.dnswl.org]
 -0.0 SPF_PASS               SPF: sender matches SPF record
  2.1 DATE_IN_PAST_96_XX     Date: is 96 hours or more before Received:
                             date
  0.0 SPF_HELO_NONE          SPF: HELO does not publish an SPF Record
  0.0 FREEMAIL_FROM          Sender email is commonly abused enduser mail
                             provider (liliana.prikler[at]gmail.com)
 -0.0 T_SCC_BODY_TEXT_LINE   No description available.
 -1.0 MAILING_LIST_MULTI     Multiple indicators imply a widely-seen list
                             manager

This will hopefully end the opening of unwanted files.

* guix/scripts/edit.scm (%location-format): New parameter.
(location->location-specification): Use %location-format.
(spawn-editor): Adjust accordingly.

Fixes: Pass special flags to ‘kate’ <https://bugs.gnu.org/44272#14>
---
Am Samstag, dem 27.01.2024 um 15:07 +0100 schrieb Ludovic Courtès:
> Hi Liliana,
> 
> Liliana Marie Prikler <liliana.prikler@HIDDEN> skribis:
> 
> > This will hopefully end the opening of unwanted files.
> > 
> > * guix/scripts/edit.scm (%location-format): New parameter.
> > (location->location-specification): Use %location-format.
> > (spawn-editor): Adjust accordingly.
> > 
> > Fixes: Pass special flags to ‘kate’ <https://bugs.gnu.org/44272#14>
> 
> Rather: “Fixes <https://issues.guix.gnu.org/44272>.”
I'm using a convention that I've proposed earlier in [1].
Since we're currently adding ChangeIds without any of the supported
infra (AFAIK), I think following my own proposal here is fair game.
As for why I took the message instead of the bug itself, the bug was
marked as done without resolving it, so I think linking to the
message is more correct.

> [...]
> I’d word it slightly differently, like:
> [...]
I changed the wording.  Let me know WDYT.

> Leftover debugging statement?
Yup.

> I’m still wondering about the relative merits of this approach vs.
> the less generic but ready-to-use special-casing of Kate and VSCode
> [...]
With every decade bringing a new hot editor, we'd be special-casing
a lot.

Cheers

[1] https://lists.gnu.org/archive/html/guix-devel/2023-09/msg00225.html

 doc/guix.texi         | 29 +++++++++++++++++++++++++++++
 guix/scripts/edit.scm | 20 ++++++++++++++------
 2 files changed, 43 insertions(+), 6 deletions(-)

diff --git a/doc/guix.texi b/doc/guix.texi
index c458befb76..2ae3871464 100644
--- a/doc/guix.texi
+++ b/doc/guix.texi
@@ -13989,6 +13989,35 @@ Invoking guix edit
 @var{directory}}) allows you to add @var{directory} to the front of the
 package module search path and so make your own packages visible.
 
+@vindex GUIX_EDITOR_LOCATION_FORMAT
+The default convention used by @code{guix edit} when invoking
+@code{$EDITOR} is to pass it @code{+@var{line} @var{file}} to open
+@var{file} at the given @var{line}.
+You can change this convention for editors that do not support it
+by setting @env{GUIX_EDITOR_LOCATION_FORMAT}.
+For instance, to set things up with kate, use:
+
+@example
+export VISUAL=kate
+export GUIX_EDITOR_LOCATION_FORMAT='--line=$@{LINE@} $@{FILE@}'
+# Assume you want to hack on kate
+guix edit kate
+@end example
+
+Alternatively, for gnome-text-editor, which has no such flag, simply
+skip it:
+
+@example
+export VISUAL=gnome-text-editor
+export GUIX_EDITOR_LOCATION_FORMAT='$@{FILE@}'
+# Assume you want to hack on gnome
+guix edit gnome
+@end example
+
+Note, that Guix only matches the literal strings @code{$@{LINE@}} and
+@code{$@{FILE@}} here.  These may look like shell parameters, but their
+short form is currently not supported.
+
 @node Invoking guix download
 @section Invoking @command{guix download}
 
diff --git a/guix/scripts/edit.scm b/guix/scripts/edit.scm
index b7b4cd2514..130470dbc1 100644
--- a/guix/scripts/edit.scm
+++ b/guix/scripts/edit.scm
@@ -25,6 +25,7 @@ (define-module (guix scripts edit)
   #:use-module ((guix diagnostics)
                 #:select (location-file location-line))
   #:use-module (gnu packages)
+  #:use-module (ice-9 string-fun)
   #:use-module (srfi srfi-1)
   #:use-module (srfi srfi-37)
   #:export (%editor
@@ -62,6 +63,10 @@ (define %editor
   ;; For development, user can set custom value for $EDITOR.
   (make-parameter (or (getenv "VISUAL") (getenv "EDITOR") "nano")))
 
+(define %location-format
+  (make-parameter (or (getenv "GUIX_EDITOR_LOCATION_FORMAT")
+                      "+${LINE} ${FILE}")))
+
 (define (search-path* path file)
   "Like 'search-path' but exit if FILE is not found."
   (let ((absolute-file-name (or (search-path path file)
@@ -78,18 +83,21 @@ (define (search-path* path file)
 (define (location->location-specification location)
   "Return the location specification for LOCATION for a typical editor command
 line."
-  (list (string-append "+"
-                       (number->string
-                        (location-line location)))
-        (search-path* %load-path (location-file location))))
+  (let* ((spec (%location-format))
+         (spec (string-replace-substring
+                spec "${LINE}"
+                (number->string (location-line location))))
+         (spec (string-replace-substring
+                spec "${FILE}"
+                (search-path* %load-path (location-file location)))))
+    spec))
 
 (define (spawn-editor locations)
   "Spawn (%editor) to edit the code at LOCATIONS, a list of <location>
 records, and exit."
   (catch 'system-error
     (lambda ()
-      (let ((file-names (append-map location->location-specification
-                                    locations)))
+      (let ((file-names (map location->location-specification locations)))
         ;; Use `system' instead of `exec' in order to sanely handle
         ;; possible command line arguments in %EDITOR.
         (exit (system (string-join (cons (%editor) file-names))))))

base-commit: dc8aa525174d25331d74576faf0643e45bc152c4
-- 
2.41.0





Information forwarded to guix-patches@HIDDEN:
bug#68412; Package guix-patches. Full text available.

Message received at 68412 <at> debbugs.gnu.org:


Received: (at 68412) by debbugs.gnu.org; 27 Jan 2024 14:07:56 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Sat Jan 27 09:07:56 2024
Received: from localhost ([127.0.0.1]:53678 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1rTjLg-00016Q-3R
	for submit <at> debbugs.gnu.org; Sat, 27 Jan 2024 09:07:56 -0500
Received: from eggs.gnu.org ([2001:470:142:3::10]:53676)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <ludo@HIDDEN>) id 1rTjLe-00016B-9E
 for 68412 <at> debbugs.gnu.org; Sat, 27 Jan 2024 09:07:54 -0500
Received: from fencepost.gnu.org ([2001:470:142:3::e])
 by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256)
 (Exim 4.90_1) (envelope-from <ludo@HIDDEN>)
 id 1rTjLR-0004qI-OT; Sat, 27 Jan 2024 09:07:41 -0500
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=gnu.org;
 s=fencepost-gnu-org; h=MIME-Version:Date:References:In-Reply-To:Subject:To:
 From; bh=lws0XyFBkJvKMgv3WRAs05Q2fuxMo06SDMliKkkJ1b4=; b=YDx8jjsXYltVqPK0DNJ2
 WmE0Vshu7FamyzQ3btuYWOmGH69zQrIA7hl9yNCBcax5mV7BAIU0mcE8zyXRP9dSXm6v/Ta2i1Uj3
 0elG96WjGW8E+c+G/fDH6XV/rGTGdIwhLGJOb7I6jtK+kVUah7iEcV0WpWfkI83dJkLjvJm2XXikb
 2my8my14ZuO0JkRe/sRCeCwNUueeVPSSH1m3nqPwbwM0RGkbIcIBOSgvnEpbdHRM8Trg90k+DTbZ5
 1QjNmD0vgkXIqVjYZ0Ln/9yPfIAOB2Mez/zksbmfskLxrduKS8n5+4k0izjCLdBO6rpSMZrgougJI
 O9qJo/nLOqRypA==;
From: =?utf-8?Q?Ludovic_Court=C3=A8s?= <ludo@HIDDEN>
To: Liliana Marie Prikler <liliana.prikler@HIDDEN>
Subject: Re: [bug#68412] [PATCH] scripts: edit: Accept generic formatting
 parameter.
In-Reply-To: <9a666abbf1cb4b7548c1a117eaa04b0de02145ae.1705103171.git.liliana.prikler@HIDDEN>
 (Liliana Marie Prikler's message of "Sat, 13 Jan 2024 00:35:29 +0100")
References: <9a666abbf1cb4b7548c1a117eaa04b0de02145ae.1705103171.git.liliana.prikler@HIDDEN>
Date: Sat, 27 Jan 2024 15:07:38 +0100
Message-ID: <87bk96lvit.fsf@HIDDEN>
User-Agent: Gnus/5.13 (Gnus v5.13)
MIME-Version: 1.0
Content-Type: text/plain; charset=utf-8
Content-Transfer-Encoding: quoted-printable
X-Spam-Score: -2.3 (--)
X-Debbugs-Envelope-To: 68412
Cc: 68412 <at> debbugs.gnu.org, Simon Tournier <zimon.toutoune@HIDDEN>
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -3.3 (---)

Hi Liliana,

Liliana Marie Prikler <liliana.prikler@HIDDEN> skribis:

> This will hopefully end the opening of unwanted files.
>
> * guix/scripts/edit.scm (%location-format): New parameter.
> (location->location-specification): Use %location-format.
> (spawn-editor): Adjust accordingly.
>
> Fixes: Pass special flags to =E2=80=98kate=E2=80=99 <https://bugs.gnu.org=
/44272#14>

Rather: =E2=80=9CFixes <https://issues.guix.gnu.org/44272>.=E2=80=9D

> +By default, Guix assumes that @env{EDITOR} uses the
> +``+@var{LINE} @var{FILE}'' convention to scroll to a particular line
> +within a file.  However, not all editors use this convention.
> +For instance, @command{kate} instead wants you to use @code{--line}.
> +Some minimal editors may not even have an option to pass the line.
> +In both cases, an additional file named ``+@var{LINE}'' would be
> +opened instead.  To prevent this from happening, you can customize
> +@env{GUIX_EDITOR_LOCATION_FORMAT}, using the literal strings
> +`${FILE}' to denote @var{FILE} and `${LINE}' to denote @var{LINE}
> +respectively.

I=E2=80=99d word it slightly differently, like:

  @vindex GUIX_EDITOR_LOCATION_FORMAT
  The default convention used by @code{guix edit} when invoking
  @code{$EDITOR} is to pass it @code{+@VAR{line} @var{file}} to open
  @var{file} at the given @var{line}.  You can change this convention
  for editors that do not support it by setting
  @env{GUIX_EDITOR_LOCATION_FORMAT}.  For example, when using Kate, you
  should set:

  @example
  # Convention for =E2=80=98kate=E2=80=99.
  export GUIX_EDITOR_LOCATION_FORMAT=3D'--whatever ${FILE}'
  @end example

  Likewise, for @command{guix edit} to invoke VSCode, you must specify
  this setting:

  @example
  # Settings for VSCode.
  export GUIX_EDITOR_LOCATION_FORMAT=3D'--whatever ${FILE}'
  @end example
=20=20
> +  (let* ((spec (peek (%location-format)))

Leftover debugging statement?

I=E2=80=99m still wondering about the relative merits of this approach vs. =
the
less generic but ready-to-use special-casing of Kate and VSCode based on
the basename of $EDITOR, but I don=E2=80=99t have a strong opinion.

Otherwise LGTM, thanks!

Ludo=E2=80=99.




Information forwarded to guix-patches@HIDDEN:
bug#68412; Package guix-patches. Full text available.

Message received at submit <at> debbugs.gnu.org:


Received: (at submit) by debbugs.gnu.org; 12 Jan 2024 23:46:46 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Fri Jan 12 18:46:45 2024
Received: from localhost ([127.0.0.1]:37969 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1rOREb-0006Rt-4K
	for submit <at> debbugs.gnu.org; Fri, 12 Jan 2024 18:46:45 -0500
Received: from lists.gnu.org ([2001:470:142::17]:39148)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <liliana.prikler@HIDDEN>) id 1rOREX-0006KZ-Io
 for submit <at> debbugs.gnu.org; Fri, 12 Jan 2024 18:46:43 -0500
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 <liliana.prikler@HIDDEN>)
 id 1rORET-0007rq-3W
 for guix-patches@HIDDEN; Fri, 12 Jan 2024 18:46:37 -0500
Received: from mail-wm1-x343.google.com ([2a00:1450:4864:20::343])
 by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128)
 (Exim 4.90_1) (envelope-from <liliana.prikler@HIDDEN>)
 id 1rOREQ-0002Mt-7T; Fri, 12 Jan 2024 18:46:36 -0500
Received: by mail-wm1-x343.google.com with SMTP id
 5b1f17b1804b1-40e68d836bcso7074315e9.2; 
 Fri, 12 Jan 2024 15:46:31 -0800 (PST)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
 d=gmail.com; s=20230601; t=1705103188; x=1705707988; darn=gnu.org;
 h=cc:to:content-transfer-encoding:mime-version:subject:date:from
 :message-id:from:to:cc:subject:date:message-id:reply-to;
 bh=aQFypJtNcnrX8ub64gTq4EpPyf/AL36gfT1suiTftk8=;
 b=aDFmkLoGgj9ZPh/DkXhOBxFTUqY4P31gERT23BKbDgmcvfqlGtbrL3czLB49dS6FMR
 3tr8BXn9TPdVyqlHL3J6zo03ptbLQ9vbyyOuXCI3/i3QkcdsWoUDJ6uRVBbDfs1ByXft
 DBMgyD/GwGTHiIFoCk2HGlzgL2KnSVVt5Yz8wErwMa2/vv1Xti9a7819kas7qZ9iQG8C
 VdPtC0LfGCaHo+6OyzhHun+MhwcOXB9G4UL3+MXW14CeNHA/G513ERcbDb0KSK4ANRCb
 VOlh/0aIFvcOPP+S6HtjdfbXlhFZkuSKaKxNCuoI5XDp1Q/ux0bDM7ZGHseLUjPv4SJH
 lJCA==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
 d=1e100.net; s=20230601; t=1705103188; x=1705707988;
 h=cc:to:content-transfer-encoding:mime-version:subject:date:from
 :message-id:x-gm-message-state:from:to:cc:subject:date:message-id
 :reply-to;
 bh=aQFypJtNcnrX8ub64gTq4EpPyf/AL36gfT1suiTftk8=;
 b=sKW09BeBlO79jhubv4Bp8zR5+3ss7dycw8g621EOFC9YD1fL6UJxWM3fkNOyVFrrhW
 /SSZGpvbdG6ROCMDXq2ZtCYiKXprF+pUu1FE/0Z3bHegoQdY6Psx4+K2eogVka61yQUi
 cN9mCZb0oVpaPC0s9tl02m/G+KnGc2zog4M1O2lREtMm04fK16KJCgH0D0+g6bVxQ3pB
 p2C7qLRvpnIuoamxRGTVXR9SaemUidn5Cjjz0f6u5vJ+HnlA6nBKcth1KH4cDFpPWvlP
 VakO8eGpFlF1gM+sZMO9jwAddjh5c+U6wYiCBHvENCBwxEjPgmeiI6xeaZCQSVrorrEf
 Sq7A==
X-Gm-Message-State: AOJu0Yymk4+Klf1B7RbivzjF+8S1+o8PUWrylXBeiugHIjKYrsOT10bl
 sAYTDKK65Nm1Kmb46eAtUe3U7ucopzOffw==
X-Google-Smtp-Source: AGHT+IHl3Ue5/hGkaP/brGiARSRz0irj35y8U8aSXM3KXw57vYE83OIpFb8+QQGIK+5K30fqgRynwA==
X-Received: by 2002:a05:600c:474a:b0:40e:4afa:d398 with SMTP id
 w10-20020a05600c474a00b0040e4afad398mr1115600wmo.14.1705103188066; 
 Fri, 12 Jan 2024 15:46:28 -0800 (PST)
Received: from lumine.fritz.box (85-127-52-93.dsl.dynamic.surfer.at.
 [85.127.52.93]) by smtp.gmail.com with ESMTPSA id
 r16-20020a056000015000b003376af392e5sm5056942wrx.38.2024.01.12.15.46.27
 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256);
 Fri, 12 Jan 2024 15:46:27 -0800 (PST)
Message-ID: <9a666abbf1cb4b7548c1a117eaa04b0de02145ae.1705103171.git.liliana.prikler@HIDDEN>
From: Liliana Marie Prikler <liliana.prikler@HIDDEN>
Date: Sat, 13 Jan 2024 00:35:29 +0100
Subject: [PATCH] scripts: edit: Accept generic formatting parameter.
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
to: guix-patches@HIDDEN
Received-SPF: pass client-ip=2a00:1450:4864:20::343;
 envelope-from=liliana.prikler@HIDDEN; helo=mail-wm1-x343.google.com
X-Spam_score_int: -20
X-Spam_score: -2.1
X-Spam_bar: --
X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1,
 DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, FREEMAIL_FROM=0.001,
 RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001,
 T_SCC_BODY_TEXT_LINE=-0.01 autolearn=ham autolearn_force=no
X-Spam_action: no action
X-Spam-Score: 1.0 (+)
X-Debbugs-Envelope-To: submit
Cc: Ludovic =?ISO-8859-1?Q?Court=E8s?= <ludo@HIDDEN>,
 Simon Tournier <zimon.toutoune@HIDDEN>
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -0.0 (/)

This will hopefully end the opening of unwanted files.

* guix/scripts/edit.scm (%location-format): New parameter.
(location->location-specification): Use %location-format.
(spawn-editor): Adjust accordingly.

Fixes: Pass special flags to ‘kate’ <https://bugs.gnu.org/44272#14>
---
 doc/guix.texi         | 18 ++++++++++++++++++
 guix/scripts/edit.scm | 20 ++++++++++++++------
 2 files changed, 32 insertions(+), 6 deletions(-)

diff --git a/doc/guix.texi b/doc/guix.texi
index 811edd0bf7..8dca1272a2 100644
--- a/doc/guix.texi
+++ b/doc/guix.texi
@@ -13987,6 +13987,24 @@ Invoking guix edit
 @var{directory}}) allows you to add @var{directory} to the front of the
 package module search path and so make your own packages visible.
 
+By default, Guix assumes that @env{EDITOR} uses the
+``+@var{LINE} @var{FILE}'' convention to scroll to a particular line
+within a file.  However, not all editors use this convention.
+For instance, @command{kate} instead wants you to use @code{--line}.
+Some minimal editors may not even have an option to pass the line.
+In both cases, an additional file named ``+@var{LINE}'' would be
+opened instead.  To prevent this from happening, you can customize
+@env{GUIX_EDITOR_LOCATION_FORMAT}, using the literal strings
+`${FILE}' to denote @var{FILE} and `${LINE}' to denote @var{LINE}
+respectively.
+For instance:
+
+@example
+GUIX_EDITOR_LOCATION_FORMAT='${FILE}' guix edit gnome
+# will open @var{directory}/gnu/packages/gnome.scm, but not scroll to
+# the definition of gnome
+@end example
+
 @node Invoking guix download
 @section Invoking @command{guix download}
 
diff --git a/guix/scripts/edit.scm b/guix/scripts/edit.scm
index b7b4cd2514..13b8a4559c 100644
--- a/guix/scripts/edit.scm
+++ b/guix/scripts/edit.scm
@@ -25,6 +25,7 @@ (define-module (guix scripts edit)
   #:use-module ((guix diagnostics)
                 #:select (location-file location-line))
   #:use-module (gnu packages)
+  #:use-module (ice-9 string-fun)
   #:use-module (srfi srfi-1)
   #:use-module (srfi srfi-37)
   #:export (%editor
@@ -62,6 +63,10 @@ (define %editor
   ;; For development, user can set custom value for $EDITOR.
   (make-parameter (or (getenv "VISUAL") (getenv "EDITOR") "nano")))
 
+(define %location-format
+  (make-parameter (or (getenv "GUIX_EDITOR_LOCATION_FORMAT")
+                      "+${LINE} ${FILE}")))
+
 (define (search-path* path file)
   "Like 'search-path' but exit if FILE is not found."
   (let ((absolute-file-name (or (search-path path file)
@@ -78,18 +83,21 @@ (define (search-path* path file)
 (define (location->location-specification location)
   "Return the location specification for LOCATION for a typical editor command
 line."
-  (list (string-append "+"
-                       (number->string
-                        (location-line location)))
-        (search-path* %load-path (location-file location))))
+  (let* ((spec (peek (%location-format)))
+         (spec (string-replace-substring
+                spec "${LINE}"
+                (number->string (location-line location))))
+         (spec (string-replace-substring
+                spec "${FILE}"
+                (search-path* %load-path (location-file location)))))
+    spec))
 
 (define (spawn-editor locations)
   "Spawn (%editor) to edit the code at LOCATIONS, a list of <location>
 records, and exit."
   (catch 'system-error
     (lambda ()
-      (let ((file-names (append-map location->location-specification
-                                    locations)))
+      (let ((file-names (map location->location-specification locations)))
         ;; Use `system' instead of `exec' in order to sanely handle
         ;; possible command line arguments in %EDITOR.
         (exit (system (string-join (cons (%editor) file-names))))))

base-commit: 3619dd7d059d1141acf39872f57e55b458dc8257
-- 
2.41.0





Acknowledgement sent to Liliana Marie Prikler <liliana.prikler@HIDDEN>:
New bug report received and forwarded. Copy sent to guix-patches@HIDDEN. Full text available.
Report forwarded to guix-patches@HIDDEN:
bug#68412; Package guix-patches. Full text available.
Please note: This is a static page, with minimal formatting, updated once a day.
Click here to see this page with the latest information and nicer formatting.
Last modified: Thu, 8 Feb 2024 18:15:01 UTC

GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997 nCipher Corporation Ltd, 1994-97 Ian Jackson.