zsh-workers
 help / color / mirror / code / Atom feed
From: Mikael Magnusson <mikachu@gmail.com>
To: Peter Stephenson <p.w.stephenson@ntlworld.com>,
	Bart Schaefer <schaefer@brasslantern.com>
Cc: zsh workers <zsh-workers@zsh.org>
Subject: Re: This widget implementation feels a bit clunky (edit-quoted-word)
Date: Sun, 21 Jun 2015 09:09:29 +0200	[thread overview]
Message-ID: <CAHYJk3T3VmT3gAEkzpUJ=WPcqVDNWT8OCD9WqD=ddUFTbPigyA@mail.gmail.com> (raw)
In-Reply-To: <20150620180659.735a6cc6@ntlworld.com>

On Sat, Jun 20, 2015 at 7:06 PM, Peter Stephenson
<p.w.stephenson@ntlworld.com> wrote:
> On Sat, 20 Jun 2015 11:16:20 +0200
> Mikael Magnusson <mikachu@gmail.com> wrote:
>> I feel like it's unnecessarily hard to get the resulting text from a
>> narrow-to-region session.
>
> Would you want something like this?

That does look very promising, yeah. :)
I suppose I should volunteer for writing the doc patch for this.

On Sat, Jun 20, 2015 at 7:21 PM, Bart Schaefer
<schaefer@brasslantern.com> wrote:
> On Jun 20, 11:16am, Mikael Magnusson wrote:
> }
> } I feel like it's unnecessarily hard to get the resulting text from a
> } narrow-to-region session.
>
> Hmm.  If you used "narrow-to-region -S state ..." then I think the
> resulting text would be $BUFFER between the exit from recursive-edit
> and the call to "narrow-to-region -R state" ?
>
> Except that I'm having a little trouble with -S / -R.  The value of
> $MARK never seems to be correctly restored.  Is it supposed to be?

I'll admit I didn't actually look at the impl of the widget, only the
documentation.

> } It would be nice if quote-region let you specify the type of quoting.
> } Urk?
>
> The difficulty there is that it's a widget so there's no direct way to
> pass the type of quote.  I suppose you could use $NUMERIC.

I thought widgets can take an arbitrary amount of arguments, although
it is true that almost none do. The newly added bracketed-paste takes
an argument that names the parameter to store pasted text in for
example. If you mean that you can't do it directly via bindkey then
yeah, that's true, you'd still need a wrapper widget. For my use-case
I could put the argument right in with the zle call though. (But with
PWS' suggested change, I can just insert (q-)LBUFFER/RBUFFER directly,
I think).

-- 
Mikael Magnusson


  reply	other threads:[~2015-06-21  7:09 UTC|newest]

Thread overview: 19+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-06-20  9:16 Mikael Magnusson
2015-06-20 17:06 ` Peter Stephenson
2015-06-21  7:09   ` Mikael Magnusson [this message]
2015-06-21 17:17     ` Peter Stephenson
2015-06-22  2:26       ` Mikael Magnusson
2015-06-22  0:18     ` PATCH: Document narrow-to-region -l and -r Mikael Magnusson
2015-06-20 17:21 ` This widget implementation feels a bit clunky (edit-quoted-word) Bart Schaefer
2015-07-18 23:42   ` PATCH: narrow-to-region (was Re: This widget implementation feels a bit clunky) Bart Schaefer
2015-07-19  3:55     ` Oliver Kiddle
2015-07-19  8:23       ` Bart Schaefer
2015-07-20  9:19         ` Oliver Kiddle
2015-07-20 16:29           ` Bart Schaefer
2015-07-23  5:41           ` Undo and narrow-to-region (was Re: PATCH: narrow-to-region (was ...)) Bart Schaefer
2015-07-27 15:44             ` Oliver Kiddle
2015-08-12 17:00               ` PATCH: Re: Undo and narrow-to-region (was ...) Oliver Kiddle
2015-08-17 21:15                 ` Daniel Hahler
2015-08-17 21:58                   ` Bart Schaefer
2015-08-18  3:43                     ` Bart Schaefer
2015-08-18  7:05                   ` 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='CAHYJk3T3VmT3gAEkzpUJ=WPcqVDNWT8OCD9WqD=ddUFTbPigyA@mail.gmail.com' \
    --to=mikachu@gmail.com \
    --cc=p.w.stephenson@ntlworld.com \
    --cc=schaefer@brasslantern.com \
    --cc=zsh-workers@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).