unofficial mirror of bug-gnu-emacs@gnu.org 
 help / color / mirror / code / Atom feed
* bug#61601: [PATCH] * lisp/isearch.el (minibuffer-lazy-highlight-setup): Use cursor-in-echo-area
@ 2023-02-18 11:30 Augusto Stoffel
  2023-02-18 18:44 ` Juri Linkov
  0 siblings, 1 reply; 9+ messages in thread
From: Augusto Stoffel @ 2023-02-18 11:30 UTC (permalink / raw)
  To: 61601; +Cc: Juri Linkov

[-- Attachment #1: Type: text/plain, Size: 173 bytes --]

Tags: patch

I wasn't aware of the variable cursor-in-echo-area when I originally
wrote this function, but it's a much less drastic measure than setting
inhibit-redisplay.


[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: 0001-lisp-isearch.el-minibuffer-lazy-highlight-setup-Use-.patch --]
[-- Type: text/patch, Size: 920 bytes --]

From 68fd9e85dc56ada87dea647d6b71dbf9ecde7391 Mon Sep 17 00:00:00 2001
From: Augusto Stoffel <arstoffel@gmail.com>
Date: Sat, 18 Feb 2023 12:26:54 +0100
Subject: [PATCH] * lisp/isearch.el (minibuffer-lazy-highlight-setup): Use
 cursor-in-echo-area

---
 lisp/isearch.el | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/lisp/isearch.el b/lisp/isearch.el
index bb46c89ae20..14b8a259ea4 100644
--- a/lisp/isearch.el
+++ b/lisp/isearch.el
@@ -4466,7 +4466,7 @@ minibuffer-lazy-highlight-setup
                 (lazy-highlight-cleanup))))
       (fset after-change
             (lambda (_beg _end _len)
-              (let ((inhibit-redisplay t) ;; Avoid cursor flickering
+              (let ((cursor-in-echo-area t) ;; Avoid cursor flickering
                     (string (minibuffer-contents)))
                 (with-minibuffer-selected-window
                   (let* ((isearch-forward t)
-- 
2.39.2


^ permalink raw reply related	[flat|nested] 9+ messages in thread

* bug#61601: [PATCH] * lisp/isearch.el (minibuffer-lazy-highlight-setup): Use cursor-in-echo-area
  2023-02-18 11:30 bug#61601: [PATCH] * lisp/isearch.el (minibuffer-lazy-highlight-setup): Use cursor-in-echo-area Augusto Stoffel
@ 2023-02-18 18:44 ` Juri Linkov
  2023-02-18 19:05   ` Augusto Stoffel
  2023-02-18 19:18   ` Eli Zaretskii
  0 siblings, 2 replies; 9+ messages in thread
From: Juri Linkov @ 2023-02-18 18:44 UTC (permalink / raw)
  To: Augusto Stoffel; +Cc: 61601

> I wasn't aware of the variable cursor-in-echo-area when I originally
> wrote this function, but it's a much less drastic measure than setting
> inhibit-redisplay.

I don't know if Eli will allow this to the emacs-29 branch.





^ permalink raw reply	[flat|nested] 9+ messages in thread

* bug#61601: [PATCH] * lisp/isearch.el (minibuffer-lazy-highlight-setup): Use cursor-in-echo-area
  2023-02-18 18:44 ` Juri Linkov
@ 2023-02-18 19:05   ` Augusto Stoffel
  2023-02-18 19:18   ` Eli Zaretskii
  1 sibling, 0 replies; 9+ messages in thread
From: Augusto Stoffel @ 2023-02-18 19:05 UTC (permalink / raw)
  To: Juri Linkov; +Cc: 61601

[-- Attachment #1: Type: text/plain, Size: 351 bytes --]

On Sat, Feb 18, 2023, 19:50 Juri Linkov <juri@linkov.net> wrote:

> > I wasn't aware of the variable cursor-in-echo-area when I originally
> > wrote this function, but it's a much less drastic measure than setting
> > inhibit-redisplay.
>
> I don't know if Eli will allow this to the emacs-29 branch.
>

I think it's okay to leave it for Emacs 30.

>

[-- Attachment #2: Type: text/html, Size: 867 bytes --]

^ permalink raw reply	[flat|nested] 9+ messages in thread

* bug#61601: [PATCH] * lisp/isearch.el (minibuffer-lazy-highlight-setup): Use cursor-in-echo-area
  2023-02-18 18:44 ` Juri Linkov
  2023-02-18 19:05   ` Augusto Stoffel
@ 2023-02-18 19:18   ` Eli Zaretskii
  2023-02-18 21:40     ` Augusto Stoffel
  1 sibling, 1 reply; 9+ messages in thread
From: Eli Zaretskii @ 2023-02-18 19:18 UTC (permalink / raw)
  To: Juri Linkov; +Cc: 61601, arstoffel

> Cc: 61601@debbugs.gnu.org
> From: Juri Linkov <juri@linkov.net>
> Date: Sat, 18 Feb 2023 20:44:40 +0200
> 
> > I wasn't aware of the variable cursor-in-echo-area when I originally
> > wrote this function, but it's a much less drastic measure than setting
> > inhibit-redisplay.
> 
> I don't know if Eli will allow this to the emacs-29 branch.

Can you explain how the old and the new code prevent "flickering" in
that place?





^ permalink raw reply	[flat|nested] 9+ messages in thread

* bug#61601: [PATCH] * lisp/isearch.el (minibuffer-lazy-highlight-setup): Use cursor-in-echo-area
  2023-02-18 19:18   ` Eli Zaretskii
@ 2023-02-18 21:40     ` Augusto Stoffel
  2023-02-18 22:43       ` Drew Adams
  2023-02-19  6:16       ` Eli Zaretskii
  0 siblings, 2 replies; 9+ messages in thread
From: Augusto Stoffel @ 2023-02-18 21:40 UTC (permalink / raw)
  To: Eli Zaretskii; +Cc: 61601, Juri Linkov

On Sat, 18 Feb 2023 at 21:18, Eli Zaretskii wrote:

>> Cc: 61601@debbugs.gnu.org
>> From: Juri Linkov <juri@linkov.net>
>> Date: Sat, 18 Feb 2023 20:44:40 +0200
>> 
>> > I wasn't aware of the variable cursor-in-echo-area when I originally
>> > wrote this function, but it's a much less drastic measure than setting
>> > inhibit-redisplay.
>> 
>> I don't know if Eli will allow this to the emacs-29 branch.
>
> Can you explain how the old and the new code prevent "flickering" in
> that place?

The flickering happens because the cursor briefly moves from the
minibuffer to the minibuffer selected window when the lazy highlighting
is done (e.g. after typing a character in the C-M-% regexp query).

The previous solution was to inhibit redisplay during that brief period.
The new and better solution is to just set cursor-in-echo-area, which
does exactly what we want to happen.





^ permalink raw reply	[flat|nested] 9+ messages in thread

* bug#61601: [PATCH] * lisp/isearch.el (minibuffer-lazy-highlight-setup): Use cursor-in-echo-area
  2023-02-18 21:40     ` Augusto Stoffel
@ 2023-02-18 22:43       ` Drew Adams
  2023-02-19 12:16         ` Augusto Stoffel
  2023-02-19  6:16       ` Eli Zaretskii
  1 sibling, 1 reply; 9+ messages in thread
From: Drew Adams @ 2023-02-18 22:43 UTC (permalink / raw)
  To: Augusto Stoffel, Eli Zaretskii; +Cc: 61601@debbugs.gnu.org, Juri Linkov

> The flickering happens because the cursor briefly moves from the
> minibuffer to the minibuffer selected window when the lazy highlighting
> is done (e.g. after typing a character in the C-M-% regexp query).

FWIW -
No such problems existed before Isearch started 
using the minibuffer instead of the echo area.





^ permalink raw reply	[flat|nested] 9+ messages in thread

* bug#61601: [PATCH] * lisp/isearch.el (minibuffer-lazy-highlight-setup): Use cursor-in-echo-area
  2023-02-18 21:40     ` Augusto Stoffel
  2023-02-18 22:43       ` Drew Adams
@ 2023-02-19  6:16       ` Eli Zaretskii
  1 sibling, 0 replies; 9+ messages in thread
From: Eli Zaretskii @ 2023-02-19  6:16 UTC (permalink / raw)
  To: Augusto Stoffel; +Cc: 61601, juri

> From: Augusto Stoffel <arstoffel@gmail.com>
> Cc: Juri Linkov <juri@linkov.net>,  61601@debbugs.gnu.org
> Date: Sat, 18 Feb 2023 22:40:13 +0100
> 
> On Sat, 18 Feb 2023 at 21:18, Eli Zaretskii wrote:
> 
> > Can you explain how the old and the new code prevent "flickering" in
> > that place?
> 
> The flickering happens because the cursor briefly moves from the
> minibuffer to the minibuffer selected window when the lazy highlighting
> is done (e.g. after typing a character in the C-M-% regexp query).
> 
> The previous solution was to inhibit redisplay during that brief period.
> The new and better solution is to just set cursor-in-echo-area, which
> does exactly what we want to happen.

OK, thanks.  It's fine with me to install this on emacs-29.





^ permalink raw reply	[flat|nested] 9+ messages in thread

* bug#61601: [PATCH] * lisp/isearch.el (minibuffer-lazy-highlight-setup): Use cursor-in-echo-area
  2023-02-18 22:43       ` Drew Adams
@ 2023-02-19 12:16         ` Augusto Stoffel
  2023-02-19 15:53           ` Drew Adams
  0 siblings, 1 reply; 9+ messages in thread
From: Augusto Stoffel @ 2023-02-19 12:16 UTC (permalink / raw)
  To: Drew Adams; +Cc: 61601@debbugs.gnu.org, Eli Zaretskii, Juri Linkov

On Sat, 18 Feb 2023 at 22:43, Drew Adams wrote:

>> The flickering happens because the cursor briefly moves from the
>> minibuffer to the minibuffer selected window when the lazy highlighting
>> is done (e.g. after typing a character in the C-M-% regexp query).
>
> FWIW -
> No such problems existed before Isearch started 
> using the minibuffer instead of the echo area.

AFAICT C-M-% always used the minibuffer to read a regular expression.
This has nothing to do with Isearch per se.

Also, in isearch I still see cursor flickering when I type fast enough.
But since I normally use isearch-mb, which is not affected by this, I
can't describe the problem in more detail.





^ permalink raw reply	[flat|nested] 9+ messages in thread

* bug#61601: [PATCH] * lisp/isearch.el (minibuffer-lazy-highlight-setup): Use cursor-in-echo-area
  2023-02-19 12:16         ` Augusto Stoffel
@ 2023-02-19 15:53           ` Drew Adams
  0 siblings, 0 replies; 9+ messages in thread
From: Drew Adams @ 2023-02-19 15:53 UTC (permalink / raw)
  To: Augusto Stoffel; +Cc: 61601@debbugs.gnu.org, Eli Zaretskii, Juri Linkov

> > No such problems existed before Isearch started
> > using the minibuffer instead of the echo area.
> 
> AFAICT C-M-% always used the minibuffer to read a regular expression.
> This has nothing to do with Isearch per se.

If this is only about C-M-% reading a regexp
then OK, and I apologize for not having read
more of the thread.

C-M-%'s reading of a regexp is an all-at-once,
one time reading that uses the minibuffer.

That reading has nothing to do with Isearch's
reading of keys you type, for incremental
input and editing of the search pattern.  

_If_ this is about Isearch's incremental
handling of a search pattern, then maybe my
comment is relevant.  Apart from `M-e', since
Day One Isearch always read input directly,
not using the minibuffer.  It displayed what
you typed in the echo area, giving somewhat
the (mistaken) impression that input was in
the minibuffer.





^ permalink raw reply	[flat|nested] 9+ messages in thread

end of thread, other threads:[~2023-02-19 15:53 UTC | newest]

Thread overview: 9+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2023-02-18 11:30 bug#61601: [PATCH] * lisp/isearch.el (minibuffer-lazy-highlight-setup): Use cursor-in-echo-area Augusto Stoffel
2023-02-18 18:44 ` Juri Linkov
2023-02-18 19:05   ` Augusto Stoffel
2023-02-18 19:18   ` Eli Zaretskii
2023-02-18 21:40     ` Augusto Stoffel
2023-02-18 22:43       ` Drew Adams
2023-02-19 12:16         ` Augusto Stoffel
2023-02-19 15:53           ` Drew Adams
2023-02-19  6:16       ` Eli Zaretskii

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).