From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!.POSTED!not-for-mail From: Drew Adams Newsgroups: gmane.emacs.bugs Subject: bug#33446: 26; `isearch-lazy-highlight-update' in MASTER today Date: Tue, 20 Nov 2018 11:47:29 -0800 (PST) Message-ID: NNTP-Posting-Host: blaine.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: quoted-printable X-Trace: blaine.gmane.org 1542743180 2386 195.159.176.226 (20 Nov 2018 19:46:20 GMT) X-Complaints-To: usenet@blaine.gmane.org NNTP-Posting-Date: Tue, 20 Nov 2018 19:46:20 +0000 (UTC) Cc: Juri Linkov To: 33446@debbugs.gnu.org Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Tue Nov 20 20:46:16 2018 Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([208.118.235.17]) by blaine.gmane.org with esmtp (Exim 4.84_2) (envelope-from ) id 1gPByQ-0000Tt-ID for geb-bug-gnu-emacs@m.gmane.org; Tue, 20 Nov 2018 20:46:14 +0100 Original-Received: from localhost ([::1]:35622 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1gPC0X-0008GI-2y for geb-bug-gnu-emacs@m.gmane.org; Tue, 20 Nov 2018 14:48:25 -0500 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:46107) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1gPC0H-0008F9-BG for bug-gnu-emacs@gnu.org; Tue, 20 Nov 2018 14:48:10 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1gPC0B-0000Mu-EZ for bug-gnu-emacs@gnu.org; Tue, 20 Nov 2018 14:48:09 -0500 Original-Received: from debbugs.gnu.org ([208.118.235.43]:33154) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1gPC09-0000Jt-MF for bug-gnu-emacs@gnu.org; Tue, 20 Nov 2018 14:48:03 -0500 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1gPC09-0006ke-Gu for bug-gnu-emacs@gnu.org; Tue, 20 Nov 2018 14:48:01 -0500 X-Loop: help-debbugs@gnu.org Resent-From: Drew Adams Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Tue, 20 Nov 2018 19:48:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: report 33446 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: X-Debbugs-Original-To: bug-gnu-emacs@gnu.org Original-Received: via spool by submit@debbugs.gnu.org id=B.154274327525649 (code B ref -1); Tue, 20 Nov 2018 19:48:01 +0000 Original-Received: (at submit) by debbugs.gnu.org; 20 Nov 2018 19:47:55 +0000 Original-Received: from localhost ([127.0.0.1]:37412 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1gPC02-0006fN-Lp for submit@debbugs.gnu.org; Tue, 20 Nov 2018 14:47:54 -0500 Original-Received: from eggs.gnu.org ([208.118.235.92]:36263) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1gPC00-0006ah-RD for submit@debbugs.gnu.org; Tue, 20 Nov 2018 14:47:53 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1gPBzt-00006J-Rr for submit@debbugs.gnu.org; Tue, 20 Nov 2018 14:47:47 -0500 Original-Received: from lists.gnu.org ([2001:4830:134:3::11]:50579) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1gPBzt-00005E-Iy for submit@debbugs.gnu.org; Tue, 20 Nov 2018 14:47:45 -0500 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:45792) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1gPBzs-0007ay-Cv for bug-gnu-emacs@gnu.org; Tue, 20 Nov 2018 14:47:45 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1gPBzo-0008S0-8I for bug-gnu-emacs@gnu.org; Tue, 20 Nov 2018 14:47:44 -0500 Original-Received: from userp2120.oracle.com ([156.151.31.85]:43272) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1gPBzm-0008PI-8G for bug-gnu-emacs@gnu.org; Tue, 20 Nov 2018 14:47:40 -0500 Original-Received: from pps.filterd (userp2120.oracle.com [127.0.0.1]) by userp2120.oracle.com (8.16.0.22/8.16.0.22) with SMTP id wAKJipoH016811; Tue, 20 Nov 2018 19:47:31 GMT DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=oracle.com; h=mime-version : message-id : date : from : sender : to : cc : subject : content-type : content-transfer-encoding; s=corp-2018-07-02; bh=XctGWbNnxKSoTiE70TXqeNq6lSGzGKYNA0CEO9IcYMQ=; b=QyLDWODLPpKnqM9ZOkud97gQvo/qYwja8Fczs1zSqdg6axTawNlDa3orLBx20bfvLRto aa3nuC9rL22WCAKgi1j6FKFLwrQ01WsV2a3jZIQ5I3o/yOKf3Qqelw7qVTGJhh/CDwK1 avHbmlAEN14a39y9vj7iHs9AB0LukQ+7RmPlRz70RBv2MnPiWqyST248sblgW6cZr1/C MA24nfl7BLj9S6GCZ4gNEIeHG5QmFfgbOHoMc9ZvQufrVJ9qSmkqxd9b8K1mPdyYLnZn EIrP7ZI3iI80aYB+G+SmhtNhBx/e73Dk08AGk5y2Bmfp3Pydo5U5a/B5KEI+W920XYHV uQ== Original-Received: from userv0021.oracle.com (userv0021.oracle.com [156.151.31.71]) by userp2120.oracle.com with ESMTP id 2ntbmqnsy2-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Tue, 20 Nov 2018 19:47:31 +0000 Original-Received: from userv0121.oracle.com (userv0121.oracle.com [156.151.31.72]) by userv0021.oracle.com (8.14.4/8.14.4) with ESMTP id wAKJlVxx010394 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Tue, 20 Nov 2018 19:47:31 GMT Original-Received: from abhmp0007.oracle.com (abhmp0007.oracle.com [141.146.116.13]) by userv0121.oracle.com (8.14.4/8.13.8) with ESMTP id wAKJlUSd017127; Tue, 20 Nov 2018 19:47:30 GMT X-Priority: 3 X-Mailer: Oracle Beehive Extensions for Outlook 2.0.1.9.1 (1003210) [OL 16.0.4771.0 (x86)] X-Proofpoint-Virus-Version: vendor=nai engine=5900 definitions=9083 signatures=668683 X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 suspectscore=1 malwarescore=0 phishscore=0 bulkscore=0 spamscore=0 mlxscore=0 mlxlogscore=999 adultscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.0.1-1810050000 definitions=main-1811200173 X-detected-operating-system: by eggs.gnu.org: GNU/Linux 3.x [generic] X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6.x X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 208.118.235.43 X-BeenThere: bug-gnu-emacs@gnu.org List-Id: "Bug reports for GNU Emacs, the Swiss army knife of text editors" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Original-Sender: "bug-gnu-emacs" Xref: news.gmane.org gmane.emacs.bugs:152586 Archived-At: I ran into this bug today using my setup, which reflects the code for `isearch-lazy-highlight-update' that was added recently to isearch.el. Dunno why or how, but for some reason I got in a situation where `isearch-lazy-highlight-window' is live and is not the selected window. In fact it is in a different frame. And there is no lazy-highlighting showing there and no search in progress there. I'm willing to guess that this is not a normal situation that I got myself into. ;-) But I think there is nevertheless a bug somewhere in the Isearch code. 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's not there that I wanted to do `isearch-lazy-highlight-update'. If there is no lazy highlighting to be updated in the selected window then I'd expect that `isearch-lazy-highlight-update' would in that case be a no-op. Why do we move to another window to do it, even if for some reason `isearch-lazy-highlight-window' is non-nil? (I don't know why it is non-nil in my case.) 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'? In any case, then the code does this: (save-excursion (save-match-data (goto-char (if isearch-lazy-highlight-forward isearch-lazy-highlight-end isearch-lazy-highlight-start)) (while looping (let* ((bound (if isearch-lazy-highlight-forward (min (or isearch-lazy-highlight-end-limit (point-max)) (if isearch-lazy-highlight-wrapped isearch-lazy-highlight-start window-end)) (max (or isearch-lazy-highlight-start-limit (point-min)) (if isearch-lazy-highlight-wrapped isearch-lazy-highlight-end window-start)))) and that raises an error because `window-end' is nil. Dunno what the right fix is. Definitely min and max should not be called if one of their args is nil. What should be done in this case? And I wonder, even if that error gets prevented, why we should update lazy highlighting on a window other than the selected one? Is that TRT? In this case, at least, that other window has nothing to do with the action in question (my code that calls `isearch-lazy-highlight-update'), and there is no search in progress in that other window and no lazy-highlighting (e.g. overlay) showing there. In GNU Emacs 26.1 (build 1, x86_64-w64-mingw32) of 2018-05-30 Repository revision: 07f8f9bc5a51f5aa94eb099f3e15fbe0c20ea1ea Windowing system distributor `Microsoft Corp.', version 10.0.16299 Configured using: `configure --without-dbus --host=3Dx86_64-w64-mingw32 --without-compress-install 'CFLAGS=3D-O2 -static -g3''