From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.ciao.gmane.io!not-for-mail From: Eli Zaretskii Newsgroups: gmane.emacs.bugs Subject: bug#38740: 28.0.50; cursor-sensor-mode error in post-command-hook Date: Sat, 15 Feb 2020 10:27:02 +0200 Message-ID: <83blq0ntm1.fsf@gnu.org> References: <87lfpgwzng.fsf@gmail.com> Injection-Info: ciao.gmane.io; posting-host="ciao.gmane.io:159.69.161.202"; logging-data="112384"; mail-complaints-to="usenet@ciao.gmane.io" Cc: lg.zevlg@gmail.com, 38740@debbugs.gnu.org To: Federico Tedin Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Sat Feb 15 09:28:13 2020 Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane-mx.org Original-Received: from lists.gnu.org ([209.51.188.17]) by ciao.gmane.io with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1j2so8-000T9E-OB for geb-bug-gnu-emacs@m.gmane-mx.org; Sat, 15 Feb 2020 09:28:12 +0100 Original-Received: from localhost ([::1]:49240 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1j2so7-0001XL-R5 for geb-bug-gnu-emacs@m.gmane-mx.org; Sat, 15 Feb 2020 03:28:11 -0500 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:34504) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1j2snz-0001ST-8T for bug-gnu-emacs@gnu.org; Sat, 15 Feb 2020 03:28:04 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1j2sny-0007xr-Bl for bug-gnu-emacs@gnu.org; Sat, 15 Feb 2020 03:28:03 -0500 Original-Received: from debbugs.gnu.org ([209.51.188.43]:57263) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1j2sny-0007xj-91 for bug-gnu-emacs@gnu.org; Sat, 15 Feb 2020 03:28:02 -0500 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1j2sny-00005n-6M for bug-gnu-emacs@gnu.org; Sat, 15 Feb 2020 03:28:02 -0500 X-Loop: help-debbugs@gnu.org Resent-From: Eli Zaretskii Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Sat, 15 Feb 2020 08:28:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 38740 X-GNU-PR-Package: emacs Original-Received: via spool by 38740-submit@debbugs.gnu.org id=B38740.158175522232743 (code B ref 38740); Sat, 15 Feb 2020 08:28:02 +0000 Original-Received: (at 38740) by debbugs.gnu.org; 15 Feb 2020 08:27:02 +0000 Original-Received: from localhost ([127.0.0.1]:35003 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1j2sn0-0008W0-72 for submit@debbugs.gnu.org; Sat, 15 Feb 2020 03:27:02 -0500 Original-Received: from eggs.gnu.org ([209.51.188.92]:47507) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1j2smy-0008VV-Dw for 38740@debbugs.gnu.org; Sat, 15 Feb 2020 03:27:01 -0500 Original-Received: from fencepost.gnu.org ([2001:470:142:3::e]:47734) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1j2smt-0006gD-9r; Sat, 15 Feb 2020 03:26:55 -0500 Original-Received: from [176.228.60.248] (port=1453 helo=home-c4e4a596f7) by fencepost.gnu.org with esmtpsa (TLS1.2:RSA_AES_256_CBC_SHA1:256) (Exim 4.82) (envelope-from ) id 1j2sms-0005fj-20; Sat, 15 Feb 2020 03:26:54 -0500 In-reply-to: <87lfpgwzng.fsf@gmail.com> (message from Federico Tedin on Wed, 05 Feb 2020 21:24:35 +0100) X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] 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: 209.51.188.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-mx.org@gnu.org Original-Sender: "bug-gnu-emacs" Xref: news.gmane.io gmane.emacs.bugs:176081 Archived-At: > From: Federico Tedin > Date: Wed, 05 Feb 2020 21:24:35 +0100 > Cc: 38740@debbugs.gnu.org > > > Evaluating next form in scratch buffer: > > > > (with-help-window "TEST" > > (set-buffer standard-output) > > (cursor-sensor-mode 1) > > (insert "here")) > > > > Results in error: > > > > Error in post-command-hook (cursor-sensor--detect): (args-out-of-range 354582) > > > > Looks like cursor-sensor uses scratch's window instead of "TEST" buffer window. > > > > I do not remember getting such error in Emacs 26, 27 > > I found that `cursor-sensor--detect' reads the point position from the > buffer displayed in the selected window, and then tries to read text > properties in that position in the current buffer. In your example, > those two buffers are not the same, the buffer at `standard-output' > isn't being displayed yet. I'm attaching a short patch that checks for > this case. LGTM, thanks.