]> code.delx.au - gnu-emacs/commitdiff
(Fformat): Handle format strings with multiple text
authorKim F. Storm <storm@cua.dk>
Sun, 12 Sep 2004 21:35:14 +0000 (21:35 +0000)
committerKim F. Storm <storm@cua.dk>
Sun, 12 Sep 2004 21:35:14 +0000 (21:35 +0000)
properties.  Reverse text property list from the format string,
so the positions are in increasing order.

src/editfns.c

index 88a0e63118ff13c789b5868d31cc08e5747e039a..51f8a71d531fd5de0890896620c05cce17e87b8b 100644 (file)
@@ -3668,11 +3668,13 @@ usage: (format STRING &rest OBJECTS)  */)
 
          /* Adjust the bounds of each text property
             to the proper start and end in the output string.  */
-         /* We take advantage of the fact that the positions in PROPS
-            are in increasing order, so that we can do (effectively)
-            one scan through the position space of the format string.
 
-            BYTEPOS is the byte position in the format string,
+         /* Put the positions in PROPS in increasing order, so that
+            we can do (effectively) one scan through the position
+            space of the format string.  */
+         props = Fnreverse (props);
+
+         /* BYTEPOS is the byte position in the format string,
             POSITION is the untranslated char position in it,
             TRANSLATED is the translated char position in BUF,
             and ARGN is the number of the next arg we will come to.  */