unofficial mirror of bug-gnu-emacs@gnu.org 
 help / color / mirror / code / Atom feed
From: Eli Zaretskii <eliz@gnu.org>
To: Philipp Stephani <p.stephani2@gmail.com>
Cc: 21730@debbugs.gnu.org, mwd@md5i.com
Subject: bug#21730: 25.0.50; Random errors in redisplay--pre-redisplay-functions
Date: Wed, 14 Sep 2016 20:09:06 +0300	[thread overview]
Message-ID: <834m5i8l3h.fsf@gnu.org> (raw)
In-Reply-To: <CAArVCkTA5_hxvxszdYX1QWSoG382zg+mW=4U3uhiXmTBcPCSgw@mail.gmail.com> (message from Philipp Stephani on Wed, 14 Sep 2016 16:54:23 +0000)

> From: Philipp Stephani <p.stephani2@gmail.com>
> Date: Wed, 14 Sep 2016 16:54:23 +0000
> 
>  Thanks for testing. I pushed the change, and I'm arking this bug as
>  done.
> 
> This change was reverted in 76ef52267cf887e3e1aa6d25b3b16dd0601dd459.

Too bad people revert changes that fixed a bug without making sure
they don't reintroduce the same bug again.  Now Emacs 25.1 will be
released with this bug.

> 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?

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)

?

Anyway, my role in this bug was just to facilitate the debugging and
push a commit, I didn't really look at the issue deeper than what you
see in the discussion.





  parent reply	other threads:[~2016-09-14 17:09 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 [this message]
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

  List information: https://www.gnu.org/software/emacs/

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

  git send-email \
    --in-reply-to=834m5i8l3h.fsf@gnu.org \
    --to=eliz@gnu.org \
    --cc=21730@debbugs.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 public inbox

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

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).