help / color / mirror / code / Atom feed
From: Bart Schaefer <schaefer@brasslantern.com>
To: Zsh Users <zsh-users@zsh.org>
Subject: Re: Magic URL quoting and bracketed paste gets "disabled" randomly
Date: Sun, 10 Jul 2022 10:44:43 -0700	[thread overview]
Message-ID: <CAH+w=7am7ABpbJ_S1jBesEyw5opV+ezrZ83zCWU4_in-diC2Qg@mail.gmail.com> (raw)
In-Reply-To: <fee50c49-721d-fdb0-c3dc-8ff95514f334@luffy.cx>

On Fri, Jul 8, 2022 at 10:40 PM Vincent Bernat <bernat@luffy.cx> wrote:
> I am using autosuggest, so I get:
> zle -N bracketed-paste _zsh_autosuggest_bound_1_bracketed-paste

I can't think of any reason autosuggest would need to rebind that widget.

> It seems the condition if [[ "$words[-1]" == (#b)([^:]##):* ]] does not
> match. I am using "disable -p #" which seems to be the cause. Using
> "emulate -L zsh" at the top of the function instead of "setopt
> localoptions" fixes the issue. I though functions should use "emulate -L
> zsh" when using these options, but in Zsh codebase, "setopt
> localoptions" seems used often. Should any of this considered as a bug?

"emulate -L" potentially resets a lot of things.  The decision for
each function has to be whether the scope requires all those elements
to be reset, or whether to make minimal changes so as to behave as
much as possible like the rest of the user's environment.

In the case of url-quote-magic I can't presently think of any reason
not to use "emulate -L".  That said, I also can't think of any
contributed function that intentionally defends itself against pattern

  reply	other threads:[~2022-07-10 17:46 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-07-07  6:13 Vincent Bernat
2022-07-09  3:10 ` Bart Schaefer
2022-07-09  5:40   ` Vincent Bernat
2022-07-10 17:44     ` Bart Schaefer [this message]
2022-07-10 19:12       ` Vincent Bernat

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:

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

  git send-email \
    --in-reply-to='CAH+w=7am7ABpbJ_S1jBesEyw5opV+ezrZ83zCWU4_in-diC2Qg@mail.gmail.com' \
    --to=schaefer@brasslantern.com \
    --cc=zsh-users@zsh.org \


* 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


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).