emacs-diffs
[Top][All Lists]
Advanced

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

[Emacs-diffs] /srv/bzr/emacs/trunk r109681: * src/xdisp.c (handle_invisi


From: Chong Yidong
Subject: [Emacs-diffs] /srv/bzr/emacs/trunk r109681: * src/xdisp.c (handle_invisible_prop): Fix ellipses at overlay string ends.
Date: Mon, 20 Aug 2012 00:19:05 +0800
User-agent: Bazaar (2.5.0)

------------------------------------------------------------
revno: 109681
fixes bug: http://debbugs.gnu.org/3874
committer: Chong Yidong <address@hidden>
branch nick: trunk
timestamp: Mon 2012-08-20 00:19:05 +0800
message:
  * src/xdisp.c (handle_invisible_prop): Fix ellipses at overlay string ends.
  
  * test/redisplay-testsuite.el (test-redisplay): Use switch-to-buffer.
modified:
  src/ChangeLog
  src/xdisp.c
  test/ChangeLog
  test/redisplay-testsuite.el
=== modified file 'src/ChangeLog'
--- a/src/ChangeLog     2012-08-19 10:50:03 +0000
+++ b/src/ChangeLog     2012-08-19 16:19:05 +0000
@@ -1,3 +1,8 @@
+2012-08-19  Chong Yidong  <address@hidden>
+
+       * xdisp.c (handle_invisible_prop): Fix ellipses at overlay string
+       ends (Bug#3874).
+
 2012-08-19  Andreas Schwab  <address@hidden>
 
        * .gdbinit: Use call instead of set when calling a function in the

=== modified file 'src/xdisp.c'
--- a/src/xdisp.c       2012-08-18 07:23:30 +0000
+++ b/src/xdisp.c       2012-08-19 16:19:05 +0000
@@ -4088,35 +4088,33 @@
          /* Record whether we have to display an ellipsis for the
             invisible text.  */
          int display_ellipsis_p = (invis_p == 2);
-         ptrdiff_t endpos;
+         ptrdiff_t len, endpos;
 
          handled = HANDLED_RECOMPUTE_PROPS;
 
          /* Get the position at which the next visible text can be
             found in IT->string, if any.  */
-         XSETINT (limit, SCHARS (it->string));
+         len = SCHARS (it->string);
+         XSETINT (limit, len);
          do
            {
              end_charpos = Fnext_single_property_change (charpos, Qinvisible,
                                                          it->string, limit);
-             if (!NILP (end_charpos))
+             if (INTEGERP (end_charpos))
                {
+                 endpos = XFASTINT (end_charpos);
                  prop = Fget_text_property (end_charpos, Qinvisible, 
it->string);
                  invis_p = TEXT_PROP_MEANS_INVISIBLE (prop);
                  if (invis_p == 2)
                    display_ellipsis_p = 1;
                }
            }
-         while (!NILP (end_charpos) && invis_p);
+         while (invis_p && INTEGERP (end_charpos) && endpos < len);
 
          if (display_ellipsis_p)
-           {
-             it->ellipsis_p = 1;
-             handled = HANDLED_RETURN;
-           }
+           it->ellipsis_p = 1;
 
-         if (INTEGERP (end_charpos)
-             && (endpos = XFASTINT (end_charpos)) < XFASTINT (limit))
+         if (INTEGERP (end_charpos) && endpos < len)
            {
              /* Text at END_CHARPOS is visible.  Move IT there.  */
              struct text_pos old;
@@ -4154,7 +4152,8 @@
              /* The rest of the string is invisible.  If this is an
                 overlay string, proceed with the next overlay string
                 or whatever comes and return a character from there.  */
-             if (it->current.overlay_string_index >= 0)
+             if (it->current.overlay_string_index >= 0
+                 && !display_ellipsis_p)
                {
                  next_overlay_string (it);
                  /* Don't check for overlay strings when we just

=== modified file 'test/ChangeLog'
--- a/test/ChangeLog    2012-08-18 07:23:30 +0000
+++ b/test/ChangeLog    2012-08-19 16:19:05 +0000
@@ -1,3 +1,7 @@
+2012-08-19  Chong Yidong  <address@hidden>
+
+       * redisplay-testsuite.el (test-redisplay): Use switch-to-buffer.
+
 2012-08-18  Chong Yidong  <address@hidden>
 
        * redisplay-testsuite.el (test-redisplay-4): New test (Bug#3874).

=== modified file 'test/redisplay-testsuite.el'
--- a/test/redisplay-testsuite.el       2012-08-18 07:23:30 +0000
+++ b/test/redisplay-testsuite.el       2012-08-19 16:19:05 +0000
@@ -260,7 +260,7 @@
   (let ((buf (get-buffer "*Redisplay Test*")))
     (if buf
        (kill-buffer buf))
-    (pop-to-buffer (get-buffer-create "*Redisplay Test*"))
+    (switch-to-buffer (get-buffer-create "*Redisplay Test*"))
     (erase-buffer)
     (setq buffer-invisibility-spec
          '(test-redisplay--simple-invis


reply via email to

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