Mercurial > emacs
changeset 28490:9958b6d95bd6
(member-ignore-case): New function.
author | Gerd Moellmann <gerd@gnu.org> |
---|---|
date | Mon, 03 Apr 2000 19:29:56 +0000 |
parents | 3fe2e55e31da |
children | 3e21859cd0e7 |
files | lisp/subr.el |
diffstat | 1 files changed, 12 insertions(+), 0 deletions(-) [+] |
line wrap: on
line diff
--- a/lisp/subr.el Mon Apr 03 19:28:16 2000 +0000 +++ b/lisp/subr.el Mon Apr 03 19:29:56 2000 +0000 @@ -174,6 +174,18 @@ (setq element (car alist))) (setq alist (cdr alist))) element)) + +(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." + (let (element) + (while (and list (not element)) + (if (eq t (compare-strings elt 0 nil (car list) 0 nil t)) + (setq element (car list))) + (setq list (cdr list))) + element)) + ;;;; Keymap support.