struct buffer *old_buffer = NULL, *b = XBUFFER (buf);
/* In case W->start is out of the range, use something
- reasonable. This situation occured when loading a file with
+ reasonable. This situation occurred when loading a file with
`-l' containing a call to `rmail' with subsequent other
commands. At the end, W->start happened to be BEG, while
rmail had already narrowed the buffer. */
{
struct window *w = XWINDOW (window);
struct buffer *b = XBUFFER (buffer);
- int count = specpdl_ptr - specpdl;
+ int count = SPECPDL_INDEX ();
w->buffer = buffer;
tem = Fsymbol_value (Qtemp_buffer_show_hook);
if (!NILP (tem))
{
- int count = specpdl_ptr - specpdl;
+ int count = SPECPDL_INDEX ();
Lisp_Object prev_window;
prev_window = selected_window;
Lisp_Object n;
int direction;
{
- int count = BINDING_STACK_SIZE ();
+ int count = SPECPDL_INDEX ();
xassert (abs (direction) == 1);
{
Lisp_Object window;
struct window *w;
- int count = BINDING_STACK_SIZE ();
+ int count = SPECPDL_INDEX ();
window = Fother_window_for_scrolling ();
w = XWINDOW (window);
/* Set the new window start. */
set_marker_both (w->start, w->buffer, charpos, bytepos);
w->window_end_valid = Qnil;
- w->force_start = Qt;
+
+ w->optional_new_start = Qt;
+
if (bytepos == BEGV_BYTE || FETCH_BYTE (bytepos - 1) == '\n')
w->start_at_line_beg = Qt;
else
Lisp_Object new_current_buffer;
Lisp_Object frame;
FRAME_PTR f;
+ int old_point = -1;
while (!WINDOW_CONFIGURATIONP (configuration))
wrong_type_argument (Qwindow_configuration_p, configuration);
new_current_buffer = data->current_buffer;
if (NILP (XBUFFER (new_current_buffer)->name))
new_current_buffer = Qnil;
+ else
+ old_point = BUF_PT (XBUFFER (new_current_buffer));
frame = XWINDOW (SAVED_WINDOW_N (saved_windows, 0)->window)->frame;
f = XFRAME (frame);
FRAME_ROOT_WINDOW (f) = data->root_window;
/* Prevent "swapping out point" in the old selected window
using the buffer that has been restored into it.
- That swapping out has already been done,
- near the beginning of this function. */
+ Use the point value from the beginning of this function
+ since unshow_buffer (called from delete_all_subwindows)
+ could have altered it. */
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))),
+ make_number (old_point),
XWINDOW (data->current_window)->buffer);
Fselect_window (data->current_window);
Lisp_Object args;
{
register Lisp_Object val;
- register int count = specpdl_ptr - specpdl;
+ register int count = SPECPDL_INDEX ();
record_unwind_protect (Fset_window_configuration,
Fcurrent_window_configuration (Qnil));