From: Gerd Moellmann Date: Mon, 3 Apr 2000 19:29:56 +0000 (+0000) Subject: (member-ignore-case): New function. X-Git-Tag: emacs-pretest-21.0.90~4340 X-Git-Url: http://git.eshelyaron.com/gitweb/?a=commitdiff_plain;h=cbbc32051374d25a92a0a33014d51118ff6d10fc;p=emacs.git (member-ignore-case): New function. --- diff --git a/lisp/subr.el b/lisp/subr.el index ee6eadaa59f..ddcc36079ed 100644 --- a/lisp/subr.el +++ b/lisp/subr.el @@ -174,6 +174,18 @@ Unibyte strings are converted to multibyte for comparison." (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.