all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: Philipp Stephani <p.stephani2@gmail.com>
To: Eli Zaretskii <eliz@gnu.org>, 21730@debbugs.gnu.org, mwd@md5i.com
Cc: 21730-done@debbugs.gnu.org
Subject: bug#21730: 25.0.50; Random errors in redisplay--pre-redisplay-functions
Date: Wed, 14 Sep 2016 17:01:34 +0000	[thread overview]
Message-ID: <CAArVCkSkfuxMcFApWd3d=FMhOARy9yUuZCn4rurQ9kKme2WDXw@mail.gmail.com> (raw)
In-Reply-To: <83ziyzxiwl.fsf@gnu.org>

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

Eli Zaretskii <eliz@gnu.org> schrieb am Sa., 31. Okt. 2015 um 14:34 Uhr:

> > From: Michael Welsh Duggan <mwd@md5i.com>
> > Date: Sat, 31 Oct 2015 09:07:05 -0400
> >
> > > I've changed the (bobp) to (= point 1).  I'll run it for a couple of
> > > weeks and report back.
> >
> > This change seems to have done the trick.  I have not encountered the
> > error in several days.
>
> Thanks for testing.  I pushed the change, and I'm arking this bug as
> done.
>
>
>
This change was  reverted in 76ef52267cf887e3e1aa6d25b3b16dd0601dd459.
It also doesn't seem correct. cursor-sensor--detect is only used in
pre-redisplay-functions, and the documentation of that variable says:
"Hook run just before redisplay.
It is called in each window that is to be redisplayed.  It takes one
argument,
which is the window that will be redisplayed.  When run, the
‘current-buffer’
is set to the buffer displayed in that window."
That means that (bobp) is correct and (= point 1) cannot give a different
result, unless narrowing is in effect (then only bobp is correct).
Given that replacing (bobp) with (= point 1) does solve this bug, the
documentation of pre-redisplay-functions must be incorrect, i.e. the
current buffer is not the buffer of the window passed as argument. I think
the only way how this can happen is that a previous entry in
pre-redisplay-functions has changed the current buffer. Probably the
implementation of redisplay--pre-redisplay-functions should be changed from
(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.

So we might try the following: Replace redisplay--pre-redisplay-functions
(and indeed, all hooks that document anything about the current buffer) as
above. Then add (cl-assert (eq (current-buffer) (window-buffer window)) to
cursor-sensor--detect and remove  code such as (window-point window),
because that must be equal to (point). WDYT? Or am I misunderstanding
something?

[-- Attachment #2: Type: text/html, Size: 2969 bytes --]

  reply	other threads:[~2016-09-14 17:01 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 [this message]
     [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
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='CAArVCkSkfuxMcFApWd3d=FMhOARy9yUuZCn4rurQ9kKme2WDXw@mail.gmail.com' \
    --to=p.stephani2@gmail.com \
    --cc=21730-done@debbugs.gnu.org \
    --cc=21730@debbugs.gnu.org \
    --cc=eliz@gnu.org \
    --cc=mwd@md5i.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.