From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mp1.migadu.com ([2001:41d0:403:58f0::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by ms8.migadu.com with LMTPS id UB4iM3fnt2XHoAAA62LTzQ:P1 (envelope-from ) for ; Mon, 29 Jan 2024 18:59:19 +0100 Received: from aspmx1.migadu.com ([2001:41d0:403:58f0::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by mp1.migadu.com with LMTPS id UB4iM3fnt2XHoAAA62LTzQ (envelope-from ) for ; Mon, 29 Jan 2024 18:59:19 +0100 X-Envelope-To: larch@yhetil.org Authentication-Results: aspmx1.migadu.com; dkim=fail ("headers rsa verify failed") header.d=gmail.com header.s=20230601 header.b=W+PtfLJJ; spf=pass (aspmx1.migadu.com: domain of "guix-patches-bounces+larch=yhetil.org@gnu.org" designates 209.51.188.17 as permitted sender) smtp.mailfrom="guix-patches-bounces+larch=yhetil.org@gnu.org"; dmarc=fail reason="SPF not aligned (relaxed)" header.from=gmail.com (policy=none) ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=yhetil.org; s=key1; t=1706551159; 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=QpeJ2p5wAWcDVdiKDjuAbRdS2F7m4KaKVTjVv6TzvEg=; b=gBcXk6BB6eXjUXmHMpOSM4PqkFsdEA143akV24WGuCOWPS7zuyKMIPVZ/pDUQUwrvOQx2z fl0+EKZ/7nTgTV0gxgQ+3BYgxWpTuSFqv/+3MpHfEXXOIdk73BWWKD2Ny7xNNdipxdS7sw gAx3CRDiIqigT2UeFOwlsXDyGZPZaqGsZx7d10af7dxI5jxJFDiPWmfln+7uORaPSrLvQb oeIw3n8nqTPD2Z6MTadU+aMGhr0JmBpRWgttL7mCFBFIDEKH+FO2D/AvxpOY/PEve7S4Ih EVgWyr5JTs0HgvI1amnWJmkDHvhvxK7ndwfrxKy20YTBypisGN12SbCAC0HNkw== ARC-Authentication-Results: i=1; aspmx1.migadu.com; dkim=fail ("headers rsa verify failed") header.d=gmail.com header.s=20230601 header.b=W+PtfLJJ; spf=pass (aspmx1.migadu.com: domain of "guix-patches-bounces+larch=yhetil.org@gnu.org" designates 209.51.188.17 as permitted sender) smtp.mailfrom="guix-patches-bounces+larch=yhetil.org@gnu.org"; dmarc=fail reason="SPF not aligned (relaxed)" header.from=gmail.com (policy=none) ARC-Seal: i=1; s=key1; d=yhetil.org; t=1706551159; a=rsa-sha256; cv=none; b=mKdRUYyTYtFcilhQQENdNMoDdEnmlEBl5UYs8QvbDjzOcBZmDFBsPUkk1HWrczpH4m39vc 87zx0L715alu1d20aFCVNLAF05SgbNhfPuGODtVAvJpqktU+Bf5WL+AIwGyiLbQKhkUmsp fFe02jOfzWawfx2uP0SsaToK6SvOGNCuZ4IcQ9vjWE9ApLHR+ogVm09tPlOvqW0WuUSLQA tgrk7K+o9JxaxKOFAYEYfK14+ZUfr2qp86qwI0eSvZoUGSUWlvB7DWtH63klwnieWe+3ES pl4NT5ssifciU6Pe/TJ2j9NTEfogBiJI6h80EpZgtHswwJIiLZqtlu4dG1+BSw== 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 8BA066DF5F for ; Mon, 29 Jan 2024 18:59:19 +0100 (CET) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1rUVuQ-0007yw-1i; Mon, 29 Jan 2024 12:59:03 -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 ) id 1rUVuI-0007wy-Ke for guix-patches@gnu.org; Mon, 29 Jan 2024 12:58:55 -0500 Received: from debbugs.gnu.org ([2001:470:142:5::43]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1rUVuI-0003Xx-BK for guix-patches@gnu.org; Mon, 29 Jan 2024 12:58:54 -0500 Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1rUVuQ-00067t-Df for guix-patches@gnu.org; Mon, 29 Jan 2024 12:59:02 -0500 X-Loop: help-debbugs@gnu.org Subject: [bug#68412] [PATCH v2] scripts: edit: Accept generic formatting parameter. Resent-From: Liliana Marie Prikler Original-Sender: "Debbugs-submit" Resent-CC: guix-patches@gnu.org Resent-Date: Mon, 29 Jan 2024 17:59:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 68412 X-GNU-PR-Package: guix-patches X-GNU-PR-Keywords: patch To: Simon Tournier , 68412@debbugs.gnu.org Cc: Ludovic =?UTF-8?Q?Court=C3=A8s?= Received: via spool by 68412-submit@debbugs.gnu.org id=B68412.170655113123531 (code B ref 68412); Mon, 29 Jan 2024 17:59:02 +0000 Received: (at 68412) by debbugs.gnu.org; 29 Jan 2024 17:58:51 +0000 Received: from localhost ([127.0.0.1]:33401 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1rUVuE-00067T-C1 for submit@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 ) id 1rUVuC-00067D-4i for 68412@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@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@gmail.com> From: Liliana Marie Prikler Date: Mon, 29 Jan 2024 18:58:31 +0100 In-Reply-To: <87v87ciedd.fsf@gmail.com> References: <9a666abbf1cb4b7548c1a117eaa04b0de02145ae.1705103171.git.liliana.prikler@gmail.com> <86b13fd4916ffecb1947d0879805a6d0c32542bf.1706386650.git.liliana.prikler@gmail.com> <87v87ciedd.fsf@gmail.com> Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable User-Agent: Evolution 3.46.4 MIME-Version: 1.0 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-bounces+larch=yhetil.org@gnu.org X-Migadu-Flow: FLOW_IN X-Migadu-Country: US X-Migadu-Spam-Score: 2.34 X-Migadu-Queue-Id: 8BA066DF5F X-Spam-Score: 2.34 X-Migadu-Scanner: mx11.migadu.com X-TUID: 6k/QS0UYlsjT 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 > 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 and ?=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