GNU bug report logs - #21730
25.0.50; Random errors in redisplay--pre-redisplay-functions

Previous Next

Package: emacs;

Reported by: Michael Welsh Duggan <mwd <at> md5i.com>

Date: Thu, 22 Oct 2015 04:05:02 UTC

Severity: normal

Found in version 25.0.50

Done: Eli Zaretskii <eliz <at> gnu.org>

Bug is archived. No further changes may be made.

Full log


Message #32 received at 21730 <at> debbugs.gnu.org (full text, mbox):

From: Eli Zaretskii <eliz <at> gnu.org>
To: Philipp Stephani <p.stephani2 <at> gmail.com>
Cc: 21730 <at> debbugs.gnu.org, mwd <at> md5i.com
Subject: Re: bug#21730: 25.0.50;
 Random errors in redisplay--pre-redisplay-functions
Date: Wed, 14 Sep 2016 20:09:06 +0300
> From: Philipp Stephani <p.stephani2 <at> 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.




This bug report was last modified 7 years and 304 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.