changeset 19915:0ee6d171e8af

When redisplaying the echo area, use the value of enable-multibyte-characters from when message was called. (message_enable_multibyte): New variable. (message2_nolog): Set the variable. (echo_area_display): Use that variable. (display_string): New arg MULTIBYTE. Callers changed. (display_menu_bar): Include WINDOW_LEFT_MARGIN in maxendcol.
author Richard M. Stallman <rms@gnu.org>
date Sat, 13 Sep 1997 08:42:12 +0000
parents 8a303d8628b6
children f43513081277
files src/xdisp.c
diffstat 1 files changed, 34 insertions(+), 16 deletions(-) [+]
line wrap: on
line diff
--- a/src/xdisp.c	Sat Sep 13 08:19:54 1997 +0000
+++ b/src/xdisp.c	Sat Sep 13 08:42:12 1997 +0000
@@ -213,6 +213,10 @@
    same window currently active as a minibuffer.  */
 Lisp_Object echo_area_window;
 
+/* Nonzero means multibyte characters were enabled when the echo area
+   message was specified.  */
+int message_enable_multibyte;
+
 /* true iff we should redraw the mode lines on the next redisplay */
 int update_mode_lines;
 
@@ -418,6 +422,9 @@
      char *m;
      int len;
 {
+  message_enable_multibyte
+    = ! NILP (current_buffer->enable_multibyte_characters);
+
   if (noninteractive)
     {
       if (noninteractive_need_newline)
@@ -636,7 +643,8 @@
 		      echo_area_glyphs ? echo_area_glyphs_length : -1,
 		      FRAME_LEFT_SCROLL_BAR_WIDTH (f),
 		      0, 0, 0,
-		      FRAME_WIDTH (f) + FRAME_LEFT_SCROLL_BAR_WIDTH (f));
+		      FRAME_WIDTH (f) + FRAME_LEFT_SCROLL_BAR_WIDTH (f),
+		      message_enable_multibyte);
 
 #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 */
@@ -660,7 +668,8 @@
 	    display_string (XWINDOW (mini_window), i,
 			    "", 0, 
                             0, 0, 0,
-                            0, FRAME_WIDTH (f) + FRAME_SCROLL_BAR_WIDTH (f));
+                            0, FRAME_WIDTH (f) + FRAME_SCROLL_BAR_WIDTH (f),
+			    0);
 	  }
       }
     }
@@ -1630,7 +1639,7 @@
 	      get_display_line (f, vpos + i, 0);
 	      display_string (w, vpos + i, "", 0, 
 			      FRAME_LEFT_SCROLL_BAR_WIDTH (f),
-			      0, 1, 0, width);
+			      0, 1, 0, width, 0);
 	    }
 	  
 	  goto finish_scroll_bars;
@@ -2979,7 +2988,8 @@
 				  margin, so user input can at least start
 				  on the first line.  */
 			       (XFASTINT (w->width) > 10
-				? XFASTINT (w->width) - 4 : -1))
+				? XFASTINT (w->width) - 4 : -1),
+			       -1)
 	       - hpos - WINDOW_LEFT_MARGIN (w));
 	  hpos += minibuf_prompt_width;
 	  taboffset -= minibuf_prompt_width - old_width;
@@ -3750,7 +3760,7 @@
   Lisp_Object items, tail;
   register int vpos = 0;
   register FRAME_PTR f = XFRAME (WINDOW_FRAME (w));
-  int maxendcol = FRAME_WIDTH (f);
+  int maxendcol = FRAME_WIDTH (f) + WINDOW_LEFT_MARGIN (w);
   int hpos = 0;
   int i;
 
@@ -3780,13 +3790,13 @@
 	hpos = display_string (w, vpos,
 			       XSTRING (string)->data,
 			       XSTRING (string)->size,
-			       hpos, 0, 0, hpos, maxendcol);
+			       hpos, 0, 0, hpos, maxendcol, -1);
       /* Put a space between items.  */
       if (hpos < maxendcol)
 	{
 	  int hpos1 = hpos + 1;
 	  hpos = display_string (w, vpos, "", 0, hpos, 0, 0,
-				 min (hpos1, maxendcol), maxendcol);
+				 min (hpos1, maxendcol), maxendcol, 0);
 	}
     }
 
@@ -3795,7 +3805,7 @@
 
   /* Fill out the line with spaces.  */
   if (maxendcol > hpos)
-    hpos = display_string (w, vpos, "", 0, hpos, 0, 0, maxendcol, maxendcol);
+    hpos = display_string (w, vpos, "", 0, hpos, 0, 0, maxendcol, maxendcol, 0);
 
   /* Clear the rest of the lines allocated to the menu bar.  */
   vpos++;
@@ -3920,7 +3930,7 @@
 		  hpos = store_frame_title (last, hpos, min (lim, maxendcol));
 		else
 		  hpos = display_string (w, vpos, last, -1, hpos, 0, 1,
-					 hpos, min (lim, maxendcol));
+					 hpos, min (lim, maxendcol), -1);
 	      }
 	    else /* c == '%' */
 	      {
@@ -3957,7 +3967,7 @@
 		    else
 		      hpos = display_string (w, vpos, spec, -1,
 					     hpos, 0, 1,
-					     minendcol, maxendcol);
+					     minendcol, maxendcol, -1);
 		  }
 	      }
 	  }
@@ -3985,7 +3995,7 @@
 		else
 		  hpos = display_string (w, vpos, XSTRING (tem)->data,
 					 XSTRING (tem)->size,
-					 hpos, 0, 1, minendcol, maxendcol);
+					 hpos, 0, 1, minendcol, maxendcol, -1);
 	      }
 	    /* Give up right away for nil or t.  */
 	    else if (!EQ (tem, elt))
@@ -4079,7 +4089,7 @@
 	hpos = store_frame_title ("*invalid*", minendcol, maxendcol);
       else
 	hpos = display_string (w, vpos, "*invalid*", -1, hpos, 0, 1,
-			       minendcol, maxendcol);
+			       minendcol, maxendcol, 0);
       return hpos;
     }
 
@@ -4087,7 +4097,8 @@
     if (frame_title_ptr)
       hpos = store_frame_title ("", minendcol, maxendcol);
     else
-      hpos = display_string (w, vpos, "", 0, hpos, 0, 1, minendcol, maxendcol);
+      hpos = display_string (w, vpos, "", 0, hpos,
+			     0, 1, minendcol, maxendcol, 0);
   return hpos;
 }
 
@@ -4697,11 +4708,15 @@
   and not display anything beyond there.  Otherwise, only MAXCOL
   controls where to stop output.
 
+  MULTIBYTE can be 0 meaning do not display multibyte chars,
+  1 meaning do display them, or -1 meaning obey the current buffer's
+  value of enable_multibyte_characters.
+
   Returns ending hpos.  */
 
 static int
 display_string (w, vpos, string, length, hpos, truncate,
-		obey_window_width, mincol, maxcol)
+		obey_window_width, mincol, maxcol, multibyte)
      struct window *w;
      unsigned char *string;
      int length;
@@ -4709,6 +4724,7 @@
      GLYPH truncate;
      int obey_window_width;
      int mincol, maxcol;
+     int multibyte;
 {
   register int c;
   int truncated;
@@ -4721,14 +4737,16 @@
   struct frame_glyphs *desired_glyphs = FRAME_DESIRED_GLYPHS (f);
   GLYPH *p1start = desired_glyphs->glyphs[vpos] + hpos;
   int window_width = XFASTINT (w->width);
-  /* If 1, we must display multibyte characters.  */
-  int multibyte = !NILP (current_buffer->enable_multibyte_characters);
 
   /* Use the standard display table, not the window's display table.
      We don't want the mode line in rot13.  */
   register struct Lisp_Char_Table *dp = 0;
   int i;
 
+  if (multibyte == -1)
+    multibyte = !NILP (current_buffer->enable_multibyte_characters);
+  /* Now multibyte is 1 if we should display multibyte characters.  */
+
   if (DISP_TABLE_P (Vstandard_display_table))
     dp = XCHAR_TABLE (Vstandard_display_table);