]> git.eshelyaron.com Git - emacs.git/commitdiff
(format-deannotate-region): Fixed bug that created
authorRichard M. Stallman <rms@gnu.org>
Thu, 1 Feb 1996 00:19:50 +0000 (00:19 +0000)
committerRichard M. Stallman <rms@gnu.org>
Thu, 1 Feb 1996 00:19:50 +0000 (00:19 +0000)
double marking of multi-annotation text-properties (eg, bold-italic).

lisp/format.el

index 2a66b56846a9cdd5525dc8275455b4832ee4e82f..929be66cdef005d35d62c93e2284968e8a1d3893 100644 (file)
@@ -500,8 +500,21 @@ to write these unknown annotations back into the file."
                                                    (assoc r open-ans))
                                                  ans))
                                    nil ; multiple ans not satisfied
-                                 ;; Yes, use the current property name &
-                                 ;; value.  Set loop variables to nil so loop
+                                 ;; Yes, all set.
+                                 ;; If there are multiple annotations going
+                                 ;; into one text property, adjust the 
+                                 ;; begin points of the other annotations
+                                 ;; so that we don't get double marking.
+                                 (let ((to-reset ans)
+                                       this-one)
+                                   (while to-reset
+                                     (setq this-one
+                                           (assoc (car to-reset) 
+                                                  (cdr open-ans)))
+                                     (if this-one
+                                         (setcdr this-one (list loc)))
+                                     (setq to-reset (cdr to-reset))))
+                                 ;; Set loop variables to nil so loop
                                  ;; will exit.
                                  (setq alist nil aalist nil matched t
                                        ;; pop annotation off stack.