all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: Sergio Durigan Junior <sergiodj@sergiodj.net>
To: Eli Zaretskii <eliz@gnu.org>
Cc: 21730@debbugs.gnu.org, mwd@md5i.com,
	Philipp Stephani <p.stephani2@gmail.com>
Subject: bug#21730: 25.0.50; Random errors in redisplay--pre-redisplay-functions
Date: Mon, 24 Jul 2017 22:06:56 -0400	[thread overview]
Message-ID: <87h8y1s20v.fsf@sergiodj.net> (raw)
In-Reply-To: <83mvja7074.fsf@gnu.org>

[-- Attachment #1: Type: text/plain, Size: 2773 bytes --]

On Wednesday, September 14 2016, Eli Zaretskii wrote:

[ Resending because I have now really unarchived the bug.  Sorry about
  the dup. ]

>> From: Philipp Stephani <p.stephani2@gmail.com>
>> Date: Wed, 14 Sep 2016 19:11:57 +0000
>> 
>>  (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.
>> 
>> I've attached a patch for this. 
>
> 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(#<window 5650 on *Group*>)
                          ^^^^^^^^^^^^^^^^^^^^^^^^^
    run-hook-with-args(cursor-sensor--detect #<window 5650 on *Group*>)
    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,

-- 
Sergio
GPG key ID: 237A 54B1 0287 28BF 00EF  31F4 D0EB 7628 65FC 5E36
Please send encrypted e-mail if possible
http://sergiodj.net/

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 832 bytes --]

  reply	other threads:[~2017-07-25  2:06 UTC|newest]

Thread overview: 16+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-10-22  4:04 bug#21730: 25.0.50; Random errors in redisplay--pre-redisplay-functions Michael Welsh Duggan
2015-10-22 14:40 ` Eli Zaretskii
2015-10-27  4:19   ` Michael Welsh Duggan
2015-10-31 13:07     ` Michael Welsh Duggan
2015-10-31 13:32       ` Eli Zaretskii
2016-09-14 17:01         ` Philipp Stephani
     [not found]         ` <CAArVCkTA5_hxvxszdYX1QWSoG382zg+mW=4U3uhiXmTBcPCSgw@mail.gmail.com>
2016-09-14 17:09           ` Eli Zaretskii
2016-09-14 18:43             ` Philipp Stephani
2016-09-14 19:23               ` Eli Zaretskii
2016-09-14 19:48                 ` Philipp Stephani
2016-09-15 14:22                   ` Eli Zaretskii
2016-09-14 19:11           ` Philipp Stephani
2016-09-14 19:25             ` Eli Zaretskii
2017-07-25  2:06               ` Sergio Durigan Junior [this message]
2017-07-25 14:21                 ` Eli Zaretskii
2017-07-25 23:15                   ` Sergio Durigan Junior

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=87h8y1s20v.fsf@sergiodj.net \
    --to=sergiodj@sergiodj.net \
    --cc=21730@debbugs.gnu.org \
    --cc=eliz@gnu.org \
    --cc=mwd@md5i.com \
    --cc=p.stephani2@gmail.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this external index

	https://git.savannah.gnu.org/cgit/emacs.git
	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.