XEmacs 21.4.6 "Common Lisp".
[chise/xemacs-chise.git.1] / src / window.c
index 8d78ae8..7df253c 100644 (file)
@@ -123,6 +123,8 @@ Fixnum next_screen_context_lines;
 /* 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;    \
@@ -724,7 +726,8 @@ window_truncation_on (struct window *w)
 
   /* 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;
 
@@ -2534,6 +2537,7 @@ enum window_loop
   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 */
@@ -2613,7 +2617,7 @@ window_loop (enum window_loop type,
         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 (;;)
@@ -2628,7 +2632,17 @@ window_loop (enum window_loop type,
          /* 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
@@ -2686,6 +2700,13 @@ window_loop (enum window_loop type,
                  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
@@ -2812,6 +2833,12 @@ buffer_window_mru (struct window *w)
 
 #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.
@@ -6083,6 +6110,8 @@ syms_of_window (void)
   /* Qother in general.c */
 #endif
 
+  DEFSYMBOL (Qtruncate_partial_width_windows);
+  
   DEFSUBR (Fselected_window);
   DEFSUBR (Flast_nonminibuf_window);
   DEFSUBR (Fminibuffer_window);