]> git.eshelyaron.com Git - emacs.git/commitdiff
(assoc-ignore-case, assoc-ignore-representation):
authorRichard M. Stallman <rms@gnu.org>
Mon, 29 Dec 2003 19:56:54 +0000 (19:56 +0000)
committerRichard M. Stallman <rms@gnu.org>
Mon, 29 Dec 2003 19:56:54 +0000 (19:56 +0000)
Use assoc-string, and mark them obsolete.
(delay-mode-hooks): Mark as permanent local.

lisp/subr.el

index e760936572bd942f973208c77e07cbc4bae8ebbf..a2b09d6b63b7ee042d13d3aed7e7c5abdc3fda9f 100644 (file)
@@ -298,27 +298,19 @@ If TEST is omitted or nil, `equal' is used."
       (setq tail (cdr tail)))
     value))
 
+(make-obsolete 'assoc-ignore-case 'assoc-string)
 (defun assoc-ignore-case (key alist)
   "Like `assoc', but ignores differences in case and text representation.
 KEY 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 alist (not element))
-      (if (eq t (compare-strings key 0 nil (car (car alist)) 0 nil t))
-         (setq element (car alist)))
-      (setq alist (cdr alist)))
-    element))
+  (assoc-string key alist t))
 
+(make-obsolete 'assoc-ignore-representation 'assoc-string)
 (defun assoc-ignore-representation (key alist)
   "Like `assoc', but ignores differences in text representation.
 KEY must be a string.
 Unibyte strings are converted to multibyte for comparison."
-  (let (element)
-    (while (and alist (not element))
-      (if (eq t (compare-strings key 0 nil (car (car alist)) 0 nil))
-         (setq element (car alist)))
-      (setq alist (cdr alist)))
-    element))
+  (assoc-string key alist nil))
 
 (defun member-ignore-case (elt list)
   "Like `member', but ignores differences in case and text representation.
@@ -1820,6 +1812,7 @@ in BODY."
 (defvar delayed-mode-hooks nil
   "List of delayed mode hooks waiting to be run.")
 (make-variable-buffer-local 'delayed-mode-hooks)
+(put 'delay-mode-hooks 'permanent-local t)
 
 (defun run-mode-hooks (&rest hooks)
   "Run mode hooks `delayed-mode-hooks' and HOOKS, or delay HOOKS.