emacs-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Simple isearch concerns


From: Augusto Stoffel
Subject: Re: Simple isearch concerns
Date: Thu, 03 Mar 2022 19:39:55 +0100
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/28.0.91 (gnu/linux)

On Thu,  3 Mar 2022 at 17:50, Alan Mackenzie <acm@muc.de> wrote:

> Hello, Augusto.
>
> On Thu, Mar 03, 2022 at 17:36:35 +0100, Augusto Stoffel wrote:
>> The non-quitting scroll commands in isearch are an extremely useful
>> addition.  But I looked at the implementation now and I'm finding it
>> problematic.
>
>> At some point it was decided that instead of just defining
>> 'isearch-scroll-up' and 'isearch-scroll-down commands', some
>> pre-command-hook trickery would be used.  Presumably this is so that an
>> user option, 'isearch-allow-scroll', could be provided (that's what I
>> gather from the parent message of this email).
>
> This is not quite how the history of this facility was.  (I wrote the
> original version back in 2003.)  isearch-allow-scroll was at the centre
> of the mechanism right from the beginning.  The idea was that users
> could use the same keys for scrolling whilst inside an isearch as in
> ordinary editing.  Commands like isearch-scroll-up never came into
> consideration.  Originally, the pre-command- and post-command- hooks
> weren't used.  They were implemented as a code clean-up some while later
> (I think, by Juri Linkov).

Sorry, I meant to say the `isearch-allow-motion' option, which is new in
Emacs 28.

>> you can't put the (nonexistent) isearch-scroll-up/down commands in a
>> repeat map; you can't activate the feature selectively, e.g. so that
>> scrolling doesn't quit isearch but beginning/end of buffer does;
>
> For this, you can just set the isearch-allow-scroll property to nil for
> the commands you want to quit isearch.

Is `isearch-allow-scroll' as a property documented at all?

> I think there are around 20 commands which have the
> isearch-allow-scroll (or scroll-command) property set.  I have a few
> more personal commands, bringing my total to around 30.

Okay, I understand the reasons to have `isearch-allow-scroll, but only 4
commands have `isearch-motion', and two (beginning/end-of-buffer) are
redundant (they already had isearch variants).  So this new property
(and code path in the pre command hook) was essentially introduced for
the sake of 2 command (scroll up and down).

If the idea here was to leave space for even more motion commands (C-a,
C-n, etc.) to be made non quitting, then perhaps it makes sense.  But
this framework is so special that it's impossible for anyone who didn't
read isearch.el to suppose it exists.  Normally you would try to changes
things via customization variables, key bindings, and advices, in that
order...



reply via email to

[Prev in Thread] Current Thread [Next in Thread]