unofficial mirror of guix-patches@gnu.org 
 help / color / mirror / code / Atom feed
From: "Ludovic Courtès" <ludo@gnu.org>
To: Liliana Marie Prikler <liliana.prikler@gmail.com>
Cc: 68412@debbugs.gnu.org, Simon Tournier <zimon.toutoune@gmail.com>
Subject: [bug#68412] [PATCH v2] scripts: edit: Accept generic formatting parameter.
Date: Wed, 07 Feb 2024 23:22:23 +0100	[thread overview]
Message-ID: <87h6ij3of4.fsf@gnu.org> (raw)
In-Reply-To: <8422a68ebc6545a4587232c404efcfee86337df3.camel@gmail.com> (Liliana Marie Prikler's message of "Mon, 29 Jan 2024 18:58:31 +0100")

Hi,

Liliana Marie Prikler <liliana.prikler@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?

Ludo’.




  reply	other threads:[~2024-02-07 22:23 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-01-12 23:35 [bug#68412] [PATCH] scripts: edit: Accept generic formatting parameter Liliana Marie Prikler
2024-01-12 23:35 ` [bug#68412] [PATCH v2] " Liliana Marie Prikler
2024-01-29 11:10   ` Simon Tournier
2024-01-29 17:58     ` Liliana Marie Prikler
2024-02-07 22:22       ` Ludovic Courtès [this message]
2024-02-08 18:09         ` Liliana Marie Prikler
2024-02-10  9:58           ` Ludovic Courtès
2024-02-10 11:01             ` Simon Tournier
2024-02-13 15:04               ` Liliana Marie Prikler
2024-02-14 11:19                 ` Simon Tournier
2024-01-29 13:24   ` Ludovic Courtès
2024-01-29 14:07     ` Simon Tournier
2024-01-27 14:07 ` [bug#68412] [PATCH] " Ludovic Courtès

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://guix.gnu.org/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=87h6ij3of4.fsf@gnu.org \
    --to=ludo@gnu.org \
    --cc=68412@debbugs.gnu.org \
    --cc=liliana.prikler@gmail.com \
    --cc=zimon.toutoune@gmail.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/guix.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).