diff src/xdisp.c @ 90614:8dd8c8286063

Merge from emacs--devo--0 Patches applied: * emacs--devo--0 (patch 460-475) - Update from CVS - Merge from gnus--rel--5.10 * gnus--rel--5.10 (patch 145-152) - Merge from emacs--devo--0 - Update from CVS Revision: emacs@sv.gnu.org/emacs--unicode--0--patch-118
author Miles Bader <miles@gnu.org>
date Sun, 15 Oct 2006 02:54:13 +0000
parents bb0e318b7c53 1504e6546638
children 93ead736a6ac
line wrap: on
line diff
--- a/src/xdisp.c	Thu Oct 05 12:20:23 2006 +0000
+++ b/src/xdisp.c	Sun Oct 15 02:54:13 2006 +0000
@@ -1355,7 +1355,8 @@
       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);
@@ -17823,12 +17824,20 @@
       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
@@ -17870,11 +17879,16 @@
 
     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.  */
@@ -24319,9 +24333,10 @@
   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.