/* Window creation, deletion and examination for GNU Emacs.
Does not include redisplay.
- Copyright (C) 1985, 1986, 1987, 1992, 1993 Free Software Foundation, Inc.
+ Copyright (C) 1985, 1986, 1987, 1993 Free Software Foundation, Inc.
This file is part of GNU Emacs.
/* Non-nil means this is the buffer whose window C-M-v should scroll. */
Lisp_Object Vother_window_scroll_buffer;
-/* Last mouse click data structure (nil if no mouse support). */
-Lisp_Object Vmouse_event;
-
/* Non-nil means it's function to call to display temp buffers. */
Lisp_Object Vtemp_buffer_show_function;
DEFUN ("window-dedicated-p", Fwindow_dedicated_p, Swindow_dedicated_p,
1, 1, 0,
"Return WINDOW's dedicated object, usually t or nil.\n\
-See also `set-window-buffer-dedicated'.")
+See also `set-window-dedicated-p'.")
(window)
Lisp_Object window;
{
/* Are we trying to delete any frame's selected window? */
{
- Lisp_Object frame = WINDOW_FRAME (XWINDOW (window));
+ FRAME_PTR frame = WINDOW_FRAME (XWINDOW (window));
- if (EQ (window, FRAME_SELECTED_WINDOW (XFRAME (frame))))
+ if (EQ (window, FRAME_SELECTED_WINDOW (frame)))
{
Lisp_Object alternative = Fnext_window (window, Qlambda, Qnil);
if (EQ (window, selected_window))
Fselect_window (alternative);
else
- FRAME_SELECTED_WINDOW (XFRAME (frame)) = alternative;
+ FRAME_SELECTED_WINDOW (frame) = alternative;
}
}
: Qnil);
else if (! EQ (all_frames, Qt))
all_frames = Qnil;
+ /* Now all_frames is t meaning search all frames,
+ nil meaning search just current frame,
+ or a window, meaning search the frame that window belongs to. */
/* Do this loop at least once, to get the next window, and perhaps
again, if we hit the minibuffer and that is not acceptable. */
: Qnil);
else if (! EQ (all_frames, Qt))
all_frames = Qnil;
+ /* Now all_frames is t meaning search all frames,
+ nil meaning search just current frame,
+ or a window, meaning search the frame that window belongs to. */
/* Do this loop at least once, to get the previous window, and perhaps
again, if we hit the minibuffer and that is not acceptable. */
met. */
tem = prev_frame (tem, all_frames);
#endif
- tem = FRAME_ROOT_WINDOW (XFRAME (tem));
+ /* If this frame has a minibuffer, find that window first,
+ because it is conceptually the last window in that frame. */
+ if (FRAME_HAS_MINIBUF_P (XFRAME (tem)))
+ tem = FRAME_MINIBUF_WINDOW (XFRAME (tem));
+ else
+ tem = FRAME_ROOT_WINDOW (XFRAME (tem));
break;
}
case GET_LRU_WINDOW:
/* t as arg means consider only full-width windows */
if (!NILP (obj) && XFASTINT (XWINDOW (w)->width)
- != FRAME_WIDTH (frame))
+ != FRAME_WIDTH (XFRAME (WINDOW_FRAME (XWINDOW (w)))))
break;
#if 0
/* Ignore invisible and iconified frames. */
make_number (XBUFFER (buffer)->last_window_start),
buffer);
w->start_at_line_beg = Qnil;
+ w->force_start = Qnil;
XFASTINT (w->last_modified) = 0;
windows_or_buffers_changed++;
if (EQ (window, selected_window))
}
DEFUN ("display-buffer", Fdisplay_buffer, Sdisplay_buffer, 1, 2,
- "BDisplay buffer:\nP",
+ "BDisplay buffer: \nP",
"Make BUFFER appear in some window but don't select it.\n\
BUFFER can be a buffer or a buffer name.\n\
If BUFFER is shown already in some window, just use that one,\n\
return Qnil;
}
\f
-DEFUN ("scroll-left", Fscroll_left, Sscroll_left, 1, 1, "P",
+DEFUN ("scroll-left", Fscroll_left, Sscroll_left, 0, 1, "P",
"Scroll selected window display ARG columns left.\n\
Default for ARG is window width minus 2.")
(arg)
+ XINT (arg)));
}
-DEFUN ("scroll-right", Fscroll_right, Sscroll_right, 1, 1, "P",
+DEFUN ("scroll-right", Fscroll_right, Sscroll_right, 0, 1, "P",
"Scroll selected window display ARG columns right.\n\
Default for ARG is window width minus 2.")
(arg)
XBUFFER (p->buffer) == current_buffer)
Fgoto_char (w->pointm);
}
- else if (NILP (XBUFFER (w->buffer)->name))
- /* Else if window's old buffer is dead too, get a live one. */
+ else if (NILP (w->buffer) || NILP (XBUFFER (w->buffer)->name))
+ /* Else unless window has a live buffer, get one. */
{
w->buffer = Fcdr (Fcar (Vbuffer_alist));
/* This will set the markers to beginning of visible
}
else
/* Keeping window's old buffer; make sure the markers
- are real. Else if window's old buffer is dead too,
- get a live one. */
+ are real. */
{
/* Set window markers at start of visible range. */
if (XMARKER (w->start)->buffer == 0)
work using this function.");
Vdisplay_buffer_function = Qnil;
- DEFVAR_LISP ("mouse-event", &Vmouse_event,
- "The last mouse-event object. A list of four elements:\n\
- ((X-POS Y-POS) WINDOW FRAME-PART KEYSEQ).\n\
-KEYSEQ is a string, the key sequence to be looked up in the mouse maps.\n\
-WINDOW is the window that the click applies do.\n\
-If FRAME-PART is non-nil, the event was on a scroll bar;\n\
-then Y-POS is really the total length of the scroll bar, while X-POS is\n\
-the relative position of the scroll bar's value within that total length.\n\
-FRAME-PART is one of the following symbols:\n\
- `vertical-scroll-bar', `vertical-slider',\n\
- `vertical-thumbup', `vertical-thumbdown',\n\
- `horizontal-scroll-bar', `horizontal-slider',\n\
- `horizontal-thumbleft', `horizontal-thumbright'");
- Vmouse_event = Qnil;
-
DEFVAR_LISP ("minibuffer-scroll-window", &Vminibuf_scroll_window,
"Non-nil means it is the window that C-M-v in minibuffer should scroll.");
Vminibuf_scroll_window = Qnil;
"If non-nil, this is a buffer and \\[scroll-other-window] should scroll its window.");
Vother_window_scroll_buffer = Qnil;
-#ifdef MULTI_FRAME
DEFVAR_BOOL ("pop-up-frames", &pop_up_frames,
"*Non-nil means `display-buffer' should make a separate frame.");
pop_up_frames = 0;
A typical value might be `(lambda () (new-frame pop-up-frame-alist))'\n\
where `pop-up-frame-alist' would hold the default frame parameters.");
Vpop_up_frame_function = Qnil;
-#endif
DEFVAR_BOOL ("pop-up-windows", &pop_up_windows,
"*Non-nil means display-buffer should make new windows.");