]> code.delx.au - gnu-emacs/blobdiff - src/xdisp.c
(ses-call-printer-return): Doc fix (Nil -> nil).
[gnu-emacs] / src / xdisp.c
index a8da5aa848e8d06f3eeaaefad45e100a5ce2a2e3..8dc34b776c4010a1383c32f5765584a9ea0fffb8 100644 (file)
@@ -1346,7 +1346,8 @@ pos_visible_p (w, charpos, x, y, rtop, rbot, rowh, vpos)
       it2 = it;
       if (IT_CHARPOS (it) < ZV && FETCH_BYTE (IT_BYTEPOS (it)) != '\n')
        move_it_by_lines (&it, 1, 0);
-      if (charpos < IT_CHARPOS (it))
+      if (charpos < IT_CHARPOS (it)
+         || (it.what == IT_EOB && charpos == IT_CHARPOS (it)))
        {
          visible_p = 1;
          move_it_to (&it2, charpos, -1, -1, -1, MOVE_TO_POS);
@@ -2090,8 +2091,9 @@ remember_mouse_glyph (f, gx, gy, rect)
   /* Try to determine frame pixel position and size of the glyph under
      frame pixel coordinates X/Y on frame F.  */
 
-  window = window_from_coordinates (f, gx, gy, &part, &x, &y, 0);
-  if (NILP (window))
+  if (!f->glyphs_initialized_p
+      || (window = window_from_coordinates (f, gx, gy, &part, &x, &y, 0),
+         NILP (window)))
     {
       width = FRAME_SMALLEST_CHAR_WIDTH (f);
       height = FRAME_SMALLEST_FONT_HEIGHT (f);
@@ -16590,6 +16592,9 @@ display_mode_line (w, face_id, format)
   int count = SPECPDL_INDEX ();
 
   init_iterator (&it, w, -1, -1, NULL, face_id);
+  /* Don't extend on a previously drawn mode-line.
+     This may happen if called from pos_visible_p.  */
+  it.glyph_row->enabled_p = 0;
   prepare_desired_row (it.glyph_row);
 
   it.glyph_row->mode_line_p = 1;
@@ -17679,12 +17684,20 @@ decode_mode_spec (w, c, field_width, precision, multibyte)
       break;
 
     case 'c':
-      {
-       int col = (int) current_column (); /* iftc */
-       w->column_number_displayed = make_number (col);
-       pint2str (decode_mode_spec_buf, field_width, col);
-       return decode_mode_spec_buf;
-      }
+      /* %c and %l are ignored in `frame-title-format'.
+         (In redisplay_internal, the frame title is drawn _before_ the
+         windows are updated, so the stuff which depends on actual
+         window contents (such as %l) may fail to render properly, or
+         even crash emacs.)  */
+      if (mode_line_target == MODE_LINE_TITLE)
+       return "";
+      else
+       {
+         int col = (int) current_column (); /* iftc */
+         w->column_number_displayed = make_number (col);
+         pint2str (decode_mode_spec_buf, field_width, col);
+         return decode_mode_spec_buf;
+       }
 
     case 'e':
 #ifndef SYSTEM_MALLOC
@@ -17726,11 +17739,16 @@ decode_mode_spec (w, c, field_width, precision, multibyte)
 
     case 'l':
       {
-       int startpos = XMARKER (w->start)->charpos;
-       int startpos_byte = marker_byte_position (w->start);
-       int line, linepos, linepos_byte, topline;
-       int nlines, junk;
-       int height = WINDOW_TOTAL_LINES (w);
+       int startpos, startpos_byte, line, linepos, linepos_byte;
+       int topline, nlines, junk, height;
+
+       /* %c and %l are ignored in `frame-title-format'.  */
+       if (mode_line_target == MODE_LINE_TITLE)
+         return "";
+
+       startpos = XMARKER (w->start)->charpos;
+       startpos_byte = marker_byte_position (w->start);
+       height = WINDOW_TOTAL_LINES (w);
 
        /* If we decided that this buffer isn't suitable for line numbers,
           don't forget that too fast.  */
@@ -22618,7 +22636,7 @@ note_mouse_highlight (f, x, y)
   struct buffer *b;
 
   /* When a menu is active, don't highlight because this looks odd.  */
-#if defined (USE_X_TOOLKIT) || defined (USE_GTK) || defined (HAVE_NTGUI)
+#if defined (USE_X_TOOLKIT) || defined (USE_GTK)
   if (popup_activated ())
     return;
 #endif
@@ -23985,9 +24003,10 @@ This variable is not guaranteed to be accurate except while processing
   DEFVAR_LISP ("frame-title-format", &Vframe_title_format,
     doc: /* Template for displaying the title bar of visible frames.
 \(Assuming the window manager supports this feature.)
-This variable has the same structure as `mode-line-format' (which see),
-and is used only on frames for which no explicit name has been set
-\(see `modify-frame-parameters').  */);
+
+This variable has the same structure as `mode-line-format', except that
+the %c and %l constructs are ignored.  It is used only on frames for
+which no explicit name has been set \(see `modify-frame-parameters').  */);
 
   DEFVAR_LISP ("icon-title-format", &Vicon_title_format,
     doc: /* Template for displaying the title bar of an iconified frame.