unofficial mirror of emacs-devel@gnu.org 
 help / color / mirror / code / Atom feed
From: Daniel Mendler <daniel@mendler.net>
To: Alan Mackenzie <acm@muc.de>
Cc: "emacs-devel@gnu.org" <emacs-devel@gnu.org>,
	"monnier@iro.umontreal.ca" <monnier@iro.umontreal.ca>,
	"kevin.legouguec@gmail.com" <kevin.legouguec@gmail.com>,
	Eli Zaretskii <eliz@gnu.org>,
	"arstoffel@gmail.com" <arstoffel@gmail.com>,
	Drew Adams <drew.adams@oracle.com>
Subject: Re: [External] : Re: Indicate better the current use of the echo area / minibuffer [was: Controlling Isearch from minibuffer]
Date: Thu, 13 May 2021 18:12:27 +0200	[thread overview]
Message-ID: <502924ee-aaeb-c35b-8f75-4fbbf009dfb4@mendler.net> (raw)
In-Reply-To: <YJ1Ep1JIP0gA/635@ACM>

On 5/13/21 5:24 PM, Alan Mackenzie wrote:
>> The echo area/minibuffer distinction comes up from time to time in
>> discussions with new users. I know that I had been confused for a while
>> with the Isearch behavior. The Isearch use of the echo area is
>> unexpected. Users expect to enter a search string into a separate input
>> form as is common in many other programs. In Emacs this input form is
>> the minibuffer.
> 
> That's a rather misleading way of portraying it.  Users used to other
> programs tend not to be familiar with incremental search, where point is
> not in "a separate input form" but in the buffer they're searching
> through.  There is no "separate input form".

I deliberately took the perspective of a new user here and I am
convinced that the current behavior is problematic. Incremental search
is also present in other programs, where you enter something and "the
buffer" updates accordingly. The only difference here is that the cursor
 stays in the buffer where the search happens. But the location of the
actual cursor is not that relevant, it is a technical detail. There are
also packages emulating and showing multiple cursors using overlays,
e.g., multiple-cursor.el.

> Besides, currently isearch can be used in the mini-window, searching
> through a minibuffer.  If we are not to lose this feature, things will
> get complicated and messy.

I think it is justified to lose this functionality in the
minibuffer-controlled Isearch mode. I never use the Isearch to search or
jump in the minibuffer. On the other hand I would like to edit the
search string using the normal editing commands which are available in
the `fundamental-mode`.

>> I would welcome the changes by Augusto. The minibuffer-controlled
>> Isearch makes entering the search string more robust with regards to
>> various editing commands as mentioned before by Kévin Le Gouguec.
> 
> But it's a gross kludge.  The principle behind the minibuffer is that
> the current edit is suspended, and the current window is switched to a
> minibuffer window, and (more or less) normal editing happens in that
> mini-window until the user terminates it.  This clashes with the concept
> of incremental searching, where point stays in the target window at all
> times, guided by a sequence of commands, there being no recursive edit.

I am not familiar with the details of the Isearch implementation, but I
don't see why it has to be a kludge in principle. If I would start a new
search package, I would certainly use the minibuffer in combination with
a `post-command-hook` (or an `after-change-function`) to update the
buffer incrementally with the search results. It is not difficult to do
that as one can see in the ctrlf.el package.

Stefan Monnier also stated something along these lines:

"I don't know what impacts it might have on the UI, but I've often
wished (from an implementation point of view) that Isearch used an
actual plain old minibuffer rather than mimicking one..."

Therefore I think the characterization of a minibuffer-controlled search
as a "kudge" is not balanced. One could as well criticize the Isearch
since it does not use the minibuffer and deviates from the behavior of
other Emacs commands.

>> There exists the ctrlf package on MELPA which also uses the minibuffer,
>> but it feels hardly justified to install an extra package only to get a
>> minibuffer-controlled search mode. I also don't want to replace such a
>> tightly integrated component like Isearch with an external package. If a
>> minibuffer mode can be added to Isearch with small effort and in a
>> reasonably clean way, why not do that?
> 
> See above.  It would be anything but clean, given the clash between the
> way the minibuffer works and the way incremental search works.
> Augusto's original patch was ~500 lines long, which scarcely suggests
> "reasonably clean".

I agree that 500 lines is long but the current version only adds ~160
lines. I am not sure at which point you consider this a clean patch.

> You seem to be asking for an Emacs internal mechanism (the minnibuffer)
> to be used rather than for particular user visible effects to be seen.
> Why not concentrate on the latter, so that we can evaluate such
> suggestions and incorporate them into the current way isearch is
> implemented?

I want to use the `fundamental-mode` to edit the search string with all
its features. This cannot be achieved by adjusting something in the
current Isearch implementation. The only way to achieve this is by using
a separate buffer in a recursive editing session. There is already
-edit-string` which gives a minibuffer. But then one loses all the
incremental search functionality, which makes this uncomfortable to use.
From what I've seen, Augusto's patch mostly adjusts this command, which
limits the impact of the patch.

> I am worried that these suggestions for using the minibuffer will get
> implemented, and searching in Emacs will move from the delightfully
> lightweight feature we have at the moment to something awkward and
> sluggish, like most other programs' searching is.

I did not try the current version of the patch but the last time I tried
it, I quite liked the result. It didn't feel sluggish and felt natural
as long as one accepts that one is typing in the minibuffer.

Overall, I understand the resistance against the proposed changes. If
one wants to stay in any case within the paradigm of using the echo
area, there is no place for a minibuffer controlled Isearch.
Nevertheless I found it quite astonishing that Augusto managed to create
this relatively small patch (up to debate ;) which substitutes this
central part of the Isearch interaction.

Daniel



  reply	other threads:[~2021-05-13 16:12 UTC|newest]

Thread overview: 18+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-05-12 23:47 Indicate better the current use of the echo area / minibuffer [was: Controlling Isearch from minibuffer] Drew Adams
2021-05-13  6:28 ` Eli Zaretskii
2021-05-13 14:11   ` [External] : " Drew Adams
2021-05-13 14:41     ` Daniel Mendler
2021-05-13 15:24       ` Alan Mackenzie
2021-05-13 16:12         ` Daniel Mendler [this message]
2021-05-13 16:21         ` Augusto Stoffel
2021-05-13 16:44         ` Eli Zaretskii
2021-05-13 16:16       ` Daniel Martín
2021-05-13 16:33         ` Daniel Mendler
2021-05-13 17:41       ` Drew Adams
2021-05-13 18:07         ` Daniel Mendler
2021-05-13 19:36           ` Drew Adams
2021-05-14 21:02             ` John Yates
2021-05-14 21:55               ` Drew Adams
2021-05-15  7:57               ` martin rudalics
2021-05-15 19:46                 ` Drew Adams
2021-05-14 18:16           ` Juri Linkov

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=502924ee-aaeb-c35b-8f75-4fbbf009dfb4@mendler.net \
    --to=daniel@mendler.net \
    --cc=acm@muc.de \
    --cc=arstoffel@gmail.com \
    --cc=drew.adams@oracle.com \
    --cc=eliz@gnu.org \
    --cc=emacs-devel@gnu.org \
    --cc=kevin.legouguec@gmail.com \
    --cc=monnier@iro.umontreal.ca \
    /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).