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

Previous Next

Package: guix-patches;

Reported by: Liliana Marie Prikler <liliana.prikler <at> gmail.com>

Date: Fri, 12 Jan 2024 23:47:01 UTC

Severity: normal

Tags: patch

Full log


Message #29 received at 68412 <at> debbugs.gnu.org (full text, mbox):

From: Liliana Marie Prikler <liliana.prikler <at> gmail.com>
To: Ludovic Courtès <ludo <at> gnu.org>
Cc: 68412 <at> debbugs.gnu.org, Simon Tournier <zimon.toutoune <at> gmail.com>
Subject: Re: [bug#68412] [PATCH v2] scripts: edit: Accept generic formatting
 parameter.
Date: Thu, 08 Feb 2024 19:09:09 +0100
Am Mittwoch, dem 07.02.2024 um 23:22 +0100 schrieb Ludovic Courtès:
> Hi,
> 
> Liliana Marie Prikler <liliana.prikler <at> gmail.com> skribis:
> 
> > > Second, I think that using markers that can be interpreted by
> > > Bash
> > > shell can lead to confusion.  For instance,
> 
> [...]
> 
> > > $ 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.
> > 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’s true that someone not well versed in shell or someone distracted
> could easily find themselves having ${LINE} and ${FILE} shell-
> expanded even though we precisely don’t 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’d
> avoid those easy mistakes.
> 
> 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




This bug report was last modified 1 year and 120 days ago.

Previous Next


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