changeset 55730:b4eeb441c089

Use assoc-string, not assoc-ignore-case.
author Richard M. Stallman <rms@gnu.org>
date Sat, 22 May 2004 21:51:17 +0000
parents 0c0b514a4952
children 856dacc3ac48
files lisp/progmodes/ada-mode.el lisp/textmodes/bibtex.el
diffstat 2 files changed, 37 insertions(+), 33 deletions(-) [+]
line wrap: on
line diff
--- a/lisp/progmodes/ada-mode.el	Sat May 22 21:50:03 2004 +0000
+++ b/lisp/progmodes/ada-mode.el	Sat May 22 21:51:17 2004 +0000
@@ -1466,8 +1466,8 @@
     ;;  If the word is already in the list, even with a different casing
     ;;  we simply want to replace it.
     (if (and (not (equal ada-case-exception '()))
-             (assoc-ignore-case word ada-case-exception))
-        (setcar (assoc-ignore-case word ada-case-exception) word)
+             (assoc-string word ada-case-exception t))
+        (setcar (assoc-string word ada-case-exception t) word)
       (add-to-list 'ada-case-exception (cons word t))
       )
 
@@ -1519,8 +1519,8 @@
     ;;  If the word is already in the list, even with a different casing
     ;;  we simply want to replace it.
     (if (and (not (equal ada-case-exception-substring '()))
-             (assoc-ignore-case word ada-case-exception-substring))
-        (setcar (assoc-ignore-case word ada-case-exception-substring) word)
+             (assoc-string word ada-case-exception-substring t))
+        (setcar (assoc-string word ada-case-exception-substring t) word)
       (add-to-list 'ada-case-exception-substring (cons word t))
       )
 
@@ -1548,9 +1548,9 @@
 	    (if (char-equal (string-to-char word) ?*)
 		(progn
 		  (setq word (substring word 1))
-		  (unless (assoc-ignore-case word ada-case-exception-substring)
+		  (unless (assoc-string word ada-case-exception-substring t)
 		    (add-to-list 'ada-case-exception-substring (cons word t))))
-	      (unless (assoc-ignore-case word ada-case-exception)
+	      (unless (assoc-string word ada-case-exception t)
 		(add-to-list 'ada-case-exception (cons word t)))))
 
           (forward-line 1))
@@ -1618,8 +1618,8 @@
                                    (point)))
             match)
         ;;  If we have an exception, replace the word by the correct casing
-        (if (setq match (assoc-ignore-case (buffer-substring start end)
-                                           ada-case-exception))
+        (if (setq match (assoc-string (buffer-substring start end)
+				      ada-case-exception t))
 
             (progn
               (delete-region start end)
--- a/lisp/textmodes/bibtex.el	Sat May 22 21:50:03 2004 +0000
+++ b/lisp/textmodes/bibtex.el	Sat May 22 21:51:17 2004 +0000
@@ -1502,7 +1502,7 @@
         (save-excursion
           (if (or (and (not bibtex-sort-ignore-string-entries)
                        (string-equal "string" (downcase entry-type)))
-                  (assoc-ignore-case entry-type bibtex-entry-field-alist))
+                  (assoc-string entry-type bibtex-entry-field-alist t))
               (funcall fun key beg end)))
         (goto-char end)))))
 
@@ -1771,9 +1771,10 @@
         (re-search-forward bibtex-entry-type)
         (let ((beg-type (1+ (match-beginning 0)))
               (end-type (match-end 0)))
-          (setq entry-list (assoc-ignore-case (buffer-substring-no-properties
-                                               beg-type end-type)
-                                              bibtex-entry-field-alist))
+          (setq entry-list (assoc-string (buffer-substring-no-properties
+					  beg-type end-type)
+					 bibtex-entry-field-alist
+					 t))
 
           ;; unify case of entry name
           (when (memq 'unify-case format)
@@ -1846,8 +1847,8 @@
             (if (memq 'opts-or-alts format)
                 (cond ((and empty-field
                             (or opt-alt
-                                (let ((field (assoc-ignore-case
-                                              field-name req-field-list)))
+                                (let ((field (assoc-string
+                                              field-name req-field-list t)))
                                   (or (not field)       ; OPT field
                                       (nth 3 field))))) ; ALT field
                        ;; Either it is an empty ALT field. Then we have checked
@@ -1918,15 +1919,17 @@
               ;; if empty field, complain
               (if (and empty-field
                        (memq 'required-fields format)
-                       (assoc-ignore-case field-name req-field-list))
+                       (assoc-string field-name req-field-list t))
                   (error "Mandatory field `%s' is empty" field-name))
 
               ;; unify case of field name
               (if (memq 'unify-case format)
-                  (let ((fname (car (assoc-ignore-case
-                                     field-name (append (nth 0 (nth 1 entry-list))
-                                                        (nth 1 (nth 1 entry-list))
-                                                        bibtex-user-optional-fields)))))
+                  (let ((fname (car (assoc-string
+                                     field-name
+				     (append (nth 0 (nth 1 entry-list))
+					     (nth 1 (nth 1 entry-list))
+					     bibtex-user-optional-fields)
+				     t))))
                     (if fname
                         (progn
                           (delete-region beg-name end-name)
@@ -2258,8 +2261,8 @@
                                     ;; This is a crossref.
                                     (buffer-substring-no-properties
                                      (1+ (match-beginning 3)) (1- (match-end 3))))
-                                   ((assoc-ignore-case (bibtex-type-in-head)
-                                                       bibtex-entry-field-alist)
+                                   ((assoc-string (bibtex-type-in-head)
+						  bibtex-entry-field-alist t)
                                     ;; This is an entry.
                                     (match-string-no-properties bibtex-key-in-head)))))
                     (if (and (stringp key)
@@ -2314,7 +2317,7 @@
                 ;; user has aborted by typing a key --> return `aborted'
                 (throw 'userkey 'aborted))
             (setq key (bibtex-reference-key-in-string bounds))
-            (if (not (assoc-ignore-case key strings))
+            (if (not (assoc-string key strings t))
                 (push (cons key (bibtex-text-in-string bounds t))
                       strings))
             (goto-char (bibtex-end-of-text-in-string bounds)))
@@ -2654,7 +2657,7 @@
 More specifically, the return value is a cons pair (REQUIRED . OPTIONAL),
 where REQUIRED and OPTIONAL are lists of the required and optional field
 names for ENTRY-TYPE according to `bibtex-entry-field-alist'."
-  (let ((e (assoc-ignore-case entry-type bibtex-entry-field-alist))
+  (let ((e (assoc-string entry-type bibtex-entry-field-alist t))
         required optional)
     (unless e
       (error "Bibtex entry type %s not defined" entry-type))
@@ -2721,10 +2724,10 @@
                         (substring (cdr (assoc "=type=" fields-alist))
                                    1)))) ; don't want @
       (dolist (field (car field-list))
-        (unless (assoc-ignore-case (car field) fields-alist)
+        (unless (assoc-string (car field) fields-alist t)
           (bibtex-make-field field)))
       (dolist (field (cdr field-list))
-        (unless (assoc-ignore-case (car field) fields-alist)
+        (unless (assoc-string (car field) fields-alist t)
           (bibtex-make-optional-field field))))))
 
 (defun bibtex-parse-entry ()
@@ -2792,7 +2795,7 @@
 	  (let* ((name (buffer-substring
 			(if (looking-at "ALT\\|OPT") (match-end 0) (point))
 			(bibtex-end-of-name-in-field bounds)))
-		 (text (assoc-ignore-case name other)))
+		 (text (assoc-string name other t)))
 	    (goto-char (bibtex-start-of-text-in-field bounds))
 	    (if (not (and (looking-at bibtex-empty-field-re) text))
 		(goto-char (bibtex-end-of-field bounds))
@@ -2825,9 +2828,10 @@
            (field-list (bibtex-field-list (progn (re-search-backward
                                                   bibtex-entry-maybe-empty-head nil t)
                                                  (bibtex-type-in-head))))
-           (comment (assoc-ignore-case field-name
-                                       (append (car field-list)
-                                               (cdr field-list)))))
+           (comment (assoc-string field-name
+				  (append (car field-list)
+					  (cdr field-list))
+				  t)))
       (if comment
           (message (nth 1 comment))
         (message "No comment available")))))
@@ -3235,8 +3239,8 @@
                  (let* ((entry-list (progn
                                       (goto-char beg)
                                       (bibtex-search-entry nil end)
-                                      (assoc-ignore-case (bibtex-type-in-head)
-                                                         bibtex-entry-field-alist)))
+                                      (assoc-string (bibtex-type-in-head)
+						    bibtex-entry-field-alist t)))
                         (req (copy-sequence (elt (elt entry-list 1) 0)))
                         (creq (copy-sequence (elt (elt entry-list 2) 0)))
                         crossref-there bounds)
@@ -3252,8 +3256,8 @@
                            (push (list (bibtex-current-line)
                                        "Questionable month field")
                                  error-list))
-                       (setq req (delete (assoc-ignore-case field-name req) req)
-                             creq (delete (assoc-ignore-case field-name creq) creq))
+                       (setq req (delete (assoc-string field-name req t) req)
+                             creq (delete (assoc-string field-name creq t) creq))
                        (if (equal field-name "crossref")
                            (setq crossref-there t))))
                    (if crossref-there