diff options
| author | Richard M. Stallman | 2004-05-22 21:51:17 +0000 |
|---|---|---|
| committer | Richard M. Stallman | 2004-05-22 21:51:17 +0000 |
| commit | c2fb64156461579bcc3382a665429520b381231a (patch) | |
| tree | 223853b7fdc3f1557dcdc1fde1a529f9190f1f05 | |
| parent | fe93c80378e9b44b4853374e1450b526a1f1e33e (diff) | |
| download | emacs-c2fb64156461579bcc3382a665429520b381231a.tar.gz emacs-c2fb64156461579bcc3382a665429520b381231a.zip | |
Use assoc-string, not assoc-ignore-case.
| -rw-r--r-- | lisp/progmodes/ada-mode.el | 16 | ||||
| -rw-r--r-- | lisp/textmodes/bibtex.el | 54 |
2 files changed, 37 insertions, 33 deletions
diff --git a/lisp/progmodes/ada-mode.el b/lisp/progmodes/ada-mode.el index abc8db6d2c3..f7688e24069 100644 --- a/lisp/progmodes/ada-mode.el +++ b/lisp/progmodes/ada-mode.el | |||
| @@ -1466,8 +1466,8 @@ The standard casing rules will no longer apply to this word." | |||
| 1466 | ;; If the word is already in the list, even with a different casing | 1466 | ;; If the word is already in the list, even with a different casing |
| 1467 | ;; we simply want to replace it. | 1467 | ;; we simply want to replace it. |
| 1468 | (if (and (not (equal ada-case-exception '())) | 1468 | (if (and (not (equal ada-case-exception '())) |
| 1469 | (assoc-ignore-case word ada-case-exception)) | 1469 | (assoc-string word ada-case-exception t)) |
| 1470 | (setcar (assoc-ignore-case word ada-case-exception) word) | 1470 | (setcar (assoc-string word ada-case-exception t) word) |
| 1471 | (add-to-list 'ada-case-exception (cons word t)) | 1471 | (add-to-list 'ada-case-exception (cons word t)) |
| 1472 | ) | 1472 | ) |
| 1473 | 1473 | ||
| @@ -1519,8 +1519,8 @@ word itself has a special casing." | |||
| 1519 | ;; If the word is already in the list, even with a different casing | 1519 | ;; If the word is already in the list, even with a different casing |
| 1520 | ;; we simply want to replace it. | 1520 | ;; we simply want to replace it. |
| 1521 | (if (and (not (equal ada-case-exception-substring '())) | 1521 | (if (and (not (equal ada-case-exception-substring '())) |
| 1522 | (assoc-ignore-case word ada-case-exception-substring)) | 1522 | (assoc-string word ada-case-exception-substring t)) |
| 1523 | (setcar (assoc-ignore-case word ada-case-exception-substring) word) | 1523 | (setcar (assoc-string word ada-case-exception-substring t) word) |
| 1524 | (add-to-list 'ada-case-exception-substring (cons word t)) | 1524 | (add-to-list 'ada-case-exception-substring (cons word t)) |
| 1525 | ) | 1525 | ) |
| 1526 | 1526 | ||
| @@ -1548,9 +1548,9 @@ word itself has a special casing." | |||
| 1548 | (if (char-equal (string-to-char word) ?*) | 1548 | (if (char-equal (string-to-char word) ?*) |
| 1549 | (progn | 1549 | (progn |
| 1550 | (setq word (substring word 1)) | 1550 | (setq word (substring word 1)) |
| 1551 | (unless (assoc-ignore-case word ada-case-exception-substring) | 1551 | (unless (assoc-string word ada-case-exception-substring t) |
| 1552 | (add-to-list 'ada-case-exception-substring (cons word t)))) | 1552 | (add-to-list 'ada-case-exception-substring (cons word t)))) |
| 1553 | (unless (assoc-ignore-case word ada-case-exception) | 1553 | (unless (assoc-string word ada-case-exception t) |
| 1554 | (add-to-list 'ada-case-exception (cons word t))))) | 1554 | (add-to-list 'ada-case-exception (cons word t))))) |
| 1555 | 1555 | ||
| 1556 | (forward-line 1)) | 1556 | (forward-line 1)) |
| @@ -1618,8 +1618,8 @@ the exceptions defined in `ada-case-exception-file'." | |||
| 1618 | (point))) | 1618 | (point))) |
| 1619 | match) | 1619 | match) |
| 1620 | ;; If we have an exception, replace the word by the correct casing | 1620 | ;; If we have an exception, replace the word by the correct casing |
| 1621 | (if (setq match (assoc-ignore-case (buffer-substring start end) | 1621 | (if (setq match (assoc-string (buffer-substring start end) |
| 1622 | ada-case-exception)) | 1622 | ada-case-exception t)) |
| 1623 | 1623 | ||
| 1624 | (progn | 1624 | (progn |
| 1625 | (delete-region start end) | 1625 | (delete-region start end) |
diff --git a/lisp/textmodes/bibtex.el b/lisp/textmodes/bibtex.el index 5c95b138720..99e693abb94 100644 --- a/lisp/textmodes/bibtex.el +++ b/lisp/textmodes/bibtex.el | |||
| @@ -1502,7 +1502,7 @@ FUN will not be called for @String entries." | |||
| 1502 | (save-excursion | 1502 | (save-excursion |
| 1503 | (if (or (and (not bibtex-sort-ignore-string-entries) | 1503 | (if (or (and (not bibtex-sort-ignore-string-entries) |
| 1504 | (string-equal "string" (downcase entry-type))) | 1504 | (string-equal "string" (downcase entry-type))) |
| 1505 | (assoc-ignore-case entry-type bibtex-entry-field-alist)) | 1505 | (assoc-string entry-type bibtex-entry-field-alist t)) |
| 1506 | (funcall fun key beg end))) | 1506 | (funcall fun key beg end))) |
| 1507 | (goto-char end))))) | 1507 | (goto-char end))))) |
| 1508 | 1508 | ||
| @@ -1771,9 +1771,10 @@ Formats current entry according to variable `bibtex-entry-format'." | |||
| 1771 | (re-search-forward bibtex-entry-type) | 1771 | (re-search-forward bibtex-entry-type) |
| 1772 | (let ((beg-type (1+ (match-beginning 0))) | 1772 | (let ((beg-type (1+ (match-beginning 0))) |
| 1773 | (end-type (match-end 0))) | 1773 | (end-type (match-end 0))) |
| 1774 | (setq entry-list (assoc-ignore-case (buffer-substring-no-properties | 1774 | (setq entry-list (assoc-string (buffer-substring-no-properties |
| 1775 | beg-type end-type) | 1775 | beg-type end-type) |
| 1776 | bibtex-entry-field-alist)) | 1776 | bibtex-entry-field-alist |
| 1777 | t)) | ||
| 1777 | 1778 | ||
| 1778 | ;; unify case of entry name | 1779 | ;; unify case of entry name |
| 1779 | (when (memq 'unify-case format) | 1780 | (when (memq 'unify-case format) |
| @@ -1846,8 +1847,8 @@ Formats current entry according to variable `bibtex-entry-format'." | |||
| 1846 | (if (memq 'opts-or-alts format) | 1847 | (if (memq 'opts-or-alts format) |
| 1847 | (cond ((and empty-field | 1848 | (cond ((and empty-field |
| 1848 | (or opt-alt | 1849 | (or opt-alt |
| 1849 | (let ((field (assoc-ignore-case | 1850 | (let ((field (assoc-string |
| 1850 | field-name req-field-list))) | 1851 | field-name req-field-list t))) |
| 1851 | (or (not field) ; OPT field | 1852 | (or (not field) ; OPT field |
| 1852 | (nth 3 field))))) ; ALT field | 1853 | (nth 3 field))))) ; ALT field |
| 1853 | ;; Either it is an empty ALT field. Then we have checked | 1854 | ;; Either it is an empty ALT field. Then we have checked |
| @@ -1918,15 +1919,17 @@ Formats current entry according to variable `bibtex-entry-format'." | |||
| 1918 | ;; if empty field, complain | 1919 | ;; if empty field, complain |
| 1919 | (if (and empty-field | 1920 | (if (and empty-field |
| 1920 | (memq 'required-fields format) | 1921 | (memq 'required-fields format) |
| 1921 | (assoc-ignore-case field-name req-field-list)) | 1922 | (assoc-string field-name req-field-list t)) |
| 1922 | (error "Mandatory field `%s' is empty" field-name)) | 1923 | (error "Mandatory field `%s' is empty" field-name)) |
| 1923 | 1924 | ||
| 1924 | ;; unify case of field name | 1925 | ;; unify case of field name |
| 1925 | (if (memq 'unify-case format) | 1926 | (if (memq 'unify-case format) |
| 1926 | (let ((fname (car (assoc-ignore-case | 1927 | (let ((fname (car (assoc-string |
| 1927 | field-name (append (nth 0 (nth 1 entry-list)) | 1928 | field-name |
| 1928 | (nth 1 (nth 1 entry-list)) | 1929 | (append (nth 0 (nth 1 entry-list)) |
| 1929 | bibtex-user-optional-fields))))) | 1930 | (nth 1 (nth 1 entry-list)) |
| 1931 | bibtex-user-optional-fields) | ||
| 1932 | t)))) | ||
| 1930 | (if fname | 1933 | (if fname |
| 1931 | (progn | 1934 | (progn |
| 1932 | (delete-region beg-name end-name) | 1935 | (delete-region beg-name end-name) |
| @@ -2258,8 +2261,8 @@ Return alist of keys if parsing was completed, `aborted' otherwise." | |||
| 2258 | ;; This is a crossref. | 2261 | ;; This is a crossref. |
| 2259 | (buffer-substring-no-properties | 2262 | (buffer-substring-no-properties |
| 2260 | (1+ (match-beginning 3)) (1- (match-end 3)))) | 2263 | (1+ (match-beginning 3)) (1- (match-end 3)))) |
| 2261 | ((assoc-ignore-case (bibtex-type-in-head) | 2264 | ((assoc-string (bibtex-type-in-head) |
| 2262 | bibtex-entry-field-alist) | 2265 | bibtex-entry-field-alist t) |
| 2263 | ;; This is an entry. | 2266 | ;; This is an entry. |
| 2264 | (match-string-no-properties bibtex-key-in-head))))) | 2267 | (match-string-no-properties bibtex-key-in-head))))) |
| 2265 | (if (and (stringp key) | 2268 | (if (and (stringp key) |
| @@ -2314,7 +2317,7 @@ Return alist of strings if parsing was completed, `aborted' otherwise." | |||
| 2314 | ;; user has aborted by typing a key --> return `aborted' | 2317 | ;; user has aborted by typing a key --> return `aborted' |
| 2315 | (throw 'userkey 'aborted)) | 2318 | (throw 'userkey 'aborted)) |
| 2316 | (setq key (bibtex-reference-key-in-string bounds)) | 2319 | (setq key (bibtex-reference-key-in-string bounds)) |
| 2317 | (if (not (assoc-ignore-case key strings)) | 2320 | (if (not (assoc-string key strings t)) |
| 2318 | (push (cons key (bibtex-text-in-string bounds t)) | 2321 | (push (cons key (bibtex-text-in-string bounds t)) |
| 2319 | strings)) | 2322 | strings)) |
| 2320 | (goto-char (bibtex-end-of-text-in-string bounds))) | 2323 | (goto-char (bibtex-end-of-text-in-string bounds))) |
| @@ -2654,7 +2657,7 @@ non-nil. | |||
| 2654 | More specifically, the return value is a cons pair (REQUIRED . OPTIONAL), | 2657 | More specifically, the return value is a cons pair (REQUIRED . OPTIONAL), |
| 2655 | where REQUIRED and OPTIONAL are lists of the required and optional field | 2658 | where REQUIRED and OPTIONAL are lists of the required and optional field |
| 2656 | names for ENTRY-TYPE according to `bibtex-entry-field-alist'." | 2659 | names for ENTRY-TYPE according to `bibtex-entry-field-alist'." |
| 2657 | (let ((e (assoc-ignore-case entry-type bibtex-entry-field-alist)) | 2660 | (let ((e (assoc-string entry-type bibtex-entry-field-alist t)) |
| 2658 | required optional) | 2661 | required optional) |
| 2659 | (unless e | 2662 | (unless e |
| 2660 | (error "Bibtex entry type %s not defined" entry-type)) | 2663 | (error "Bibtex entry type %s not defined" entry-type)) |
| @@ -2721,10 +2724,10 @@ according to `bibtex-entry-field-alist', but are not yet present." | |||
| 2721 | (substring (cdr (assoc "=type=" fields-alist)) | 2724 | (substring (cdr (assoc "=type=" fields-alist)) |
| 2722 | 1)))) ; don't want @ | 2725 | 1)))) ; don't want @ |
| 2723 | (dolist (field (car field-list)) | 2726 | (dolist (field (car field-list)) |
| 2724 | (unless (assoc-ignore-case (car field) fields-alist) | 2727 | (unless (assoc-string (car field) fields-alist t) |
| 2725 | (bibtex-make-field field))) | 2728 | (bibtex-make-field field))) |
| 2726 | (dolist (field (cdr field-list)) | 2729 | (dolist (field (cdr field-list)) |
| 2727 | (unless (assoc-ignore-case (car field) fields-alist) | 2730 | (unless (assoc-string (car field) fields-alist t) |
| 2728 | (bibtex-make-optional-field field)))))) | 2731 | (bibtex-make-optional-field field)))))) |
| 2729 | 2732 | ||
| 2730 | (defun bibtex-parse-entry () | 2733 | (defun bibtex-parse-entry () |
| @@ -2792,7 +2795,7 @@ Move point to the end of the last field." | |||
| 2792 | (let* ((name (buffer-substring | 2795 | (let* ((name (buffer-substring |
| 2793 | (if (looking-at "ALT\\|OPT") (match-end 0) (point)) | 2796 | (if (looking-at "ALT\\|OPT") (match-end 0) (point)) |
| 2794 | (bibtex-end-of-name-in-field bounds))) | 2797 | (bibtex-end-of-name-in-field bounds))) |
| 2795 | (text (assoc-ignore-case name other))) | 2798 | (text (assoc-string name other t))) |
| 2796 | (goto-char (bibtex-start-of-text-in-field bounds)) | 2799 | (goto-char (bibtex-start-of-text-in-field bounds)) |
| 2797 | (if (not (and (looking-at bibtex-empty-field-re) text)) | 2800 | (if (not (and (looking-at bibtex-empty-field-re) text)) |
| 2798 | (goto-char (bibtex-end-of-field bounds)) | 2801 | (goto-char (bibtex-end-of-field bounds)) |
| @@ -2825,9 +2828,10 @@ Move point to the end of the last field." | |||
| 2825 | (field-list (bibtex-field-list (progn (re-search-backward | 2828 | (field-list (bibtex-field-list (progn (re-search-backward |
| 2826 | bibtex-entry-maybe-empty-head nil t) | 2829 | bibtex-entry-maybe-empty-head nil t) |
| 2827 | (bibtex-type-in-head)))) | 2830 | (bibtex-type-in-head)))) |
| 2828 | (comment (assoc-ignore-case field-name | 2831 | (comment (assoc-string field-name |
| 2829 | (append (car field-list) | 2832 | (append (car field-list) |
| 2830 | (cdr field-list))))) | 2833 | (cdr field-list)) |
| 2834 | t))) | ||
| 2831 | (if comment | 2835 | (if comment |
| 2832 | (message (nth 1 comment)) | 2836 | (message (nth 1 comment)) |
| 2833 | (message "No comment available"))))) | 2837 | (message "No comment available"))))) |
| @@ -3235,8 +3239,8 @@ Returns t if test was successful, nil otherwise." | |||
| 3235 | (let* ((entry-list (progn | 3239 | (let* ((entry-list (progn |
| 3236 | (goto-char beg) | 3240 | (goto-char beg) |
| 3237 | (bibtex-search-entry nil end) | 3241 | (bibtex-search-entry nil end) |
| 3238 | (assoc-ignore-case (bibtex-type-in-head) | 3242 | (assoc-string (bibtex-type-in-head) |
| 3239 | bibtex-entry-field-alist))) | 3243 | bibtex-entry-field-alist t))) |
| 3240 | (req (copy-sequence (elt (elt entry-list 1) 0))) | 3244 | (req (copy-sequence (elt (elt entry-list 1) 0))) |
| 3241 | (creq (copy-sequence (elt (elt entry-list 2) 0))) | 3245 | (creq (copy-sequence (elt (elt entry-list 2) 0))) |
| 3242 | crossref-there bounds) | 3246 | crossref-there bounds) |
| @@ -3252,8 +3256,8 @@ Returns t if test was successful, nil otherwise." | |||
| 3252 | (push (list (bibtex-current-line) | 3256 | (push (list (bibtex-current-line) |
| 3253 | "Questionable month field") | 3257 | "Questionable month field") |
| 3254 | error-list)) | 3258 | error-list)) |
| 3255 | (setq req (delete (assoc-ignore-case field-name req) req) | 3259 | (setq req (delete (assoc-string field-name req t) req) |
| 3256 | creq (delete (assoc-ignore-case field-name creq) creq)) | 3260 | creq (delete (assoc-string field-name creq t) creq)) |
| 3257 | (if (equal field-name "crossref") | 3261 | (if (equal field-name "crossref") |
| 3258 | (setq crossref-there t)))) | 3262 | (setq crossref-there t)))) |
| 3259 | (if crossref-there | 3263 | (if crossref-there |