Mercurial > emacs
changeset 47675:cb548fe4bcdb
(remove-yank-excluded-properties): Fix bugs in handling of category properties.
author | Richard M. Stallman <rms@gnu.org> |
---|---|
date | Sun, 29 Sep 2002 03:31:15 +0000 |
parents | 330113e9df2b |
children | fadbf61035e1 |
files | lisp/subr.el |
diffstat | 1 files changed, 11 insertions(+), 9 deletions(-) [+] |
line wrap: on
line diff
--- a/lisp/subr.el Sun Sep 29 03:30:41 2002 +0000 +++ b/lisp/subr.el Sun Sep 29 03:31:15 2002 +0000 @@ -1431,19 +1431,21 @@ (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.