zsh-users
 help / color / mirror / code / Atom feed
From: "Daniel Shahaf" <d.s@daniel.shahaf.name>
To: zsh-users@zsh.org
Subject: Re: auto-quoting inside braces in arguments
Date: Thu, 18 Feb 2021 17:35:05 +0000	[thread overview]
Message-ID: <8b3a9f93-5eb4-4d4d-8312-58c371e12239@www.fastmail.com> (raw)
In-Reply-To: <20210218134039.GA1492462@zira.vinc17.org>

Vincent Lefevre wrote on Thu, 18 Feb 2021 13:40 +00:00:
> Is there a way to get auto-quoting inside braces in arguments?
> For instance,
> 
>   echo {a b}
> 

Proof of concept:

f() {
  local l=\{ r=\}
  CURSOR=${BUFFER[(i)$l]} MARK=${BUFFER[(i)$r]}
  (( -- CURSOR ))
  zle quote-region
}

> would give 2 words "echo" and "{a b}" (which is different from what
> a POSIX shell would give, but the behavior is already different
> anyway, as one gets a parse error otherwise). Obviously this rule
> should be applied only for arguments.
> 
> Alternatively, one could have a feature like url-quote-magic.
> 
> -- 
> Vincent Lefèvre <vincent@vinc17.net> - Web: <https://www.vinc17.net/>
> 100% accessible validated (X)HTML - Blog: <https://www.vinc17.net/blog/>
> Work: CR INRIA - computer arithmetic / AriC project (LIP, ENS-Lyon)
> 
>


  reply	other threads:[~2021-02-18 17:35 UTC|newest]

Thread overview: 16+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-02-18 13:40 Vincent Lefevre
2021-02-18 17:35 ` Daniel Shahaf [this message]
2021-02-18 18:30   ` Bart Schaefer
2021-02-18 18:52     ` Bart Schaefer
2021-02-19 12:24       ` Vincent Lefevre
2021-02-18 18:57     ` Ray Andrews
2021-02-18 19:07       ` Bart Schaefer
2021-02-18 21:49         ` Ray Andrews
2021-02-18 22:12         ` Daniel Shahaf
2021-02-18 22:44           ` Bart Schaefer
2021-02-19 16:10             ` Daniel Shahaf
2021-02-19 16:50               ` Daniel Shahaf
2021-02-19 21:53                 ` Bart Schaefer
2021-02-19 12:17     ` Vincent Lefevre
2021-02-19 12:29       ` Vincent Lefevre
2021-02-19 22:15         ` Bart Schaefer

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

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

  git send-email \
    --in-reply-to=8b3a9f93-5eb4-4d4d-8312-58c371e12239@www.fastmail.com \
    --to=d.s@daniel.shahaf.name \
    --cc=zsh-users@zsh.org \
    /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.vuxu.org/mirror/zsh/

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 NNTP newsgroup(s).