diff options
| author | Richard M. Stallman | 2002-04-27 19:49:18 +0000 |
|---|---|---|
| committer | Richard M. Stallman | 2002-04-27 19:49:18 +0000 |
| commit | d86a3084f6fb1940a8e1ddf6aab907acc4060e4b (patch) | |
| tree | 02bc51094f72cf8020ae82d6e1d84993d757ac9c | |
| parent | e601d8fd57f143f90ad8e8be65d8677a45283f26 (diff) | |
| download | emacs-d86a3084f6fb1940a8e1ddf6aab907acc4060e4b.tar.gz emacs-d86a3084f6fb1940a8e1ddf6aab907acc4060e4b.zip | |
(insert-for-yank): Replace `category' property
with whatever properties it stands for.
(member-ignore-case): Ignore non-strings in LIST.
| -rw-r--r-- | lisp/ChangeLog | 7 | ||||
| -rw-r--r-- | lisp/subr.el | 32 |
2 files changed, 34 insertions, 5 deletions
diff --git a/lisp/ChangeLog b/lisp/ChangeLog index bc9baeb74fe..9c06ede1d63 100644 --- a/lisp/ChangeLog +++ b/lisp/ChangeLog | |||
| @@ -1,3 +1,10 @@ | |||
| 1 | 2002-04-27 Richard M. Stallman <rms@gnu.org> | ||
| 2 | |||
| 3 | * subr.el (insert-for-yank): Replace `category' property | ||
| 4 | with whatever properties it stands for. | ||
| 5 | |||
| 6 | * subr.el (member-ignore-case): Ignore non-strings in LIST. | ||
| 7 | |||
| 1 | 2002-04-27 Miles Bader <miles@gnu.org> | 8 | 2002-04-27 Miles Bader <miles@gnu.org> |
| 2 | 9 | ||
| 3 | * faces.el (read-face-name): Format the prompt correctly when | 10 | * faces.el (read-face-name): Format the prompt correctly when |
diff --git a/lisp/subr.el b/lisp/subr.el index afe5d3ebb02..6b9820f3e42 100644 --- a/lisp/subr.el +++ b/lisp/subr.el | |||
| @@ -231,8 +231,11 @@ Unibyte strings are converted to multibyte for comparison." | |||
| 231 | (defun member-ignore-case (elt list) | 231 | (defun member-ignore-case (elt list) |
| 232 | "Like `member', but ignores differences in case and text representation. | 232 | "Like `member', but ignores differences in case and text representation. |
| 233 | ELT must be a string. Upper-case and lower-case letters are treated as equal. | 233 | ELT must be a string. Upper-case and lower-case letters are treated as equal. |
| 234 | Unibyte strings are converted to multibyte for comparison." | 234 | Unibyte strings are converted to multibyte for comparison. |
| 235 | (while (and list (not (eq t (compare-strings elt 0 nil (car list) 0 nil t)))) | 235 | Non-strings in LIST are ignored." |
| 236 | (while (and list | ||
| 237 | (not (and (stringp (car list)) | ||
| 238 | (eq t (compare-strings elt 0 nil (car list) 0 nil t))))) | ||
| 236 | (setq list (cdr list))) | 239 | (setq list (cdr list))) |
| 237 | list) | 240 | list) |
| 238 | 241 | ||
| @@ -1282,10 +1285,29 @@ Otherwise just like (insert STRINGS...)." | |||
| 1282 | 1285 | ||
| 1283 | (apply 'insert strings) | 1286 | (apply 'insert strings) |
| 1284 | 1287 | ||
| 1285 | (let ((inhibit-read-only t)) | 1288 | (let ((inhibit-read-only t) |
| 1289 | (end (point))) | ||
| 1290 | |||
| 1291 | ;; Replace any `category' property with the properties it stands for. | ||
| 1292 | (unless (memq yank-excluded-properties '(t nil)) | ||
| 1293 | (save-excursion | ||
| 1294 | (goto-char opoint) | ||
| 1295 | (while (< (point) end) | ||
| 1296 | (let ((cat (get-text-property (point) 'category)) | ||
| 1297 | run-end) | ||
| 1298 | (when cat | ||
| 1299 | (setq run-end | ||
| 1300 | (next-single-property-change (point) 'category nil end)) | ||
| 1301 | (remove-list-of-text-properties (point) run-end '(category)) | ||
| 1302 | (add-text-properties (point) run-end (symbol-plist cat)) | ||
| 1303 | (goto-char (or run-end end))) | ||
| 1304 | (setq run-end | ||
| 1305 | (next-single-property-change (point) 'category nil end)) | ||
| 1306 | (goto-char (or run-end end)))))) | ||
| 1307 | |||
| 1286 | (if (eq yank-excluded-properties t) | 1308 | (if (eq yank-excluded-properties t) |
| 1287 | (set-text-properties opoint (point) nil) | 1309 | (set-text-properties opoint end nil) |
| 1288 | (remove-list-of-text-properties opoint (point) | 1310 | (remove-list-of-text-properties opoint end |
| 1289 | yank-excluded-properties))))) | 1311 | yank-excluded-properties))))) |
| 1290 | 1312 | ||
| 1291 | (defun insert-buffer-substring-no-properties (buf &optional start end) | 1313 | (defun insert-buffer-substring-no-properties (buf &optional start end) |