From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!.POSTED!not-for-mail From: Philipp Stephani Newsgroups: gmane.emacs.bugs Subject: bug#21730: 25.0.50; Random errors in redisplay--pre-redisplay-functions Date: Wed, 14 Sep 2016 19:48:23 +0000 Message-ID: References: <87io5zh7m1.fsf@md5i.com> <83vb9zt19o.fsf@gnu.org> <87y4epeyf2.fsf@md5i.com> <87mvuzfapy.fsf@md5i.com> <83ziyzxiwl.fsf@gnu.org> <834m5i8l3h.fsf@gnu.org> <83oa3q70aw.fsf@gnu.org> NNTP-Posting-Host: blaine.gmane.org Mime-Version: 1.0 Content-Type: multipart/alternative; boundary=001a114702a4b5a92d053c7d03ca X-Trace: blaine.gmane.org 1473882584 6567 195.159.176.226 (14 Sep 2016 19:49:44 GMT) X-Complaints-To: usenet@blaine.gmane.org NNTP-Posting-Date: Wed, 14 Sep 2016 19:49:44 +0000 (UTC) Cc: 21730@debbugs.gnu.org, mwd@md5i.com To: Eli Zaretskii Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Wed Sep 14 21:49:40 2016 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 1bkGBX-0000IY-MF for geb-bug-gnu-emacs@m.gmane.org; Wed, 14 Sep 2016 21:49:31 +0200 Original-Received: from localhost ([::1]:58428 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bkGBV-0001Sd-QH for geb-bug-gnu-emacs@m.gmane.org; Wed, 14 Sep 2016 15:49:29 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:58857) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bkGBA-0001J0-Ck for bug-gnu-emacs@gnu.org; Wed, 14 Sep 2016 15:49:09 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1bkGB5-0000Wq-1G for bug-gnu-emacs@gnu.org; Wed, 14 Sep 2016 15:49:07 -0400 Original-Received: from debbugs.gnu.org ([208.118.235.43]:33873) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bkGB4-0000Wf-Tk for bug-gnu-emacs@gnu.org; Wed, 14 Sep 2016 15:49:02 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1bkGB4-000782-Hn for bug-gnu-emacs@gnu.org; Wed, 14 Sep 2016 15:49:02 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Philipp Stephani Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Wed, 14 Sep 2016 19:49: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.147388252227376 (code B ref 21730); Wed, 14 Sep 2016 19:49:02 +0000 Original-Received: (at 21730) by debbugs.gnu.org; 14 Sep 2016 19:48:42 +0000 Original-Received: from localhost ([127.0.0.1]:59818 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1bkGAj-00077U-Kz for submit@debbugs.gnu.org; Wed, 14 Sep 2016 15:48:42 -0400 Original-Received: from mail-wm0-f47.google.com ([74.125.82.47]:38568) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1bkGAi-00077F-2E for 21730@debbugs.gnu.org; Wed, 14 Sep 2016 15:48:40 -0400 Original-Received: by mail-wm0-f47.google.com with SMTP id 1so51709018wmz.1 for <21730@debbugs.gnu.org>; Wed, 14 Sep 2016 12:48:39 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=21HC25XV92CcURkv3BAzSk93iARYP9Obp2+qdYIjhhk=; b=ZffTL6DPRJyMMr3Kq9uoBamxguZofdG4hYvPW5f9yUMvNBToFqrGqq+Jf0DYeor2ER su03fRd6QCjhoI1N7o6j2RT0DwJZm7a6ZEhpdhhxVUv1wT3FX5Z6tRXFeXZpfwejTxiU MnpSMJfPvNnNRnx4+0uHkQJj0iSzJBq9acpFzJBCNgL5jKt3yZmWQPQyrptXOU36L/fe Wg7iyaGD/XxGbdNCa/VooE9Hp9WMAwgcnjcIWD+pN6AJSrXM2Ty2wiP5zKS7vPX/gaqC BbTbmCTNbdXp3PrYegvbWg2RAkYoT+SECyP8xr4wBWBleaY0uVZbhtBF5UK+ye3EPVRU ozqw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=21HC25XV92CcURkv3BAzSk93iARYP9Obp2+qdYIjhhk=; b=f9Pf/SpfY/XPNnwgLaxJyrzff24jvO6oi2sKAJSB3Qf4eYOSw/NZHAawW7AhCG4/H5 1cBi8N1bkVX9FqsCads7YN1RKxgf3hQw67xCtJItKOzyoPPLzjTz9OLjAfj5Ylp93gZ6 3nZ4Sm1DElzH/2fVvyZL7aNP1hW58C0yotXev51/UwJE4h0RuOcd3ExYwDyCP4oa50BA p+blP7LCr2xVSNbq3c9tLDYFJf1gj1fQIY9ojQ73q1U+7FdAyTjVnOS43BztXQgr2cNH bSkrnodGY0JyRu02oQm947VMFiCYrHllcHoe2NzPi49SJQTnOgJnth3sv2OAeVpxc1lt 1YaQ== X-Gm-Message-State: AE9vXwMToCiec2Qsx9DbhtxNph2p34pdAMLxWMjF4OG2deZo63gnFK4QV98SdcOSvR/Mwr2pJoBoyFG1XuO49A== X-Received: by 10.28.22.6 with SMTP id 6mr4882193wmw.55.1473882514361; Wed, 14 Sep 2016 12:48:34 -0700 (PDT) In-Reply-To: <83oa3q70aw.fsf@gnu.org> 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:123310 Archived-At: --001a114702a4b5a92d053c7d03ca Content-Type: text/plain; charset=UTF-8 Eli Zaretskii schrieb am Mi., 14. Sep. 2016 um 21:24 Uhr: > > From: Philipp Stephani > > Date: Wed, 14 Sep 2016 18:43:13 +0000 > > Cc: 21730@debbugs.gnu.org, mwd@md5i.com > > > > Since the problem that caused the patch to be reverted was with > > narrowing, why not simply use > > > > (= point (with-current-buffer (window-buffer window) (point-min))) > > > > instead of > > > > (= point 1) > > > > ? > > > > This has the same issues as described above. There's more code in > cursor-sensor--detect that assumes (eq > > (current-buffer) (window-buffer window)), e.g. the form > (get-char-property point 'cursor-sensor-functions). > > Therefore (= point (with-current-buffer (window-buffer window) > (point-min))) must be the same as (bobp). > > Another mystery is the stack trace entry > "run-hook-with-args(cursor-sensor--detect # > *Group*>)". How can cursor-sensor--detect be the first argument to > run-hook-with-args? Shouldn't it always > > be pre-redisplay-functions? > > If we want to dig deeper, I think we should first understand why bop > doesn't work. Is it indeed because the window's buffer is not the > current buffer when the hook is called? > Unfortunately the error doesn't trigger consistently. Maybe we are lucky and somebody manages to detect such an issue. I'd also suggest to add (cl-assert (eq (current-buffer) (window-buffer window))) to cursor-sensor--detect, because the function relies on this equality. --001a114702a4b5a92d053c7d03ca Content-Type: text/html; charset=UTF-8 Content-Transfer-Encoding: quoted-printable


Eli Za= retskii <eliz@gnu.org> schrieb am= Mi., 14. Sep. 2016 um 21:24=C2=A0Uhr:
> From: Philipp Stephani <p.stephani2@gmail.com>
> Date: Wed, 14 Sep 2016 18:43:13 +0000
> Cc: 21730@debbugs.gnu.org, mwd@md5i.com
>
>=C2=A0 Since the problem that caused the patch to be reverted was with<= br class=3D"gmail_msg"> >=C2=A0 narrowing, why not simply use
>
>=C2=A0 (=3D point (with-current-buffer (window-buffer window) (point-mi= n)))
>
>=C2=A0 instead of
>
>=C2=A0 (=3D point 1)
>
>=C2=A0 ?
>
> This has the same issues as described above. There's more code in = cursor-sensor--detect that assumes (eq
> (current-buffer) (window-buffer window)), e.g. the form (get-char-prop= erty point 'cursor-sensor-functions).
> Therefore (=3D point (with-current-buffer (window-buffer window) (poin= t-min))) must be the same as (bobp).
> Another mystery is the stack trace entry "run-hook-with-args(curs= or-sensor--detect #<window 224 on
> *Group*>)". How can cursor-sensor--detect be the first argumen= t to run-hook-with-args? Shouldn't it always
> be pre-redisplay-functions?

If we want to dig deeper, I think we should first understand why bop
doesn't work.=C2=A0 Is it indeed because the window's buffer is not= the
current buffer when the hook is called?

Unfortunately the error doesn't trigger consistent= ly. Maybe we are lucky and somebody manages to detect such an issue.
<= div>
I'd also suggest to add
(cl-assert (eq (cu= rrent-buffer) (window-buffer window)))=C2=A0
to cursor-sensor--de= tect, because the function relies on this equality.=C2=A0
--001a114702a4b5a92d053c7d03ca--