emacs-diffs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Emacs-diffs] Changes to emacs/src/window.c,v


From: Stefan Monnier
Subject: [Emacs-diffs] Changes to emacs/src/window.c,v
Date: Sat, 19 Jan 2008 05:11:03 +0000

CVSROOT:        /sources/emacs
Module name:    emacs
Changes by:     Stefan Monnier <monnier>        08/01/19 05:11:02

Index: window.c
===================================================================
RCS file: /sources/emacs/emacs/src/window.c,v
retrieving revision 1.599
retrieving revision 1.600
diff -u -b -r1.599 -r1.600
--- window.c    8 Jan 2008 20:44:19 -0000       1.599
+++ window.c    19 Jan 2008 05:11:01 -0000      1.600
@@ -3321,6 +3321,7 @@
   struct window *w = XWINDOW (window);
   struct buffer *b = XBUFFER (buffer);
   int count = SPECPDL_INDEX ();
+  int samebuf = EQ (buffer, w->buffer);
 
   w->buffer = buffer;
 
@@ -3339,6 +3340,15 @@
   XSETFASTINT (w->window_end_vpos, 0);
   bzero (&w->last_cursor, sizeof w->last_cursor);
   w->window_end_valid = Qnil;
+  if (!(keep_margins_p && samebuf))
+    { /* If we're not actually changing the buffer, Don't reset hscroll and
+        vscroll.  This case happens for example when called from
+        change_frame_size_1, where we use a dummy call to
+        Fset_window_buffer on the frame's selected window (and no other)
+        just in order to run window-configuration-change-hook.
+        Resetting hscroll and vscroll here is problematic for things like
+        image-mode and doc-view-mode since it resets the image's position
+        whenever we resize the frame.  */
   w->hscroll = w->min_hscroll = make_number (0);
   w->vscroll = 0;
   set_marker_both (w->pointm, buffer, BUF_PT (b), BUF_PT_BYTE (b));
@@ -3349,6 +3359,9 @@
   w->force_start = Qnil;
   XSETFASTINT (w->last_modified, 0);
   XSETFASTINT (w->last_overlay_modified, 0);
+    }
+  /* Maybe we could move this into the `if' but it's not obviously safe and
+     I doubt it's worth the trouble.  */
   windows_or_buffers_changed++;
 
   /* We must select BUFFER for running the window-scroll-functions.




reply via email to

[Prev in Thread] Current Thread [Next in Thread]