# HG changeset patch # User Richard M. Stallman # Date 1019936920 0 # Node ID e4975d9c93ff3599af52cf467d8929656777f928 # Parent ebddb2618c17a35cc88bf7846ee57ea729bafad5 (insert-for-yank): Replace `category' property with whatever properties it stands for. (member-ignore-case): Ignore non-strings in LIST. diff -r ebddb2618c17 -r e4975d9c93ff lisp/subr.el --- a/lisp/subr.el Sat Apr 27 13:10:05 2002 +0000 +++ b/lisp/subr.el Sat Apr 27 19:48:40 2002 +0000 @@ -231,8 +231,11 @@ (defun member-ignore-case (elt list) "Like `member', but ignores differences in case and text representation. ELT must be a string. Upper-case and lower-case letters are treated as equal. -Unibyte strings are converted to multibyte for comparison." - (while (and list (not (eq t (compare-strings elt 0 nil (car list) 0 nil t)))) +Unibyte strings are converted to multibyte for comparison. +Non-strings in LIST are ignored." + (while (and list + (not (and (stringp (car list)) + (eq t (compare-strings elt 0 nil (car list) 0 nil t))))) (setq list (cdr list))) list) @@ -1282,10 +1285,29 @@ (apply 'insert strings) - (let ((inhibit-read-only t)) + (let ((inhibit-read-only t) + (end (point))) + + ;; Replace any `category' property with the properties it stands for. + (unless (memq yank-excluded-properties '(t nil)) + (save-excursion + (goto-char opoint) + (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)))))) + (if (eq yank-excluded-properties t) - (set-text-properties opoint (point) nil) - (remove-list-of-text-properties opoint (point) + (set-text-properties opoint end nil) + (remove-list-of-text-properties opoint end yank-excluded-properties))))) (defun insert-buffer-substring-no-properties (buf &optional start end)