emacs-devel
[Top][All Lists]
Advanced

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

Re: Simple isearch concerns


From: Juri Linkov
Subject: Re: Simple isearch concerns
Date: Fri, 30 Apr 2021 02:00:10 +0300
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/28.0.50 (x86_64-pc-linux-gnu)

>> Actually, overriding-local-map can't be used, because it prioritizes
>> global-map over local maps, so e.g. in Dired typing C-o exits isearch
>> and calls open-line instead of dired-display-file.
>>
>> According to (info "(elisp) Searching Keymaps"), the next available keymap is
>> emulation-mode-map-alists.  The following patch added a single line:
>>
>>   (add-to-list 'emulation-mode-map-alists `((isearch-mode . 
>> ,isearch-mode-map)))
>>
>> then removed all mentions of overriding-terminal-local-map,
>> removed all 156 lines of the monstrous macro with-isearch-suspended,
>> added a single line to the end of isearch-edit-string:
>>
>>   (isearch-search-and-update)
>>
>> and then M-e edits the search string without exiting isearch.  And it's
>> trivial to use isearch commands without exiting the minibuffer with e.g.
>>
>>   (with-minibuffer-selected-window (isearch-repeat-forward))
>>
>> And everything works fine.  It's too good to be true,
>> but I don't see where's the catch.
>
> This seems promising, and actually not too different from the experiment
> I mentioned a few messages back: https://github.com/astoff/isearch-mb/
>
> I've been using it for some time without problems.

Thanks for the experiment that demonstrates how it's possible
to implement this feature for all Emacs versions.

Now the question is whether it's worth to have this feature
in isearch.el where adding it will allow simplifications.

What would be good customization options for that?  I imagine
a new boolean option 'isearch-buffer-local'.  Maybe later
it would require a new value to support even multiple isearch
sessions in different buffers.  In this case, all state variables
like isearch-cmds, isearch-lazy-highlight-overlays etc. could be made
buffer-local.



reply via email to

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