]> git.eshelyaron.com Git - emacs.git/commitdiff
(remove-yank-excluded-properties): Fix bugs in handling of category properties.
authorRichard M. Stallman <rms@gnu.org>
Sun, 29 Sep 2002 03:31:15 +0000 (03:31 +0000)
committerRichard M. Stallman <rms@gnu.org>
Sun, 29 Sep 2002 03:31:15 +0000 (03:31 +0000)
lisp/subr.el

index 523cc209ff4abe8ac0b60004ac28d44ca4bee806..8c7212e5ef19579fcf6a31f02eb735d914571e27 100644 (file)
@@ -1431,19 +1431,21 @@ Replaces `category' properties with their defined properties."
        (while (< (point) end)
          (let ((cat (get-text-property (point) 'category))
                run-end)
-           (when cat
-             (setq run-end
-                   (next-single-property-change (point) 'category nil end))
-             (remove-list-of-text-properties (point) run-end '(category))
-             (add-text-properties (point) run-end (symbol-plist cat))
-             (goto-char (or run-end end)))
            (setq run-end
                  (next-single-property-change (point) 'category nil end))
-           (goto-char (or run-end end))))))
+           (when cat
+             (let (run-end2 original)
+               (remove-list-of-text-properties (point) run-end '(category))
+               (while (< (point) run-end)
+                 (setq run-end2 (next-property-change (point) nil run-end))
+                 (setq original (text-properties-at (point)))
+                 (set-text-properties (point) run-end2 (symbol-plist cat))
+                 (add-text-properties (point) run-end2 original)
+                 (goto-char run-end2))))
+           (goto-char run-end)))))
     (if (eq yank-excluded-properties t)
        (set-text-properties start end nil)
-      (remove-list-of-text-properties start end
-                                     yank-excluded-properties))))
+      (remove-list-of-text-properties start end yank-excluded-properties))))
 
 (defun insert-for-yank (&rest strings)
   "Insert STRINGS at point, stripping some text properties.