unofficial mirror of bug-gnu-emacs@gnu.org 
 help / color / mirror / code / Atom feed
From: martin rudalics <rudalics@gmx.at>
To: Andreas Politz <politza@hochschule-trier.de>
Cc: 24240@debbugs.gnu.org
Subject: bug#24240: 25.1.50; window-state-put, image-mode and window scrolling
Date: Wed, 17 Aug 2016 10:30:26 +0200	[thread overview]
Message-ID: <57B420A2.6020608@gmx.at> (raw)
In-Reply-To: <8737m4u8j6.fsf@hochschule-trier.de>

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

 >> We'd need a variable, say ‘window-inhibit-configuration-change-hook’.
 >
 > inhibit-window-configuration-change-hook ?

We can abuse ‘frame-after-make-frame’.  Try the attached, completely
untested patch.

BTW I just noticed that we still run ‘window-configuration-change-hook’
in far too many cases.  I'll have to remove it from ‘window-resize’,
‘window--resize-mini-window’, ‘adjust-window-trailing-edge’ and
‘balance-windows’.

 > The problem is, that it does work when edebugging it.  Anyway, I think I've
 > found the problem: It's the call to set-window-start, which in my
 > understanding forces the next redraw to scroll the window, thus
 > negating image-modes work.

Would my patch work around that?

martin

[-- Attachment #2: inhibit-run-wcchh.diff --]
[-- Type: text/plain, Size: 2156 bytes --]

--- a/lisp/window.el
+++ b/lisp/window.el
@@ -5620,21 +5620,29 @@ window-state-put
 	;; minimum possible state.  But such configurations hardly make
 	;; sense anyway.
 	(error "Window %s too small to accommodate state" window)
-      (setq state (cdr state))
-      (setq window-state-put-list nil)
-      ;; Work on the windows of a temporary buffer to make sure that
-      ;; splitting proceeds regardless of any buffer local values of
-      ;; `window-size-fixed'.  Release that buffer after the buffers of
-      ;; all live windows have been set by `window--state-put-2'.
-      (with-temp-buffer
-	(set-window-buffer window (current-buffer))
-	(window--state-put-1 state window nil totals pixelwise)
-	(window--state-put-2 ignore pixelwise))
-      (while window-state-put-stale-windows
-	(let ((window (pop window-state-put-stale-windows)))
-	  (when (eq (window-deletable-p window) t)
-	    (delete-window window))))
-      (window--check frame))))
+
+
+      (unwind-protect
+          (progn
+            (frame-after-make-frame frame nil)
+            (setq state (cdr state))
+            (setq window-state-put-list nil)
+            ;; Work on the windows of a temporary buffer to make sure that
+            ;; splitting proceeds regardless of any buffer local values of
+            ;; `window-size-fixed'.  Release that buffer after the buffers of
+            ;; all live windows have been set by `window--state-put-2'.
+            (with-temp-buffer
+              (set-window-buffer window (current-buffer))
+              (window--state-put-1 state window nil totals pixelwise)
+              (window--state-put-2 ignore pixelwise))
+            (while window-state-put-stale-windows
+              (let ((window (pop window-state-put-stale-windows)))
+                (when (eq (window-deletable-p window) t)
+                  (delete-window window)))))
+        (frame-after-make-frame frame t)
+        (prog1
+            (window--check frame)
+          (run-window-configuration-change-hook frame))))))
 \f
 (defun display-buffer-record-window (type window buffer)
   "Record information for window used by `display-buffer'.


  reply	other threads:[~2016-08-17  8:30 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-08-15 23:05 bug#24240: 25.1.50; window-state-put, image-mode and window scrolling Andreas Politz
2016-08-16 11:00 ` martin rudalics
2016-08-16 13:51   ` Andreas Politz
2016-08-17  8:30     ` martin rudalics [this message]
2016-08-17 10:33       ` Andreas Politz
2016-08-17 15:47         ` martin rudalics
2016-08-17 16:12           ` Andreas Politz
2016-08-18  8:42             ` martin rudalics
2016-10-30  8:47               ` martin rudalics

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=57B420A2.6020608@gmx.at \
    --to=rudalics@gmx.at \
    --cc=24240@debbugs.gnu.org \
    --cc=politza@hochschule-trier.de \
    /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).