GNU bug report logs - #24240
25.1.50; window-state-put, image-mode and window scrolling

Previous Next

Package: emacs;

Reported by: Andreas Politz <politza <at> hochschule-trier.de>

Date: Mon, 15 Aug 2016 23:06:02 UTC

Severity: normal

Found in version 25.1.50

Done: martin rudalics <rudalics <at> gmx.at>

Bug is archived. No further changes may be made.

Full log


View this message in rfc822 format

From: help-debbugs <at> gnu.org (GNU bug Tracking System)
To: martin rudalics <rudalics <at> gmx.at>
Cc: tracker <at> debbugs.gnu.org
Subject: bug#24240: closed (25.1.50; window-state-put, image-mode and
 window scrolling)
Date: Sun, 30 Oct 2016 08:48:02 +0000
[Message part 1 (text/plain, inline)]
Your message dated Sun, 30 Oct 2016 09:47:13 +0100
with message-id <5815B391.4070706 <at> gmx.at>
and subject line Re: bug#24240: 25.1.50; window-state-put, image-mode and window scrolling
has caused the debbugs.gnu.org bug report #24240,
regarding 25.1.50; window-state-put, image-mode and window scrolling
to be marked as done.

(If you believe you have received this mail in error, please contact
help-debbugs <at> gnu.org.)


-- 
24240: http://debbugs.gnu.org/cgi/bugreport.cgi?bug=24240
GNU Bug Tracking System
Contact help-debbugs <at> gnu.org with problems
[Message part 2 (message/rfc822, inline)]
From: Andreas Politz <politza <at> hochschule-trier.de>
To: bug-gnu-emacs <at> gnu.org
Subject: 25.1.50; window-state-put, image-mode and window scrolling
Date: Tue, 16 Aug 2016 01:05:11 +0200
[Message part 3 (text/plain, inline)]
There is a conflict between window-state-put and image-mode and
maybe other modes.  

The function image-mode-reapply-winprops gets called as soon as
window-state-put displays the image buffer in some window via
window-configuration-change-hook and applies the image's
previously stored scroll-values.

But window-state-put is not done yet and it has it's own
understanding of how the window should be scrolled, thereby
overriding images-mode's scrolling.

I guess ideally window-state-put should be atomic in the sense
that it delays these kinds of hooks until the window is
completely restored.  Below is a recipe and I attached a
workaround.

-ap

--

Let's start with

emacs -Q

and find some image file:

C-x C-f foo.png RET

Maybe enlarge the image, such that it can be scrolled.  Move the
image (C-n), such that vscroll is greater 0.

(window-vscroll) => 37

Save the window state,

(setq wst (window-state-get))

and switch to the *scratch* buffer.

(current-buffer) => #<buffer *scratch*>

Now restore the previously saved window state

(window-state-put wst)

,which should bring back the image buffer.  But notice, how
vscroll seems to be 0, i.e. display starts at the top of image.
Finally evaluate any expression in the mini-buffer

M-: t RET

which triggers image-mode-reapply-winprops scrolling the image as
expected.


[window-state-put-workaround.el (application/emacs-lisp, attachment)]
[Message part 5 (message/rfc822, inline)]
From: martin rudalics <rudalics <at> gmx.at>
To: Andreas Politz <politza <at> hochschule-trier.de>
Cc: 24240-done <at> debbugs.gnu.org
Subject: Re: bug#24240: 25.1.50;
 window-state-put, image-mode and window scrolling
Date: Sun, 30 Oct 2016 09:47:13 +0100
Bug closed.  Please reopen it when any of the issues discussed
here become virulent again.

martin


This bug report was last modified 8 years and 209 days ago.

Previous Next


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