GNU bug report logs - #33446
26; `isearch-lazy-highlight-update' in MASTER today

Previous Next

Package: emacs;

Reported by: Drew Adams <drew.adams <at> oracle.com>

Date: Tue, 20 Nov 2018 19:48:01 UTC

Severity: minor

Tags: notabug

Done: Glenn Morris <rgm <at> gnu.org>

Bug is archived. No further changes may be made.

Full log


Message #14 received at 33446 <at> debbugs.gnu.org (full text, mbox):

From: Drew Adams <drew.adams <at> oracle.com>
To: Juri Linkov <juri <at> linkov.net>
Cc: 33446 <at> debbugs.gnu.org
Subject: RE: bug#33446: 26; `isearch-lazy-highlight-update' in MASTER today
Date: Tue, 20 Nov 2018 15:47:53 -0800 (PST)
> > The proximate cause of the error was likely due to
> > my calling `isearch-lazy-highlight-update' outside
> > searching (i.e., nil `isearch-mode').  But I think
> > there might still be a bug in the Isearch code.
> 
> isearch-lazy-highlight-update is not intended
> to be used in a window other than the window
> where isearch-lazy-highlight-new-loop was called.
> It has many dependencies on the original window
> being selected.

Yes, I guessed that finally.  Beyond that, I think it's
not intended to be invoked outside of search (i.e.,
when `isearch-mode' is nil).  That was my mistake:
invoking it in a command that can be used during Isearch
or not.

I know that wasn't intended as part of the Isearch
design.  Now I test for it and avoid calling `i-l-h-u'.

(But it might not hurt for `i-l-h-u' itself to test and
do nothing if `isearch-mode' is nil.  I'm not requesting
that, however.)

> > The `isearch-lazy-highlight-update' code does this:
> >
> > (save-selected-window
> >   (if (and (window-live-p isearch-lazy-highlight-window)
> >            (not (memq (selected-window)
> >                 isearch-lazy-highlight-window-group)))
> >       (select-window isearch-lazy-highlight-window))
> >
> > That causes the window in the other frame to be selected.
> 
> It should select the same window where
> isearch-lazy-highlight-new-loop was called.

Which assumes it was called ;-) _and_ that we are still
within Isearch.

> > The code then does this:
> >
> >   (setq window-start (window-group-start))
> >   (setq window-end (window-group-end))
> >
> > This causes `window-end' to be nil.  Should `window-group-*' here
> > be passed window `isearch-lazy-highlight-window'?
> 
> isearch-lazy-highlight-window should not be passed here
> because it's guaranteed to be selected by the code above.

OK (but see above).

Feel free to close this bug, if you like.  It's not
clear to me whether any code change is needed.




This bug report was last modified 6 years and 182 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.