return val;
}
-DEFUN ("selected-window", Fselected_window, Sselected_window, 0, 0, 0,
+DEFUE ("selected-window", Fselected_window, Sselected_window, 0, 0, 0,
doc: /* Return the window that the cursor now appears in and commands apply to. */)
(void)
{
return FRAME_MINIBUF_WINDOW (XFRAME (frame));
}
-DEFUN ("window-minibuffer-p", Fwindow_minibuffer_p, Swindow_minibuffer_p, 0, 1, 0,
+DEFUE ("window-minibuffer-p", Fwindow_minibuffer_p,
+ Swindow_minibuffer_p, 0, 1, 0,
doc: /* Return non-nil if WINDOW is a minibuffer window.
WINDOW defaults to the selected window. */)
(Lisp_Object window)
}
-DEFUN ("pos-visible-in-window-p", Fpos_visible_in_window_p,
+DEFUE ("pos-visible-in-window-p", Fpos_visible_in_window_p,
Spos_visible_in_window_p, 0, 3, 0,
doc: /* Return non-nil if position POS is currently on the frame in WINDOW.
Return nil if that position is scrolled vertically out of view.
return XWINDOW (window);
}
-DEFUN ("window-buffer", Fwindow_buffer, Swindow_buffer, 0, 1, 0,
+DEFUE ("window-buffer", Fwindow_buffer, Swindow_buffer, 0, 1, 0,
doc: /* Return the buffer that WINDOW is displaying.
WINDOW defaults to the selected window. */)
(Lisp_Object window)
return value;
}
-DEFUN ("set-window-point", Fset_window_point, Sset_window_point, 2, 2, 0,
+DEFUE ("set-window-point", Fset_window_point, Sset_window_point, 2, 2, 0,
doc: /* Make point value in WINDOW be at position POS in WINDOW's buffer.
Return POS. */)
(Lisp_Object window, Lisp_Object pos)
}
-DEFUN ("window-dedicated-p", Fwindow_dedicated_p, Swindow_dedicated_p,
+DEFUE ("window-dedicated-p", Fwindow_dedicated_p, Swindow_dedicated_p,
0, 1, 0,
doc: /* Return non-nil when WINDOW is dedicated to its buffer.
More precisely, return the value assigned by the last call of
children be children of that parent instead. ***/
}
-DEFUN ("delete-window", Fdelete_window, Sdelete_window, 0, 1, "",
+DEFUE ("delete-window", Fdelete_window, Sdelete_window, 0, 1, "",
doc: /* Remove WINDOW from its frame.
WINDOW defaults to the selected window. Return nil.
Signal an error when WINDOW is the only window on its frame. */)
}
-DEFUN ("next-window", Fnext_window, Snext_window, 0, 3, 0,
+DEFUE ("next-window", Fnext_window, Snext_window, 0, 3, 0,
doc: /* Return window following WINDOW in cyclic ordering of windows.
WINDOW defaults to the selected window. The optional arguments
MINIBUF and ALL-FRAMES specify the set of windows to consider.
frame);
}
-DEFUN ("get-buffer-window", Fget_buffer_window, Sget_buffer_window, 0, 2, 0,
+DEFUE ("get-buffer-window", Fget_buffer_window, Sget_buffer_window, 0, 2, 0,
doc: /* Return a window currently displaying BUFFER-OR-NAME, or nil if none.
BUFFER-OR-NAME may be a buffer or a buffer name and defaults to the
current buffer.
while (total_shrink > total_removed)
{
int nonzero_sizes = 0;
- int nonzero_idx = -1;
for (i = 0; i < nchildren; ++i)
if (new_sizes[i] > 0)
- {
- ++nonzero_sizes;
- nonzero_idx = i;
- }
+ ++nonzero_sizes;
for (i = 0; i < nchildren; ++i)
if (new_sizes[i] > min_sizes[i])
\f
int window_select_count;
-EXFUN (Fset_window_fringes, 4);
-EXFUN (Fset_window_scroll_bars, 4);
+INFUN (Fset_window_margins, 3);
+INFUN (Fset_window_fringes, 4);
+INFUN (Fset_window_scroll_bars, 4);
+INFUN (Fset_window_vscroll, 3);
static void
run_funs (Lisp_Object funs)
}
-DEFUN ("set-window-buffer", Fset_window_buffer, Sset_window_buffer, 2, 3, 0,
+DEFUE ("set-window-buffer", Fset_window_buffer, Sset_window_buffer, 2, 3, 0,
doc: /* Make WINDOW display BUFFER-OR-NAME as its contents.
WINDOW defaults to the selected window. BUFFER-OR-NAME must be a buffer
or the name of an existing buffer. Optional third argument KEEP-MARGINS
/* 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,
+DEFUE ("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, make WINDOW's buffer current
and make WINDOW the frame's selected window. Return WINDOW.
BEGV = BEG;
ZV = Z;
SET_PT (BEG);
-#if 0 /* rms: there should be no reason for this. */
- XBUFFER (buf)->prevent_redisplay_optimizations_p = 1;
-#endif
set_buffer_internal (old);
if (!NILP (Vtemp_buffer_show_function))
/* Run temp-buffer-show-hook, with the chosen window selected
and its buffer current. */
-
- if (!NILP (Vrun_hooks)
- && !NILP (Fboundp (Qtemp_buffer_show_hook))
- && !NILP (Fsymbol_value (Qtemp_buffer_show_hook)))
- {
- 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);
+ Frun_hooks (1, &Qtemp_buffer_show_hook);
+ unbind_to (count, Qnil);
+ }
}
}
+
+DEFUN ("internal-temp-output-buffer-show",
+ Ftemp_output_buffer_show, Stemp_output_buffer_show,
+ 1, 1, 0,
+ doc: /* Internal function for `with-output-to-temp-buffer''. */)
+ (Lisp_Object buf)
+{
+ temp_output_buffer_show (buf);
+ return Qnil;
+}
\f
static void
make_dummy_parent (Lisp_Object window)
error ("Window height %d too small (after splitting)", size_int);
if (size_int + window_safe_height > XFASTINT (o->total_lines))
error ("Window height %d too small (after splitting)",
- XFASTINT (o->total_lines) - size_int);
+ (int) (XFASTINT (o->total_lines) - size_int));
if (NILP (o->parent)
|| NILP (XWINDOW (o->parent)->vchild))
{
error ("Window width %d too small (after splitting)", size_int);
if (size_int + window_safe_width > XFASTINT (o->total_cols))
error ("Window width %d too small (after splitting)",
- XFASTINT (o->total_cols) - size_int);
+ (int) (XFASTINT (o->total_cols) - size_int));
if (NILP (o->parent)
|| NILP (XWINDOW (o->parent)->hchild))
{
looking at an image that is taller that the window height. */
while (start_pos == IT_CHARPOS (it)
&& start_pos > BEGV)
- move_it_by_lines (&it, -1, 1);
+ move_it_by_lines (&it, -1);
}
else if (dy > 0)
{
looking at an image that is taller that the window height. */
while (start_pos == IT_CHARPOS (it)
&& start_pos < ZV)
- move_it_by_lines (&it, 1, 1);
+ move_it_by_lines (&it, 1);
}
}
else
- move_it_by_lines (&it, n, 1);
+ move_it_by_lines (&it, n);
/* We failed if we find ZV is already on the screen (scrolling up,
means there's nothing past the end), or if we can't start any
while (it.current_y < this_scroll_margin)
{
int prev = it.current_y;
- move_it_by_lines (&it, 1, 1);
+ move_it_by_lines (&it, 1);
if (prev == it.current_y)
break;
}
partial_p = it.current_y + it.ascent + it.descent > it.last_visible_y;
else
{
- move_it_by_lines (&it, 1, 1);
+ move_it_by_lines (&it, 1);
partial_p = it.current_y > it.last_visible_y;
}
/* The last line was only partially visible, so back up two
lines to make sure we're on a fully visible line. */
{
- move_it_by_lines (&it, -2, 0);
+ move_it_by_lines (&it, -2);
SET_PT_BOTH (IT_CHARPOS (it), IT_BYTEPOS (it));
}
else
}
-DEFUN ("recenter", Frecenter, Srecenter, 0, 1, "P",
+DEFUE ("recenter", Frecenter, Srecenter, 0, 1, "P",
doc: /* Center point in selected window and maybe redisplay frame.
With prefix argument ARG, recenter putting point on screen line ARG
relative to the selected window. If ARG is negative, it counts up from the
start_display (&it, w, pt);
/* Be sure we have the exact height of the full line containing PT. */
- move_it_by_lines (&it, 0, 1);
+ move_it_by_lines (&it, 0);
/* The amount of pixels we have to move back is the window
height minus what's displayed in the line containing PT,
and the lines below. */
it.current_y = 0;
it.vpos = 0;
- move_it_by_lines (&it, nlines, 1);
+ move_it_by_lines (&it, nlines);
if (it.vpos == nlines)
h -= it.current_y;
*/
h += extra_line_spacing;
while (-it.current_y > h)
- move_it_by_lines (&it, 1, 1);
+ move_it_by_lines (&it, 1);
charpos = IT_CHARPOS (it);
bytepos = IT_BYTEPOS (it);
return XWINDOW (SAVED_WINDOW_N (saved_windows, 0)->window)->frame;
}
-DEFUN ("set-window-configuration", Fset_window_configuration,
+DEFUE ("set-window-configuration", Fset_window_configuration,
Sset_window_configuration, 1, 1, 0,
doc: /* Set the configuration of windows and buffers as specified by CONFIGURATION.
CONFIGURATION must be a value previously returned
return i;
}
-DEFUN ("current-window-configuration", Fcurrent_window_configuration,
+DEFUE ("current-window-configuration", Fcurrent_window_configuration,
Scurrent_window_configuration, 0, 1, 0,
doc: /* Return an object representing the current window configuration of FRAME.
If FRAME is nil or omitted, use the selected frame.
return (tem);
}
-DEFUN ("save-window-excursion", Fsave_window_excursion, Ssave_window_excursion,
- 0, UNEVALLED, 0,
- doc: /* Execute BODY, preserving window sizes and contents.
-Return the value of the last form in BODY.
-Restore which buffer appears in which window, where display starts,
-and the value of point and mark for each window.
-Also restore the choice of selected window.
-Also restore which buffer is current.
-Does not restore the value of point in current buffer.
-usage: (save-window-excursion BODY...) */)
- (Lisp_Object args)
-{
- register Lisp_Object val;
- register int count = SPECPDL_INDEX ();
-
- record_unwind_protect (Fset_window_configuration,
- Fcurrent_window_configuration (Qnil));
- val = Fprogn (args);
- return unbind_to (count, val);
-}
-
-
\f
/***********************************************************************
Window Split Tree
Fringes
***********************************************************************/
-DEFUN ("set-window-fringes", Fset_window_fringes, Sset_window_fringes,
+DEFUE ("set-window-fringes", Fset_window_fringes, Sset_window_fringes,
2, 4, 0,
doc: /* Set the fringe widths of window WINDOW.
If WINDOW is nil, set the fringe widths of the currently selected
Scroll bars
***********************************************************************/
-DEFUN ("set-window-scroll-bars", Fset_window_scroll_bars, Sset_window_scroll_bars,
- 2, 4, 0,
+DEFUE ("set-window-scroll-bars", Fset_window_scroll_bars,
+ Sset_window_scroll_bars, 2, 4, 0,
doc: /* Set width and type of scroll bars of window WINDOW.
If window is nil, set scroll bars of the currently selected window.
Second parameter WIDTH specifies the pixel width for the scroll bar;
defsubr (&Sset_window_buffer);
defsubr (&Sselect_window);
defsubr (&Sforce_window_update);
+ defsubr (&Stemp_output_buffer_show);
defsubr (&Ssplit_window);
defsubr (&Senlarge_window);
defsubr (&Sshrink_window);
defsubr (&Swindow_configuration_frame);
defsubr (&Sset_window_configuration);
defsubr (&Scurrent_window_configuration);
- defsubr (&Ssave_window_excursion);
defsubr (&Swindow_tree);
defsubr (&Sset_window_margins);
defsubr (&Swindow_margins);