emacs-diffs
[Top][All Lists]
Advanced

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

[Emacs-diffs] master 0644e6f: Fix copying properties in 'format' when it


From: Eli Zaretskii
Subject: [Emacs-diffs] master 0644e6f: Fix copying properties in 'format' when it produces padding
Date: Tue, 28 Jun 2016 16:05:23 +0000 (UTC)

branch: master
commit 0644e6f56d2be82dd716478eb65e7b3c761d813d
Author: Eli Zaretskii <address@hidden>
Commit: Eli Zaretskii <address@hidden>

    Fix copying properties in 'format' when it produces padding
    
    * src/textprop.c (extend_property_ranges): Correct range extension
    when the new end is beyond the old end.  (Bug#23859)
---
 src/textprop.c |   11 ++++++++---
 1 file changed, 8 insertions(+), 3 deletions(-)

diff --git a/src/textprop.c b/src/textprop.c
index c4e49d9..aabd567 100644
--- a/src/textprop.c
+++ b/src/textprop.c
@@ -2065,9 +2065,14 @@ extend_property_ranges (Lisp_Object list, Lisp_Object 
new_end)
          else
            XSETCDR (prev, XCDR (list));
        }
-      else if (XINT (end) > max)
-       /* The end-point is past the end of the new string.  */
-       XSETCAR (XCDR (item), new_end);
+      else if (XINT (end) != max)
+       {
+         /* Either the end-point is past the end of the new string,
+            and we need to discard the properties past the new end,
+            or the caller is extending the property range, and we
+            should update the end-point to reflect that.  */
+         XSETCAR (XCDR (item), new_end);
+       }
     }
 
   return head;



reply via email to

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