Commit 2d0834cc authored by Stefan Monnier's avatar Stefan Monnier

(Fset_window_dedicated_p): Simplify.

(display_buffer_1): Don't raise the win from which minibuf was entered.
(temp_output_buffer_show): Don't assume BEG == 1.  Simplify.
(Fminibuffer_selected_window): Simplify.
(delete_window): Update for new types.
parent cfea0546
2003-06-26 Stefan Monnier <monnier@cs.yale.edu>
* alloc.c (survives_gc_p): Simplify.
* buffer.c (set_buffer_internal_1): Test CONSP for lists.
* window.c (Fset_window_dedicated_p): Simplify.
(display_buffer_1): Don't raise the win from which minibuf was entered.
(temp_output_buffer_show): Don't assume BEG == 1. Simplify.
(Fminibuffer_selected_window): Simplify.
* buffer.h (struct buffer_text): Lisp_Object `markers' => Lisp_Marker.
* lisp.h (unchain_marker): Lisp_Object arg => Lisp_Marker.
(struct Lisp_Marker): Lisp_Object `chain' => Lisp_Marker `next'.
* insdel.c (check_markers, adjust_markers_for_delete)
(adjust_markers_for_insert, adjust_markers_for_replace)
(prepare_to_modify_buffer, RESTORE_VALUE):
* marker.c (buf_charpos_to_bytepos, buf_bytepos_to_charpos)
(Fset_marker, set_marker_restricted, set_marker_both, unchain_marker)
(set_marker_restricted_both, Fbuffer_has_markers_at, count_markers):
* alloc.c (Fmake_marker, free_marker, gc_sweep):
* buffer.c (Fget_buffer_create, Fkill_buffer, Fset_buffer_multibyte):
* editfns.c (save_excursion_restore, transpose_markers):
* window.c (delete_window):
* xdisp.c (message_dolog): Update for new types.
2003-06-26 Jan Dj,Ad(Brv <jan.h.d@swipnet.se>
* xfaces.c (set_font_frame_param): Set default_face_done_p to zero.
(realize_default_face): Use default_face_done_p for the force_p
argument to set_lface_from_font_name. Set default_face_done_p to
one.
argument to set_lface_from_font_name. Set default_face_done_p to one.
* frame.c (make_frame): Initialize default_face_done_p.
......
......@@ -1119,10 +1119,7 @@ non-nil means yes. */)
{
register struct window *w = decode_window (window);
if (NILP (arg))
w->dedicated = Qnil;
else
w->dedicated = Qt;
w->dedicated = arg;
return w->dedicated;
}
......@@ -1381,8 +1378,8 @@ delete_window (window)
if (!NILP (tem))
{
unshow_buffer (p);
unchain_marker (p->pointm);
unchain_marker (p->start);
unchain_marker (XMARKER (p->pointm));
unchain_marker (XMARKER (p->start));
}
/* Free window glyph matrices. It is sure that they are allocated
......@@ -2922,6 +2919,9 @@ defaults. */)
return Qnil;
}
/* Note that selected_window can be nil
when this is called from Fset_window_configuration. */
DEFUN ("select-window", Fselect_window, Sselect_window, 1, 2, 0,
doc: /* Select WINDOW. Most editing will apply to WINDOW's buffer.
If WINDOW is not already selected, also make WINDOW's buffer current.
......@@ -3021,7 +3021,14 @@ display_buffer_1 (window)
FRAME_SAMPLE_VISIBILITY (f);
if (!EQ (frame, selected_frame))
if (EQ (frame, selected_frame))
; /* Assume the selected frame is already visible enough. */
else if (minibuf_level > 0
&& MINI_WINDOW_P (XWINDOW (selected_window))
&& WINDOW_LIVE_P (minibuf_selected_window)
&& EQ (frame, WINDOW_FRAME (XWINDOW (minibuf_selected_window))))
; /* Assume the frame from which we invoked the minibuffer is visible. */
else
{
if (FRAME_ICONIFIED_P (f))
Fmake_frame_visible (frame);
......@@ -3328,37 +3335,31 @@ temp_output_buffer_show (buf)
w = XWINDOW (window);
XSETFASTINT (w->hscroll, 0);
XSETFASTINT (w->min_hscroll, 0);
set_marker_restricted_both (w->start, buf, 1, 1);
set_marker_restricted_both (w->pointm, buf, 1, 1);
set_marker_restricted_both (w->start, buf, BEG, BEG);
set_marker_restricted_both (w->pointm, buf, BEG, BEG);
/* Run temp-buffer-show-hook, with the chosen window selected
and its buffer current. */
if (!NILP (Vrun_hooks))
if (!NILP (Vrun_hooks)
&& !NILP (Fboundp (Qtemp_buffer_show_hook))
&& !NILP (Fsymbol_value (Qtemp_buffer_show_hook)))
{
Lisp_Object tem;
tem = Fboundp (Qtemp_buffer_show_hook);
if (!NILP (tem))
{
tem = Fsymbol_value (Qtemp_buffer_show_hook);
if (!NILP (tem))
{
int count = SPECPDL_INDEX ();
Lisp_Object prev_window, prev_buffer;
prev_window = selected_window;
XSETBUFFER (prev_buffer, old);
/* Select the window that was chosen, for running the hook.
Note: Both Fselect_window and select_window_norecord may
set-buffer to the buffer displayed in the window,
so we need to save the current buffer. --stef */
record_unwind_protect (Fset_buffer, prev_buffer);
record_unwind_protect (select_window_norecord, prev_window);
Fselect_window (window, Qt);
Fset_buffer (w->buffer);
call1 (Vrun_hooks, Qtemp_buffer_show_hook);
unbind_to (count, Qnil);
}
}
int count = SPECPDL_INDEX ();
Lisp_Object prev_window, prev_buffer;
prev_window = selected_window;
XSETBUFFER (prev_buffer, old);
/* Select the window that was chosen, for running the hook.
Note: Both Fselect_window and select_window_norecord may
set-buffer to the buffer displayed in the window,
so we need to save the current buffer. --stef */
record_unwind_protect (Fset_buffer, prev_buffer);
record_unwind_protect (select_window_norecord, prev_window);
Fselect_window (window, Qt);
Fset_buffer (w->buffer);
call1 (Vrun_hooks, Qtemp_buffer_show_hook);
unbind_to (count, Qnil);
}
}
}
......@@ -4818,7 +4819,6 @@ Returns nil, if current window is not a minibuffer window. */)
{
if (minibuf_level > 0
&& MINI_WINDOW_P (XWINDOW (selected_window))
&& !NILP (minibuf_selected_window)
&& WINDOW_LIVE_P (minibuf_selected_window))
return minibuf_selected_window;
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment