emacs-diffs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Emacs-diffs] Changes to emacs/src/xdisp.c,v


From: Chong Yidong
Subject: [Emacs-diffs] Changes to emacs/src/xdisp.c,v
Date: Fri, 24 Oct 2008 19:00:44 +0000

CVSROOT:        /sources/emacs
Module name:    emacs
Changes by:     Chong Yidong <cyd>      08/10/24 19:00:44

Index: xdisp.c
===================================================================
RCS file: /sources/emacs/emacs/src/xdisp.c,v
retrieving revision 1.1263
retrieving revision 1.1264
diff -u -b -r1.1263 -r1.1264
--- xdisp.c     23 Oct 2008 10:33:07 -0000      1.1263
+++ xdisp.c     24 Oct 2008 19:00:42 -0000      1.1264
@@ -2999,25 +2999,6 @@
       it->method = GET_FROM_STRING;
     }
 
-#if 0 /* This is bogus because POS not having an overlay string
-        position does not mean it's after the string.  Example: A
-        line starting with a before-string and initialization of IT
-        to the previous row's end position.  */
-  else if (it->current.overlay_string_index >= 0)
-    {
-      /* If POS says we're already after an overlay string ending at
-        POS, make sure to pop the iterator because it will be in
-        front of that overlay string.  When POS is ZV, we've thereby
-        also ``processed'' overlay strings at ZV.  */
-      while (it->sp)
-       pop_it (it);
-      xassert (it->current.overlay_string_index == -1);
-      xassert (it->method == GET_FROM_BUFFER);
-      if (CHARPOS (pos->pos) == ZV)
-       it->overlay_strings_at_end_processed_p = 1;
-    }
-#endif /* 0 */
-
   if (CHARPOS (pos->string_pos) >= 0)
     {
       /* Recorded position is not in an overlay string, but in another
@@ -3133,11 +3114,23 @@
                {
                  if (it->ellipsis_p)
                    setup_for_ellipsis (it, 0);
+                 /* When handling a display spec, we might load an
+                    empty string.  In that case, discard it here.  We
+                    used to discard it in handle_single_display_spec,
+                    but that causes get_overlay_strings_1, above, to
+                    ignore overlay strings that we must check.  */
+                 if (STRINGP (it->string) && !SCHARS (it->string))
+                   pop_it (it);
                  return;
                }
+             else if (STRINGP (it->string) && !SCHARS (it->string))
+               pop_it (it);
+             else
+               {
              it->ignore_overlay_strings_at_pos_p = 1;
              it->string_from_display_prop_p = 0;
              handle_overlay_change_p = 0;
+               }
              handled = HANDLED_RECOMPUTE_PROPS;
              break;
            }
@@ -4002,11 +3995,8 @@
     }
   else
     {
-      int ret = handle_single_display_spec (it, prop, object, overlay,
-                                           position, 0);
-      if (ret < 0)  /* Replaced by "", i.e. nothing. */
-       return HANDLED_RECOMPUTE_PROPS;
-      if (ret)
+      if (handle_single_display_spec (it, prop, object, overlay,
+                                     position, 0))
        display_replaced_p = 1;
     }
 
@@ -4053,8 +4043,7 @@
    property ends.
 
    Value is non-zero if something was found which replaces the display
-   of buffer or string text.  Specifically, the value is -1 if that
-   "something" is "nothing". */
+   of buffer or string text.  */
 
 static int
 handle_single_display_spec (it, spec, object, overlay, position,
@@ -4379,11 +4368,6 @@
 
       if (STRINGP (value))
        {
-         if (SCHARS (value) == 0)
-           {
-             pop_it (it);
-             return -1;  /* Replaced by "", i.e. nothing.  */
-           }
          it->string = value;
          it->multibyte_p = STRING_MULTIBYTE (it->string);
          it->current.overlay_string_index = -1;
@@ -5032,6 +5016,10 @@
       /* Save IT's settings.  They are restored after all overlay
         strings have been processed.  */
       xassert (!compute_stop_p || it->sp == 0);
+
+      /* When called from handle_stop, there might be an empty display
+         string loaded.  In that case, don't bother saving it.  */
+      if (!STRINGP (it->string) || SCHARS (it->string))
       push_it (it);
 
       /* Set up IT to deliver display elements from the first overlay




reply via email to

[Prev in Thread] Current Thread [Next in Thread]