#endif
#endif
+extern int allow_deletion_of_last_visible_frame;
+
EXFUN (Fnext_window, 4);
static int window_pixel_width_to_char_width (struct window *w,
/* List of freed window configurations with 1 - 10 windows. */
static Lisp_Object Vwindow_configuration_free_list[10];
+Lisp_Object Qtruncate_partial_width_windows;
+
#define SET_LAST_MODIFIED(w, cache_too) \
do { \
(w)->last_modified[CURRENT_DISP] = Qzero; \
Lisp_Object retval = real_window_internal (mir->frame->root_window,
mir->frame->root_mirror, mir);
if (NILP (retval) && !no_abort)
- abort ();
+ ABORT ();
return retval;
}
update_frame_window_mirror (XFRAME (w->frame));
t = find_window_mirror (w);
if (!t)
- abort ();
+ ABORT ();
if (which == CURRENT_DISP)
return t->current_display_lines;
/* The CMOTION_DISP display lines are global. */
return cmotion_display_lines;
else
- abort ();
+ ABORT ();
return 0; /* shut up compiler */
}
update_frame_window_mirror (XFRAME (w->frame));
t = find_window_mirror (w);
if (!t)
- abort ();
+ ABORT ();
return t->buffer;
}
update_frame_window_mirror (XFRAME (w->frame));
t = find_window_mirror (w);
if (!t)
- abort ();
+ ABORT ();
t->buffer = b;
}
/* If truncate_partial_width_windows is true and the window is not
the full width of the frame it is truncated. */
- if (truncate_partial_width_windows
+ if (!NILP (symbol_value_in_buffer (Qtruncate_partial_width_windows,
+ w->buffer))
&& !(window_is_leftmost (w) && window_is_rightmost (w)))
return 1;
modeline_height = (Dynarr_atp (dla, 0)->ascent +
Dynarr_atp (dla, 0)->descent);
else
- /* This should be an abort except I'm not yet 100%
+ /* This should be an ABORT except I'm not yet 100%
confident that it won't ever get hit (though I
haven't been able to trigger it). It is extremely
unlikely to cause any noticeable problem and even if
Lisp_Object buf = w->buffer;
if (XBUFFER (buf) != XMARKER (w->pointm[CURRENT_DISP])->buffer)
- abort ();
+ ABORT ();
/* FSF disables this check, so I'll do it too. I hope it won't
break things. --ben */
else if (!NILP (w->vchild))
delete_all_subwindows (XWINDOW (w->vchild));
+ /* Warning: mark_window_as_deleted calls window_unmap_subwindows and
+ therefore redisplay, so it requires the mirror structure to be
+ correct. We must dirty the mirror before it is called. */
+ f->mirror_dirty = 1;
+
mark_window_as_deleted (w);
- f->mirror_dirty = 1;
return Qnil;
}
GET_LRU_WINDOW, /* Arg is t for full-width windows only */
DELETE_OTHER_WINDOWS, /* Arg is window not to delete */
DELETE_BUFFER_WINDOWS, /* Arg is buffer */
+ UNDEDICATE_BUFFER, /* Arg is buffer */
GET_LARGEST_WINDOW,
GET_BUFFER_WINDOW_COUNT, /* Arg is buffer */
GET_BUFFER_MRU_WINDOW /* Arg is buffer */
We can't just wait until we hit the first window again,
because it might be deleted. */
- last_window = Fprevious_window (w, mini ? Qt : Qnil, frame_arg, Qt);
+ last_window = Fprevious_window (w, mini ? Qt : Qnil, frame_arg, device);
best_window = Qnil;
for (;;)
/* Given the outstanding quality of the rest of this code,
I feel no shame about putting this piece of shit in. */
if (++lose_lose >= 500)
- return Qnil;
+ {
+ /* Call to ABORT() added by Darryl Okahata (16 Nov. 2001),
+ at Ben's request, to catch any remaining bugs.
+
+ If you find that XEmacs is ABORTing here, and you
+ need to be up and running ASAP, it should be safe to
+ comment out the following ABORT(), as long as you
+ leave the "break;" alone. */
+ ABORT();
+ break; /* <--- KEEP THIS HERE! Do not delete! */
+ }
/* Note that we do not pay attention here to whether
the frame is visible, since Fnext_window skips non-visible frames
break;
}
+ case UNDEDICATE_BUFFER:
+ {
+ if ((XBUFFER (p->buffer) == XBUFFER (obj)))
+ p->dedicated = Qnil;
+ break;
+ }
+
case DELETE_OTHER_WINDOWS:
{
/* Don't delete the last window on a frame; this can
of its own, kill the frame. */
if (EQ (w, FRAME_ROOT_WINDOW (f))
&& !NILP (p->dedicated)
- && other_visible_frames (f))
+ && (allow_deletion_of_last_visible_frame
+ || other_visible_frames (f)))
{
/* Skip the other windows on this frame.
There might be one, the minibuffer! */
}
default:
- abort ();
+ ABORT ();
}
if (EQ (w, last_window))
#endif
+void
+undedicate_windows (Lisp_Object buffer, Lisp_Object frame)
+{
+ window_loop (UNDEDICATE_BUFFER, buffer, 0, frame, 1, Qnil);
+}
+
\f
DEFUN ("get-lru-window", Fget_lru_window, 0, 2, 0, /*
Return the window least recently selected or used for display.
w = window_loop (GET_LRU_WINDOW, Qnil, 0, which_frames, 1, which_devices);
/* At this point we damn well better have found something. */
- if (NILP (w)) abort ();
+ if (NILP (w)) ABORT ();
#endif
return w;
if (!NILP (XWINDOW (window)->dedicated)
&& EQ (window,
FRAME_ROOT_WINDOW (XFRAME (frame)))
- && other_visible_frames (XFRAME (frame)))
+ && (allow_deletion_of_last_visible_frame
+ || other_visible_frames (XFRAME (frame))))
{
delete_frame_internal (XFRAME (frame), 0, 0, 0); /* GC */
}
DEFUN ("split-window", Fsplit_window, 0, 3, "", /*
Split WINDOW, putting SIZE lines in the first of the pair.
WINDOW defaults to the selected one and SIZE to half its size.
-If optional third arg HORFLAG is non-nil, split side by side
-and put SIZE columns in the first of the pair.
+If optional third arg HORFLAG is non-nil, split side by side and put
+SIZE columns in the first of the pair. The newly created window is
+returned.
*/
(window, size, horflag))
{
/* In the new scheme, we are symmetric with respect to separators
so there is no need to do weird things here. */
{
- psize = WINDOW_WIDTH (o) >> 1;
+ psize = (WINDOW_WIDTH (o) + window_divider_width (o)) >> 1;
csize = window_pixel_width_to_char_width (o, psize, 0);
}
else
XFRAME (p->frame)->mirror_dirty = 1;
/* do this last (after the window is completely initialized and
the mirror-dirty flag is set) so that specifier recomputation
- caused as a result of this will work properly and not abort. */
+ caused as a result of this will work properly and not ABORT. */
Fset_window_buffer (new, o->buffer, Qt);
return new;
}
On attempt to scroll past end of buffer, `end-of-buffer' is signaled.
On attempt to scroll past beginning of buffer, `beginning-of-buffer' is
signaled.
+
+The characters that are moved over may be added to the current selection
+\(i.e. active region) if the Shift key is held down, a motion key is used
+to invoke this command, and `shifted-motion-keys-select-region' is t; see
+the documentation for this variable for more details.
*/
(count))
{
On attempt to scroll past end of buffer, `end-of-buffer' is signaled.
On attempt to scroll past beginning of buffer, `beginning-of-buffer' is
signaled.
+
+The characters that are moved over may be added to the current selection
+\(i.e. active region) if the Shift key is held down, a motion key is used
+to invoke this command, and `shifted-motion-keys-select-region' is t; see
+the documentation for this variable for more details.
*/
(count))
{
DEFUN ("scroll-left", Fscroll_left, 0, 1, "_P", /*
Scroll selected window display COUNT columns left.
Default for COUNT is window width minus 2.
+
+The characters that are moved over may be added to the current selection
+\(i.e. active region) if the Shift key is held down, a motion key is used
+to invoke this command, and `shifted-motion-keys-select-region' is t; see
+the documentation for this variable for more details.
*/
(count))
{
DEFUN ("scroll-right", Fscroll_right, 0, 1, "_P", /*
Scroll selected window display COUNT columns right.
Default for COUNT is window width minus 2.
+
+The characters that are moved over may be added to the current selection
+\(i.e. active region) if the Shift key is held down, a motion key is used
+to invoke this command, and `shifted-motion-keys-select-region' is t; see
+the documentation for this variable for more details.
*/
(count))
{
if (FRAME_LIVE_P (f))
{
/* Do this before calling recompute_all_cached_specifiers_in_window()
- so that things like redisplay_redraw_cursor() won't abort due
+ so that things like redisplay_redraw_cursor() won't ABORT due
to no window mirror present. */
f->mirror_dirty = 1;
if (EQ (SAVED_WINDOW_N (config, j)->window, window))
return j;
}
- abort ();
+ ABORT ();
return 0; /* suppress compiler warning */
}
/* Qother in general.c */
#endif
+ DEFSYMBOL (Qtruncate_partial_width_windows);
+
DEFSUBR (Fselected_window);
DEFSUBR (Flast_nonminibuf_window);
DEFSUBR (Fminibuffer_window);
#ifdef HAVE_TTY
fb = Fcons (Fcons (list1 (Qtty), make_int (1)), fb);
#endif
+#ifdef HAVE_GTK
+ fb = Fcons (Fcons (list1 (Qgtk), make_int (3)), fb);
+#endif
#ifdef HAVE_X_WINDOWS
fb = Fcons (Fcons (list1 (Qx), make_int (3)), fb);
#endif
Should not the same value be the fallback under X? - kkm */
fb = Fcons (Fcons (list1 (Qx), make_int (2)), fb);
#endif
+#ifdef HAVE_GTK
+ fb = Fcons (Fcons (list1 (Qgtk), Qzero), fb);
+#endif
#ifdef HAVE_MS_WINDOWS
fb = Fcons (Fcons (list1 (Qmswindows), Qzero), fb);
#endif