[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: window configuration bug
From: |
Richard Stallman |
Subject: |
Re: window configuration bug |
Date: |
Thu, 30 May 2002 11:05:19 -0600 (MDT) |
It's almost as if, even though the point in the current buffer is not
saved, the point in the other window (which contains the same buffer)
*is* saved, and this is messing up the position of the point.
Yes, the position of point in other windows is supposed to be saved.
There is a special exception for point in the current buffer--that is not
supposed to be saved or restored.
It looks like the bug is that point in the current buffer IS being
restored.
Please try this patch:
*** window.c.~1.415.~ Sun May 26 14:30:50 2002
--- window.c Thu May 30 11:58:23 2002
***************
*** 5105,5112 ****
p->mark, w->buffer);
/* As documented in Fcurrent_window_configuration, don't
! save the location of point in the buffer which was current
! when the window configuration was recorded. */
if (!EQ (p->buffer, new_current_buffer)
&& XBUFFER (p->buffer) == current_buffer)
Fgoto_char (w->pointm);
--- 5105,5112 ----
p->mark, w->buffer);
/* As documented in Fcurrent_window_configuration, don't
! restore the location of point in the buffer which was
! current when the window configuration was recorded. */
if (!EQ (p->buffer, new_current_buffer)
&& XBUFFER (p->buffer) == current_buffer)
Fgoto_char (w->pointm);
***************
*** 5144,5149 ****
--- 5144,5154 ----
That swapping out has already been done,
near the beginning of this function. */
selected_window = Qnil;
+ if (EQ (XWINDOW (data->current_window)->buffer, new_current_buffer))
+ set_marker_restricted (XWINDOW (data->current_window)->pointm,
+ make_number (BUF_PT (XBUFFER (XWINDOW
(data->current_window)->buffer))),
+ XWINDOW (data->current_window)->buffer);
+
Fselect_window (data->current_window);
XBUFFER (XWINDOW (selected_window)->buffer)->last_selected_window
= selected_window;
***************
*** 5190,5199 ****
--- 5195,5206 ----
++n;
}
+ #if 0
/* If more than one window shows the new and old current buffer,
don't try to preserve point in that buffer. */
if (old_point > 0 && n > 1)
old_point = -1;
+ #endif
adjust_glyphs (f);
***************
*** 5216,5226 ****
--- 5223,5235 ----
{
Fset_buffer (new_current_buffer);
+ #if 0
/* If the buffer that is current now is the same
that was current before setting the window configuration,
don't alter its PT. */
if (old_point >= 0)
SET_PT (old_point);
+ #endif
}
/* Restore the minimum heights recorded in the configuration. */