unofficial mirror of emacs-devel@gnu.org 
 help / color / mirror / code / Atom feed
From: Augusto Stoffel <arstoffel@gmail.com>
To: Juri Linkov <juri@linkov.net>
Cc: emacs-devel@gnu.org
Subject: Re: [WIP PATCH] Controlling Isearch from the minibuffer
Date: Wed, 12 May 2021 08:40:28 +0200	[thread overview]
Message-ID: <87mtt0wj37.fsf@gmail.com> (raw)
In-Reply-To: 87h7jath3m.fsf@mail.linkov.net

On Tue, 11 May 2021 at 00:17, Juri Linkov <juri@linkov.net> wrote:

>>> You can avoid the timer hack by adding a guard to
>>> isearch-post-command-hook: when at the end of the isearch command,
>>> point is not in the minibuffer, activate the minibuffer
>>> (assuming that isearch-from-minibuffer is t).
>>
>> That didn't work well, because when canceling a command called from the
>> post-command hook one gets an ugly error message.
>
> How do yo cancel such a command?

C-g

>
>> I hope this is a guideline rather than an axiom, so let me describe what
>> the *slight* incompatible changes are:
>>
>> 1. The user is forced to see lazy highlight and lazy count while editing
>>    the search string via M-e, as long as these options are already
>>    enabled globally.
>
> Why not enable these incompatible changes only when
> isearch-from-minibuffer is t?

Without the improvements to the good old M-e, my patch would be totally
independent of the rest of isearch.el, so it could just as well be an
external package.  That's OK too, but why would anyone keep lazy
highlight/count on for normal Isearch, but wish to disable it after
pressing M-e?

To put it from another perspective: you said earlier that my patch could
be boiled down to 10 lines.  Well, adding lazy highlight/count to
`isearch-edit-string' is certainly more work than that.  But once this
is in place, then yes, the minibuffer-controlled mode is a small
addition.

>
>> 2. A M-s prefix is added to minibuffer-local-isearch-map, as well as a
>>    few extra commands (M->, M-<, etc.)
>
> The users might want to use M-< M-> to go to the beginning/end of the
> minibuffer.

This seems way less useful than going to the first/last match in the
search buffer, since in the minibuffer C-a and C-e are usually
sufficient.

By the way, what's the idea behind `minibuffer-beginning-of-buffer'?  It
moves past the prompt, which is a useless point to go.

>
>> 3. <right> and C-f are unbound.
>
> Removing <right> and C-f is a very good thing, indeed.
>
>>> The with-isearch-window-quitting-edit macro can be avoided the same way
>>> as the with-isearch-window macro.
>>
>> I'm not sure this is possible.  Is there a way to get rid of the
>> minibuffer without returning control to the caller of
>> `read-from-minibuffer'?  I couldn't find a way to do this, hence the
>> throw/catch of a continuation function in the current version of the
>> patch.
>
> Why not return control to the caller with `exit-minibuffer'?
> When still necessary, you could try `exit-recursive-edit'.

First of all, let me say that you suggestion to get rid of the
`with-isearch-window' macro works fine.  The remaining problem is with
commands that create a minibuffer, and therefore require that we quit
the `isearch-edit-string' minibuffer first.  One example would be
`isearch-query-replace'.

So here's the the situation in more detail:

- You are in an `isearch-edit-string' session
- Then you press M-%
- Now we are in the pre-command-hook. We check `this-command` and
  see that it will need the minibuffer.

From there, how can we get rid of the minibuffer and continue running
this-command?  Calling `exit-minibuffer' now would return control to
whoever called `isearch-edit-string', so `this-command' would never run.



  reply	other threads:[~2021-05-12  6:40 UTC|newest]

Thread overview: 43+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-05-08 10:13 [WIP PATCH] Controlling Isearch from the minibuffer Augusto Stoffel
2021-05-09 13:36 ` Alan Mackenzie
2021-05-09 17:58   ` Augusto Stoffel
2021-05-10 19:51     ` Alan Mackenzie
2021-05-11  9:00       ` Augusto Stoffel
2021-05-11 15:34         ` [External] : " Drew Adams
2021-05-11 18:31           ` Juri Linkov
2021-05-11 19:38             ` Drew Adams
2021-05-12  6:45           ` Augusto Stoffel
2021-05-12 12:44             ` Stefan Monnier
2021-05-12 15:31               ` Drew Adams
2021-05-12 22:17                 ` Kévin Le Gouguec
2021-05-12 23:07                   ` Drew Adams
2021-05-13 15:12                     ` Kévin Le Gouguec
2021-05-12 21:09               ` Augusto Stoffel
2021-05-12 15:30             ` Drew Adams
2021-05-09 19:09   ` Juri Linkov
2021-05-09 19:05 ` Juri Linkov
2021-05-10 20:24   ` Augusto Stoffel
2021-05-10 21:17     ` Juri Linkov
2021-05-12  6:40       ` Augusto Stoffel [this message]
2021-05-12 17:13         ` Juri Linkov
2021-05-12 20:52           ` Augusto Stoffel
2021-05-13 16:31             ` Juri Linkov
2021-05-13 20:12               ` [ELPA?] " Augusto Stoffel
2021-05-14  1:17                 ` Jean Louis
2021-05-14  8:36                   ` Augusto Stoffel
2021-05-14 17:30                 ` Augusto Stoffel
2021-05-14 18:20                   ` Juri Linkov
2021-05-16 11:00                     ` Augusto Stoffel
2021-05-16 18:19                       ` Juri Linkov
2021-05-25 20:50                         ` Juri Linkov
2021-05-29 11:48                           ` Augusto Stoffel
2021-05-14 18:18                 ` Juri Linkov
2021-05-16 18:12                   ` Juri Linkov
2021-05-16 18:49                     ` Augusto Stoffel
2021-05-21  9:09                       ` Augusto Stoffel
2021-05-21 10:25                         ` Eli Zaretskii
2021-05-21 11:56                           ` Augusto Stoffel
2021-05-21 12:31                             ` Eli Zaretskii
2021-05-21 12:49                               ` Augusto Stoffel
2021-05-21 15:05                               ` Stefan Monnier
2021-05-21 15:09                                 ` Eli Zaretskii

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://www.gnu.org/software/emacs/

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

  git send-email \
    --in-reply-to=87mtt0wj37.fsf@gmail.com \
    --to=arstoffel@gmail.com \
    --cc=emacs-devel@gnu.org \
    --cc=juri@linkov.net \
    /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/emacs.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).