From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!.POSTED!not-for-mail From: Sergio Durigan Junior Newsgroups: gmane.emacs.bugs Subject: bug#21730: 25.0.50; Random errors in redisplay--pre-redisplay-functions Date: Mon, 24 Jul 2017 22:06:56 -0400 Message-ID: <87h8y1s20v.fsf@sergiodj.net> References: <87io5zh7m1.fsf@md5i.com> <83vb9zt19o.fsf@gnu.org> <87y4epeyf2.fsf@md5i.com> <87mvuzfapy.fsf@md5i.com> <83ziyzxiwl.fsf@gnu.org> <83mvja7074.fsf@gnu.org> NNTP-Posting-Host: blaine.gmane.org Mime-Version: 1.0 Content-Type: multipart/signed; boundary="=-=-="; micalg=pgp-sha256; protocol="application/pgp-signature" X-Trace: blaine.gmane.org 1500948499 11373 195.159.176.226 (25 Jul 2017 02:08:19 GMT) X-Complaints-To: usenet@blaine.gmane.org NNTP-Posting-Date: Tue, 25 Jul 2017 02:08:19 +0000 (UTC) User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/25.1 (gnu/linux) Cc: 21730@debbugs.gnu.org, mwd@md5i.com, Philipp Stephani To: Eli Zaretskii Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Tue Jul 25 04:08:15 2017 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 1dZpGg-0002jD-Je for geb-bug-gnu-emacs@m.gmane.org; Tue, 25 Jul 2017 04:08:14 +0200 Original-Received: from localhost ([::1]:57987 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1dZpGm-0007Xn-9q for geb-bug-gnu-emacs@m.gmane.org; Mon, 24 Jul 2017 22:08:20 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:53119) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1dZpGc-0007XS-SN for bug-gnu-emacs@gnu.org; Mon, 24 Jul 2017 22:08:12 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1dZpGZ-0001RG-Kz for bug-gnu-emacs@gnu.org; Mon, 24 Jul 2017 22:08:10 -0400 Original-Received: from debbugs.gnu.org ([208.118.235.43]:52202) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1dZpGZ-0001R7-IG for bug-gnu-emacs@gnu.org; Mon, 24 Jul 2017 22:08:07 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1dZpGU-0000Kn-Fo for bug-gnu-emacs@gnu.org; Mon, 24 Jul 2017 22:08:02 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Sergio Durigan Junior Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Tue, 25 Jul 2017 02:08:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 21730 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: Original-Received: via spool by 21730-submit@debbugs.gnu.org id=B21730.15009484211205 (code B ref 21730); Tue, 25 Jul 2017 02:08:02 +0000 Original-Received: (at 21730) by debbugs.gnu.org; 25 Jul 2017 02:07:01 +0000 Original-Received: from localhost ([127.0.0.1]:54879 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1dZpFU-0000JJ-SF for submit@debbugs.gnu.org; Mon, 24 Jul 2017 22:07:01 -0400 Original-Received: from kwanyin.sergiodj.net ([158.69.185.54]:58796) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1dZpFT-0000JB-0N for 21730@debbugs.gnu.org; Mon, 24 Jul 2017 22:06:59 -0400 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=sergiodj.net; s=20160602; h=Content-Type:MIME-Version:Message-ID:Date:References:In-Reply-To:Subject:Cc:To:From; bh=IyzJuxuyCrQTEG4dBEimNVjn2ViSfXKS00nGfzYM1Kk=; b=P4OH2cBASZpbHkSy9mfMvesxQDVfZP6lJ9gKZr0eMDBbcyjOCEG0Tb5bOnvxQOB6Vz0VH54bbadsOX7Ipcr7gjRtqSgrV87Qsz4MtjOW4mJ4Wc5r/DEB4U1iraRn48YzUU8TwhPVB9V/chh9NQgckBb3VLZTlc9/88VtYCz7hbE=; In-Reply-To: <83mvja7074.fsf@gnu.org> X-URL: http://blog.sergiodj.net 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:134950 Archived-At: --=-=-= Content-Type: text/plain Content-Transfer-Encoding: quoted-printable On Wednesday, September 14 2016, Eli Zaretskii wrote: [ Resending because I have now really unarchived the bug. Sorry about the dup. ] >> From: Philipp Stephani >> Date: Wed, 14 Sep 2016 19:11:57 +0000 >>=20 >> (with-current-buffer (window-buffer win) >> (run-hook-with-args 'pre-redisplay-functions win)) >> to >> (run-hook-wrapped 'pre-redisplay-functions >> (lambda (func) (with-current-buffer (window-buffer win) >> (funcall func win) >> nil)) >> or so. >>=20 >> I've attached a patch for this.=20 > > Thanks. But we are going to entertain such changes, I think we really > should be sure the issue with the current buffer is the culprit. See > my other message a few moments ago. It is pretty hard to diagnose and investigate this issue, but I think I've managed to progress a bit. The problem doesn't seem to be on bobp, and I happen to share Philipp's opinion that the real issue is the assumption that cursor-sensor--detect will be at the right buffer when it's not. Here, let me show you. On my machine, this error always happens when I'm running Gnus in one buffer (via emacsclient), and while I am visiting a file in another buffer, and in another window (i.e., another emacsclient). The backtrace I get is: Debugger entered--Lisp error: (args-out-of-range 0) get-char-property(0 cursor-sensor-functions) cursor-sensor--detect(#) ^^^^^^^^^^^^^^^^^^^^^^^^^ run-hook-with-args(cursor-sensor--detect #) redisplay--pre-redisplay-functions(t) apply(redisplay--pre-redisplay-functions t) [ lots of other functions not interesting for us ] I took the liberty to mark the interesting part above, which is the argument to cursor-sensor--detect. As you can notice, it's working on the *Group* window, from Gnus. Now, the interesting part that I noticed and was able to verify is that this only happens when (a) I am not working in that buffer, (b) the point is at (point-min) at that buffer, but (c) the point is not (point-min) at the buffer I'm currently in. In this case, Emacs does some wrong calculations with point and ends up with the value of 0, which makes sense if you consider that (window-point) of that window is 1, but (bobp) is not t (because, as I explained, I'm working in another buffer, and the value of point there is not 1). With all that said, I came to the conclusion that Phillip's rationale makes sense and therefore his patch seems to be the best shot we have at fixing this annoying bug. Thanks, =2D-=20 Sergio GPG key ID: 237A 54B1 0287 28BF 00EF 31F4 D0EB 7628 65FC 5E36 Please send encrypted e-mail if possible http://sergiodj.net/ --=-=-= Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iQIzBAEBCAAdFiEEI3pUsQKHKL8A7zH00Ot2KGX8XjYFAll2p8EACgkQ0Ot2KGX8 Xjb5xBAAl373LAUtKteA/HZn6KpWDK+vZqXq7gX4BDAwdrr4Ard0gA2xyIN1pb42 yFsE3Qs0Ek0Y9a0G3u+Gw48gaf5+piaTpqTlNI2r+TfKdbk6P13wCrXI59cKQYkR oKLceNDM4Fn4On5rLF33TQFvxd39qZ+wy9PBhjVISN7Qfrpm9zgqrfsYUfP2GS9D dv948yciOl6fr3/UZKZZsDGq1yTky8cThQegJHIkL0c7Rh1y1YVe39sTEDYuLOLQ Kc1NibfBmzQkIvMzYUsuJ0by7q9CGKPBz1y6ngoZHFm+GXIlwe5bT5otmMhQMjMF 3+aWjQ98p4djobgDV/6HhFM3VIZm05vdgZEJwNv51faNRLyZv2aPXdpetsPpGp6J 2iX5NFoudz+FRj7j/YiT4ICxdaRfhASEfe5QrlxA9jFhy47qMnw6vZWBR98mEKhq 4hemsWVPkfwdyVNr48mAlMdI73hAdI1awCtEJqcfow44QCy6TEusH2pc7RRr+uMt P2e3kMiayK4UGNcNAGH1etWhlCzL+tlfGE93yM75LI1Q5cYqEMAzSiwWmVxdh6BG 36K9vJnH8/UaSJDCUbxCmBpXWt986kVHUGKEpb9A8z36Mws+xf0GlKPw9bVGbuNf NZVkZjefR1sQ795ccnA6yg755culHHYsAZVA1t0z7nKlzl4cgPU= =yQhh -----END PGP SIGNATURE----- --=-=-=--