all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: Drew Adams <drew.adams@oracle.com>
To: Karl Fogel <kfogel@red-bean.com>, Emacs developers <emacs-devel@gnu.org>
Subject: RE: PATCH: isearch-yank-until-char
Date: Mon, 26 Aug 2019 07:50:32 -0700 (PDT)	[thread overview]
Message-ID: <77205e15-f38a-46dc-9451-4030a318900a@default> (raw)
In-Reply-To: <871rx87b9h.fsf@red-bean.com>

> Remember that you started out that new thread
> (on August 14th) with these words:
> 
> > This is similar to what Karl submitted today.
> > Not a replacement for that; something different.

That was only the intro sentence.  Yes, the
general idea is something different, additional.
Which is why I created a new thread.

But the message also directly relates to your
command, which was the starting point.  A few
sentences later I said this:

  I think Karl's `isearch-yank-until-char'
  should also be made to support backward
  search.

And the patch modifies your command to do that.
And the message argues for a different key for
your command (after my earlier message where I
said that `C-M-c' was OK by me).

The intro sentence could perhaps have made clear
that it enhances your command, but that it's not
limited to doing that.

The more important message is that it provides
something new that applies generally.

> Since your followups were all in that thread,
> I assumed they were about something that was
> "not a replacement" for what I'd posted, and
> therefore wouldn't affect the question of
> whether what I posted should be installed.
> (I rely pretty heavily on thread discipline,
> not just in Emacs Devel but generally.)

Fair enough.  But my message really does relate
to your command and patch.  That's not the main
message, but it's closely related to that message.

> > Commands like `isearch-yank-until-char', which
> > yank consecutive buffer text at the search
> > point, are better if they can also work with
> > backward search.  My patch implements that for
> > this command and others.
> 
> It sounds like your patch does two conceptually
> distinct things:
> 
> 1) Implement one or more new commands
     [which work with backward search].
> 2) Make a bunch of isearch commands work
>    with backward search.

Yes, if you want to look at it that way.  But
switch the order, and then see if you still see
them as so different/separate.

It lets yank commands work properly with
backward search.  And so it fixes the relevant
yank commands to do that.  There are only a few
yank commands that are relevant (not really "a
bunch").

My message also categorizes Isearch yank commands,
saying that the relevant ones here are those that
yank buffer text at the search hit.  That is, it
makes clear that this doesn't apply to ad hoc
yanks, such as yanking from the kill-ring.

> If I were to install my patch (as it's currently
> written, though maybe with the keybinding changed),
> that doesn't really affect any of your new code.

Correct, with the exception of the key binding.

But my patch subsumes your patch (except that it
doesn't address the manuals or News).

It seemed appropriate to fix your command at the
same time as the others, especially since it was
still being discussed.

> However, I would still say your patch should be
> divided into two conceptually distinct patches,
> one for (1) and one for (2).  This is not a
> judgement about the technical merits or the UX
> merits of your patch.  I'm just saying that we
> should do one thing at a time.

I could do that.  But they're not so separate.

I added the Boolean option because Juri requested
it for the existing commands, to not change their
default behavior.  (I don't think such an option
is needed, but I respected that request.)

I could also split the patch into 3, splitting
off the command-defining macro and the two
commands it defines.  Or I could split it into 4.

Different approaches are possible.  I thought
(and think) it makes more sense to present all
of those changes together with a general
explanation of the feature - they all go together.

If someone wants to understand the behavior and
rationale, it makes sense to have code that
demonstrates it.

But if you want to try the patch and ignore the
changes to existing commands, that's possible,
just by setting the option value to nil.  Or if
you want to try it and ignore the new commands,
you can do that too.

If you consider them "conceptually distinct"
then just use the option to separate them.

And if it really helps to split the patch, I
can do that.

> >And I argued that `C-M-c' would be better used in
> >Isearch for my command `isearch-yank-through-move',
> >which initiates a recursive edit to allow arbitrary
> >cursor movement.  In that case, `C-M-c' both starts
> >and ends such movement (since globally it is
> >`exit-recursive-edit').
> 
> *nod*  That's a separate question from the above.
> I don't think it's very important that C-M-c be the
> binding for `isearch-yank-until-char'.  If we want
> to save C-M-c for this other potential use, that
> seems reasonable to me.

Good to hear.

> Your patch suggested "C-M-." for
> 'isearch-yank-until-char', which seems good.
> Another possibility, to keep the "c" for "char"
> mnemonic, is to use M-c.

I'm open on the key for `isearch-yank-until-char',
except that I think it makes sense to save `C-M-c'
in case we have a command that involves using that
to end recursive editing.

There are keys available.  The usual problem with
Isearch is that people will argue, with reason,
that they like to use such-and-such a key to exit
Isearch and act on the buffer text.

As you say, in Isearch `M-c' is currently for
toggling case.  If it were not, I could imagine
someone saying that s?he wants to continue using
`M-c' as `capitalize-word', to end search and
capitalize the word at the destination.

Incidentally, this is why, in `isearch+.el', I
put all Isearch yank commands on a prefix key,
`C-y'.  (I have more Isearch yank commands.)

Some, like `isearchp-yank-sexp-symbol-or-char',
are also on other keys. for ease of use - e.g.
`C-(' as well as `C-y C-('.

> Right now that key seems to toggle
> case-sensitivity, but I'm not sure
> that's deliberate -- according to the
> `isearch-forward' documentation, "M-s c" is
> for that, while "M-c" isn't documented at all.
> Given that the current action of M-c isn't
> documented, and given that another keybinding
> both does that action and is documented to do
> so, using "M-c" for `isearch-yank-until-char'
> might be okay.

I'm all for that kind of discussion - finding a
good fit.

> The code above suggests that it is not
> important for M-c to remain redundantly bound
> to `isearch-toggle-case-fold', but I could be
> wrong.  If anyone knows more, please say.  If
> we can't figure out the answer, I guess I'd say
> let's go with "C-M-.", out of general conservatism.

I like the fact that you provide reasons, and you
discuss openly and with details.

I suggest that we run a discussion about possible
key bindings for this command and others in
parallel with the overall discussion that's begun
about Isearch yank commands.

As opposed, e.g., to trying to first decide about
a key for `isearch-yank-until-char'.  Let's work
out the commands first - including consideration
of my proposed commands, and then figure out what
keys to use.  Just a suggestion.

And given that we're discussing adding to the set
of yank commands, maybe we want to consider
putting them all on some prefix key.  That would
certainly give us more options.



  reply	other threads:[~2019-08-26 14:50 UTC|newest]

Thread overview: 45+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-08-14  3:05 PATCH: isearch-yank-until-char Karl Fogel
2019-08-14 14:20 ` Eli Zaretskii
2019-08-14 16:41   ` Karl Fogel
2019-08-14 16:48     ` Drew Adams
2019-08-14 17:20       ` Eli Zaretskii
2019-08-14 17:22       ` Karl Fogel
2019-08-14 17:51         ` Eli Zaretskii
2019-08-14 17:59 ` Noam Postavsky
2019-08-14 20:39   ` Juri Linkov
2019-08-14 20:34 ` Juri Linkov
2019-08-16  4:53   ` Karl Fogel
2019-08-16 17:52     ` Juri Linkov
2019-08-25  2:14       ` Karl Fogel
2019-08-25  3:22         ` Drew Adams
2019-08-25 20:03           ` Juri Linkov
2019-08-26  1:14             ` Drew Adams
2019-08-26  5:20           ` Karl Fogel
2019-08-26 14:50             ` Drew Adams [this message]
2019-08-26 17:51               ` Karl Fogel
2019-08-26 19:36                 ` Drew Adams
2019-08-26 21:29                   ` Karl Fogel
2019-08-26 21:57                     ` Drew Adams
2019-08-26 22:21                       ` Karl Fogel
2019-08-26 22:43                         ` Drew Adams
2019-09-04 16:47                           ` Karl Fogel
2019-09-04 17:00                             ` Eli Zaretskii
2019-09-12 17:44                               ` Karl Fogel
2019-09-16 21:24                   ` Drew Adams
2019-09-17 16:02                     ` Karl Fogel
2019-08-26 21:46                 ` Juri Linkov
2019-08-26 21:52                   ` Karl Fogel
2019-08-26 22:03                   ` Drew Adams
2019-08-26 22:19                     ` Juri Linkov
2019-08-26 22:33                       ` Karl Fogel
2019-08-26 22:40                       ` Drew Adams
2019-08-27 21:31                         ` Juri Linkov
2019-08-27 22:52                           ` Drew Adams
2019-08-27 23:15                             ` Drew Adams
2019-08-25 19:58         ` Juri Linkov
2019-08-14 22:26 ` Stefan Monnier
2019-08-15 18:24   ` Juri Linkov
2019-08-17 12:31     ` Stefan Monnier
2019-08-17 22:51       ` Juri Linkov
2019-08-16  5:11   ` Karl Fogel
     [not found] <<87tvakfnv4.fsf@red-bean.com>
     [not found] ` <<835zmzsuau.fsf@gnu.org>
2019-08-14 15:24   ` Drew Adams

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=77205e15-f38a-46dc-9451-4030a318900a@default \
    --to=drew.adams@oracle.com \
    --cc=emacs-devel@gnu.org \
    --cc=kfogel@red-bean.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 external index

	https://git.savannah.gnu.org/cgit/emacs.git
	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.