From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mp0.migadu.com ([2001:41d0:403:4876::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by ms8.migadu.com with LMTPS id WFhzOxSIt2XaogAAqHPOHw:P1 (envelope-from ) for ; Mon, 29 Jan 2024 12:12:21 +0100 Received: from aspmx1.migadu.com ([2001:41d0:403:4876::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by mp0.migadu.com with LMTPS id WFhzOxSIt2XaogAAqHPOHw (envelope-from ) for ; Mon, 29 Jan 2024 12:12:21 +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=L84ux5mv; dmarc=fail reason="SPF not aligned (relaxed)" header.from=gmail.com (policy=none); 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" ARC-Seal: i=1; s=key1; d=yhetil.org; t=1706526740; a=rsa-sha256; cv=none; b=lf6fzObth+eCZqtJCHLOAdLLIxyLwcpijy6sJItIoMGOCe3+HFJjL2Ze7KnTZ6Wlmr0Spf LFlE2eLo5of0/MF0o6cdThr7KQ04lONUt0UMdpfyQzao9IpsnQwDrAVkDC/aqVObU40MC5 9S+AyWecjP6dMObmhWsoxiFVykN5NZroMbrjC20ZtohuDIA5DOGvJIRQGcMYvhKzrtTpB3 c6+Re339pv9nB7DksVyYPYqwKMS3L9YzPwgZtTXj4p3urlABmWK/ciFY/nmJqhhX4dnXlb 0xDJfhZc072dCAIL3otov4LpS03SJVcVTW54EGg9e84VVcjgyRMdRDQBwUHhOQ== ARC-Authentication-Results: i=1; aspmx1.migadu.com; dkim=fail ("headers rsa verify failed") header.d=gmail.com header.s=20230601 header.b=L84ux5mv; dmarc=fail reason="SPF not aligned (relaxed)" header.from=gmail.com (policy=none); 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" ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=yhetil.org; s=key1; t=1706526740; 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: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=KM2W+RHjs26o7GJLgfCA1e/m2ZOGZ11rcBOqjHBEEUA=; b=eLlPU+hEJ/mXItcLbWGofGHlHkwlXYiJRuQ9pkW81VjHwVK8DmJKW/AS7Jd5Be1OvdVTa5 Ao2yVdiRRVRmGP5LG10UmCazh/XW+Cuo6swHo8A4bvxGAOgeN4YG3H8zQ3q1lLpkwR+gbi gNR5jsfiZ+N6/KlVMmZWBvxzC1aJDdEOOFwQGc6UFSLmoMBgehjBxSl3h46aNOr0ceRxhd 7IVSD4wfGd0D0eC87W2FfpigW2M7bklLOkcJKVFm9j77a15M2At3a7Kp8SzOZUDhDfHvOf /+Iw0RtvGUbZcGQmmxN8diZwHFXK8idUYYZpqzgh61JKEmx+jq1cpyJtoIO+fA== 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 A1F8671003 for ; Mon, 29 Jan 2024 12:12:20 +0100 (CET) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1rUPYT-0001EE-RH; Mon, 29 Jan 2024 06:11:57 -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 1rUPYR-0001D8-Pm for guix-patches@gnu.org; Mon, 29 Jan 2024 06:11: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 1rUPYQ-0005MY-Qg for guix-patches@gnu.org; Mon, 29 Jan 2024 06:11:55 -0500 Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1rUPYY-0002Yf-Gx for guix-patches@gnu.org; Mon, 29 Jan 2024 06:12:02 -0500 X-Loop: help-debbugs@gnu.org Subject: [bug#68412] [PATCH v2] scripts: edit: Accept generic formatting parameter. Resent-From: Simon Tournier Original-Sender: "Debbugs-submit" Resent-CC: guix-patches@gnu.org Resent-Date: Mon, 29 Jan 2024 11:12: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: Liliana Marie Prikler , 68412@debbugs.gnu.org Cc: Ludovic =?UTF-8?Q?Court=C3=A8s?= Received: via spool by 68412-submit@debbugs.gnu.org id=B68412.17065266759769 (code B ref 68412); Mon, 29 Jan 2024 11:12:02 +0000 Received: (at 68412) by debbugs.gnu.org; 29 Jan 2024 11:11:15 +0000 Received: from localhost ([127.0.0.1]:59133 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1rUPXm-0002XU-Ud for submit@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 ) id 1rUPXl-0002XA-5K for 68412@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@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 In-Reply-To: <86b13fd4916ffecb1947d0879805a6d0c32542bf.1706386650.git.liliana.prikler@gmail.com> References: <9a666abbf1cb4b7548c1a117eaa04b0de02145ae.1705103171.git.liliana.prikler@gmail.com> <86b13fd4916ffecb1947d0879805a6d0c32542bf.1706386650.git.liliana.prikler@gmail.com> Date: Mon, 29 Jan 2024 12:10:54 +0100 Message-ID: <87v87ciedd.fsf@gmail.com> MIME-Version: 1.0 Content-Type: text/plain 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-Scanner: mx10.migadu.com X-Spam-Score: -5.56 X-Migadu-Queue-Id: A1F8671003 X-Migadu-Spam-Score: -5.56 X-TUID: kD+f4KgeahlA Hi, On sam., 13 janv. 2024 at 00:35, Liliana Marie Prikler 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 and ? 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