]> code.delx.au - gnu-emacs/blobdiff - src/xdisp.c
automatically generated from GPLed version
[gnu-emacs] / src / xdisp.c
index cb45b92b3e596ab0ec69593394450e39dbd2489c..d7c0bfe34bc3f9cb4da56167ea6afad7d11f3e40 100644 (file)
@@ -1,5 +1,6 @@
 /* Display generation from window structure and buffer text.
-   Copyright (C) 1985, 86, 87, 88, 93, 94, 95 Free Software Foundation, Inc.
+   Copyright (C) 1985, 86, 87, 88, 93, 94, 95, 1997
+     Free Software Foundation, Inc.
 
 This file is part of GNU Emacs.
 
@@ -417,7 +418,8 @@ message2_nolog (m, len)
       if (noninteractive_need_newline)
        putc ('\n', stderr);
       noninteractive_need_newline = 0;
-      fwrite (m, len, 1, stderr);
+      if (m)
+       fwrite (m, len, 1, stderr);
       if (cursor_in_echo_area == 0)
        fprintf (stderr, "\n");
       fflush (stderr);
@@ -628,7 +630,8 @@ echo_area_display ()
                      echo_area_glyphs ? echo_area_glyphs : "",
                      echo_area_glyphs ? echo_area_glyphs_length : -1,
                      FRAME_LEFT_SCROLL_BAR_WIDTH (f),
-                     0, 0, 0, FRAME_WIDTH (f));
+                     0, 0, 0,
+                     FRAME_WIDTH (f) + FRAME_LEFT_SCROLL_BAR_WIDTH (f));
 
 #if 0 /* This just gets in the way.  update_frame does the job.  */
       /* If desired cursor location is on this line, put it at end of text */
@@ -646,10 +649,13 @@ echo_area_display ()
             i < vpos + XFASTINT (XWINDOW (mini_window)->height); i++)
          {
            get_display_line (f, i, 0);
+           /* We don't use FRAME_SCROLL_BAR_WIDTH (f) as the starting
+              hpos, because it is good to clear whatever is behind the
+              scroll bar.  This does not affect the scroll bar itself.  */
            display_string (XWINDOW (mini_window), i,
                            "", 0, 
-                            FRAME_LEFT_SCROLL_BAR_WIDTH (f),
-                           0, 0, 0, FRAME_WIDTH (f));
+                            0, 0, 0,
+                            0, FRAME_WIDTH (f) + FRAME_SCROLL_BAR_WIDTH (f));
          }
       }
     }
@@ -874,6 +880,8 @@ redisplay_internal (preserve_echo_area)
     return;
 #endif
 
+ retry:
+
   if (! FRAME_WINDOW_P (selected_frame)
       && previous_terminal_frame != selected_frame)
     {
@@ -889,14 +897,12 @@ redisplay_internal (preserve_echo_area)
      Do this before checking for resized or garbaged frames; they want
      to know if their frames are visible.
      See the comment in frame.h for FRAME_SAMPLE_VISIBILITY.  */
-  number_of_frames_redisplayed = 0;
   {
     Lisp_Object tail, frame;
 
     FOR_EACH_FRAME (tail, frame)
       {
        FRAME_SAMPLE_VISIBILITY (XFRAME (frame));
-       number_of_frames_redisplayed++;
 
        /* Clear out all the display lines in which we will generate the
           glyphs to display.  */
@@ -965,6 +971,9 @@ redisplay_internal (preserve_echo_area)
                  Fmarker_position (XBUFFER (w->buffer)->mark))))
     this_line_bufpos = -1;
 
+  /* This is in case we goto update, below.  */
+  number_of_frames_redisplayed = 1;
+
   tlbufpos = this_line_bufpos;
   tlendpos = this_line_endpos;
   if (!all_windows && tlbufpos > 0 && NILP (w->update_mode_line)
@@ -1139,6 +1148,7 @@ redisplay_internal (preserve_echo_area)
       /* Recompute # windows showing selected buffer.
         This will be incremented each time such a window is displayed.  */
       buffer_shared = 0;
+      number_of_frames_redisplayed = 0;
 
       FOR_EACH_FRAME (tail, frame)
        {
@@ -1152,7 +1162,10 @@ redisplay_internal (preserve_echo_area)
                (*condemn_scroll_bars_hook) (f);
 
              if (FRAME_VISIBLE_P (f))
-               redisplay_windows (FRAME_ROOT_WINDOW (f), preserve_echo_area);
+               {
+                 redisplay_windows (FRAME_ROOT_WINDOW (f), preserve_echo_area);
+                 number_of_frames_redisplayed++;
+               }
 
              /* Any scroll bars which redisplay_windows should have nuked
                 should now go away.  */
@@ -1166,6 +1179,7 @@ redisplay_internal (preserve_echo_area)
       redisplay_window (selected_window, 1, preserve_echo_area);
       if (!WINDOW_FULL_WIDTH_P (w))
        preserve_other_columns (w);
+      number_of_frames_redisplayed = 1;
     }
 
 update: 
@@ -1334,10 +1348,10 @@ update:
   /* Change frame size now if a change is pending.  */
   do_pending_window_change ();
 
-  /* If we just did a pending size change, redisplay again
-     for the new size.  */
+  /* If we just did a pending size change, or have additional
+     visible frames, redisplay again.  */
   if (windows_or_buffers_changed && !pause)
-    redisplay ();
+    goto retry;
 }
 
 /* Redisplay, but leave alone any recent echo area message
@@ -2979,7 +2993,7 @@ display_text_line (w, start, vpos, hpos, taboffset, ovstr_done)
   next_boundary = pos;
   p1prev = p1;
   prevpos = pos;
-  while (1)
+  while (p1 < endp)
     {
       if (pos >= pause)
        {
@@ -4057,7 +4071,8 @@ decode_mode_spec_coding (coding_system, buf, eol_flag)
   if (NILP (val))              /* Not yet decided.  */
     {
       *buf++ = '-';
-      *buf++ = eol_mnemonic_undecided;
+      if (eol_flag)
+       *buf++ = eol_mnemonic_undecided;
       /* Don't mention EOL conversion if it isn't decided.  */
     }
   else
@@ -4426,10 +4441,8 @@ decode_mode_spec (w, c, spec_width, maxwidth)
       /* coding-system (including end-of-line type) */
       {
        int eol_flag = (c == 'Z');
-       char *p;
+       char *p = decode_mode_spec_buf;
 
-       p = decode_mode_spec_coding (b->buffer_file_coding_system,
-                                    decode_mode_spec_buf, eol_flag);
        if (FRAME_TERMCAP_P (f))
          {
            /* No need to mention EOL here--the terminal never needs
@@ -4437,6 +4450,9 @@ decode_mode_spec (w, c, spec_width, maxwidth)
            p = decode_mode_spec_coding (keyboard_coding.symbol, p, 0);
            p = decode_mode_spec_coding (terminal_coding.symbol, p, 0);
          }
+       p = decode_mode_spec_coding (b->buffer_file_coding_system,
+                                    p, eol_flag);
+
 #if 0 /* This proves to be annoying; I think we can do without.  -- rms.  */
 #ifdef subprocesses
        obj = Fget_buffer_process (Fcurrent_buffer ());