From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mp2.migadu.com ([2001:41d0:303:e224::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by ms8.migadu.com with LMTPS id qPnOEXMOtWVkmAAAe85BDQ:P1 (envelope-from ) for ; Sat, 27 Jan 2024 15:08:51 +0100 Received: from aspmx1.migadu.com ([2001:41d0:303:e224::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by mp2.migadu.com with LMTPS id qPnOEXMOtWVkmAAAe85BDQ (envelope-from ) for ; Sat, 27 Jan 2024 15:08:51 +0100 X-Envelope-To: larch@yhetil.org Authentication-Results: aspmx1.migadu.com; dkim=fail ("headers rsa verify failed") header.d=gnu.org header.s=fencepost-gnu-org header.b=YDx8jjsX; dmarc=pass (policy=none) header.from=gnu.org; 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=1706364531; 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=lws0XyFBkJvKMgv3WRAs05Q2fuxMo06SDMliKkkJ1b4=; b=ilCnF+Sq0rDxPlFEpcF17zt82T7H8O0bNN3AY8nWIBj6UYZ9gZ8n2DON4b5NIU60+a6635 tWRtrO0dWgNZCvDxcjx6kWGhpOMjFh96YnehB7baaU4Ez82zZSKM7StD3/d8AmaWFAK/Eu adcc+/gJHgP+Z1b1m8d4YT2Bn1gwqNmdi5FIOhLSn7J/BlRF+JXImkbYxmi9tV8qM6fkrx Cmwb6He/4chLsstJDzL1IJo9wxrfsV8+84oKMuHdI2Dw8MRe/JdZw0y6ObiKX1JmBN9hLx 9Y9+GopJm9JlFzPCgeStUtHndbVrrdhvs9Kj3ysuZgI9l2B6olh/dHTtBZpsqg== ARC-Authentication-Results: i=1; aspmx1.migadu.com; dkim=fail ("headers rsa verify failed") header.d=gnu.org header.s=fencepost-gnu-org header.b=YDx8jjsX; dmarc=pass (policy=none) header.from=gnu.org; 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=1706364531; a=rsa-sha256; cv=none; b=mBQzIqT6BTG580qOVF52VEgbKCi87teVTBg23K87w/B0iHVZ+4Dz5tcY4po1UUlAkM0DDc CuC+KwB7MzdGtBRONT/8T5Y1w6P3kmkfWkZOnlWbazYnfuIaBQBuemDdd298r+i4eoN5hx NFOthUwtW+FBgHWfGd6RxxPvTE+OcGzeG5XeB37e3zdjT1rurM6d1pL0yQuj4tT5jEaQOx HmMiqqgIV5tWHFNQb3+d2OLhqsOJx+ZeXbqotHJjCznEHhL2HM7yt7Awgiyas4mFVgRO+F pFEDet2H1h78ScRY9e1f0APeYAPfmy1e4rhSHSz6E0RV1mBZD/x+eS0XMtHFLQ== 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 31B1835062 for ; Sat, 27 Jan 2024 15:08:51 +0100 (CET) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1rTjLm-0007Vc-4X; Sat, 27 Jan 2024 09:08:04 -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 1rTjLf-0007U8-7b for guix-patches@gnu.org; Sat, 27 Jan 2024 09:07:57 -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 1rTjLe-0004v5-Ty for guix-patches@gnu.org; Sat, 27 Jan 2024 09:07:54 -0500 Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1rTjLl-00016n-Vy for guix-patches@gnu.org; Sat, 27 Jan 2024 09:08:01 -0500 X-Loop: help-debbugs@gnu.org Subject: [bug#68412] [PATCH] scripts: edit: Accept generic formatting parameter. Resent-From: Ludovic =?UTF-8?Q?Court=C3=A8s?= Original-Sender: "Debbugs-submit" Resent-CC: guix-patches@gnu.org Resent-Date: Sat, 27 Jan 2024 14:08:01 +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 Cc: 68412@debbugs.gnu.org, Simon Tournier Received: via spool by 68412-submit@debbugs.gnu.org id=B68412.17063644764246 (code B ref 68412); Sat, 27 Jan 2024 14:08:01 +0000 Received: (at 68412) by debbugs.gnu.org; 27 Jan 2024 14:07:56 +0000 Received: from localhost ([127.0.0.1]:53678 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1rTjLg-00016Q-3R for submit@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 ) id 1rTjLe-00016B-9E for 68412@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 ) 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: Ludovic =?UTF-8?Q?Court=C3=A8s?= In-Reply-To: <9a666abbf1cb4b7548c1a117eaa04b0de02145ae.1705103171.git.liliana.prikler@gmail.com> (Liliana Marie Prikler's message of "Sat, 13 Jan 2024 00:35:29 +0100") References: <9a666abbf1cb4b7548c1a117eaa04b0de02145ae.1705103171.git.liliana.prikler@gmail.com> Date: Sat, 27 Jan 2024 15:07:38 +0100 Message-ID: <87bk96lvit.fsf@gnu.org> 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-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: -7.36 X-Spam-Score: -7.36 X-Migadu-Queue-Id: 31B1835062 X-Migadu-Scanner: mx12.migadu.com X-TUID: 3ecKLXKaKjfF Hi Liliana, Liliana Marie Prikler 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 Rather: =E2=80=9CFixes .=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.