diff options
| author | Gerd Moellmann | 2000-03-21 21:47:47 +0000 |
|---|---|---|
| committer | Gerd Moellmann | 2000-03-21 21:47:47 +0000 |
| commit | ece6e35ac9158cc34c252941baed5ed7d3b1d914 (patch) | |
| tree | 446401276c3743181708ba434effc1edff7b5ce7 | |
| parent | d152fb46e03ec74834b34f7df4c19c83fc771e22 (diff) | |
| download | emacs-ece6e35ac9158cc34c252941baed5ed7d3b1d914.tar.gz emacs-ece6e35ac9158cc34c252941baed5ed7d3b1d914.zip | |
(tags-case-fold-search): New user-option.
(tags-loop-eval): New function. Bind case-fold-search around eval
depending on the value of tags-case-fold-search.
(tags-loop-continue): Use tags-loop-eval.
(find-tag-in-order): Bind case-fold-search depending on the value
of tags-case-fold-search.
| -rw-r--r-- | lisp/progmodes/etags.el | 28 |
1 files changed, 26 insertions, 2 deletions
diff --git a/lisp/progmodes/etags.el b/lisp/progmodes/etags.el index fd49bb6d1a2..b8d998e16ca 100644 --- a/lisp/progmodes/etags.el +++ b/lisp/progmodes/etags.el | |||
| @@ -40,6 +40,17 @@ Use the `etags' program to make a tags table file.") | |||
| 40 | :group 'tools) | 40 | :group 'tools) |
| 41 | 41 | ||
| 42 | ;;;###autoload | 42 | ;;;###autoload |
| 43 | (defcustom tags-case-fold-search 'default | ||
| 44 | "*Whether tags operations should be case-sensitive. | ||
| 45 | A value of t means case-insensitive, a value of nil means case-sensitive. | ||
| 46 | Any other value means use the setting of `case-fold-search'." | ||
| 47 | :group 'etags | ||
| 48 | :type '(choice (const :tag "Case-sensitive" nil) | ||
| 49 | (const :tag "Case-insensitive" t) | ||
| 50 | (other :tag "Use default" default)) | ||
| 51 | :version "21.1") | ||
| 52 | |||
| 53 | ;;;###autoload | ||
| 43 | ;; Use `visit-tags-table-buffer' to cycle through tags tables in this list. | 54 | ;; Use `visit-tags-table-buffer' to cycle through tags tables in this list. |
| 44 | (defcustom tags-table-list nil | 55 | (defcustom tags-table-list nil |
| 45 | "*List of file names of tags tables to search. | 56 | "*List of file names of tags tables to search. |
| @@ -1009,6 +1020,9 @@ where they were found." | |||
| 1009 | (tag-order order) | 1020 | (tag-order order) |
| 1010 | (match-marker (make-marker)) | 1021 | (match-marker (make-marker)) |
| 1011 | goto-func | 1022 | goto-func |
| 1023 | (case-fold-search (if (memq tags-case-fold-search '(nil t)) | ||
| 1024 | tags-case-fold-search | ||
| 1025 | case-fold-search)) | ||
| 1012 | ) | 1026 | ) |
| 1013 | (save-excursion | 1027 | (save-excursion |
| 1014 | 1028 | ||
| @@ -1519,6 +1533,16 @@ if the file was newly read in, the value is the filename." | |||
| 1519 | If it returns non-nil, this file needs processing by evalling | 1533 | If it returns non-nil, this file needs processing by evalling |
| 1520 | \`tags-loop-operate'. Otherwise, move on to the next file.") | 1534 | \`tags-loop-operate'. Otherwise, move on to the next file.") |
| 1521 | 1535 | ||
| 1536 | (defun tags-loop-eval (form) | ||
| 1537 | "Evaluate FORM and return its result. | ||
| 1538 | Bind `case-fold-search' during the evaluation, depending on the value of | ||
| 1539 | `tags-case-fold-search'." | ||
| 1540 | (let ((case-fold-search (if (memq tags-case-fold-search '(t nil)) | ||
| 1541 | tags-case-fold-search | ||
| 1542 | case-fold-search))) | ||
| 1543 | (eval form))) | ||
| 1544 | |||
| 1545 | |||
| 1522 | ;;;###autoload | 1546 | ;;;###autoload |
| 1523 | (defun tags-loop-continue (&optional first-time) | 1547 | (defun tags-loop-continue (&optional first-time) |
| 1524 | "Continue last \\[tags-search] or \\[tags-query-replace] command. | 1548 | "Continue last \\[tags-search] or \\[tags-query-replace] command. |
| @@ -1542,7 +1566,7 @@ nil, we exit; otherwise we scan the next file." | |||
| 1542 | (while (or first-time file-finished | 1566 | (while (or first-time file-finished |
| 1543 | (save-restriction | 1567 | (save-restriction |
| 1544 | (widen) | 1568 | (widen) |
| 1545 | (not (eval tags-loop-scan)))) | 1569 | (not (tags-loop-eval tags-loop-scan)))) |
| 1546 | (setq file-finished nil) | 1570 | (setq file-finished nil) |
| 1547 | (setq new (next-file first-time t)) | 1571 | (setq new (next-file first-time t)) |
| 1548 | ;; If NEW is non-nil, we got a temp buffer, | 1572 | ;; If NEW is non-nil, we got a temp buffer, |
| @@ -1568,7 +1592,7 @@ nil, we exit; otherwise we scan the next file." | |||
| 1568 | 1592 | ||
| 1569 | ;; Now operate on the file. | 1593 | ;; Now operate on the file. |
| 1570 | ;; If value is non-nil, continue to scan the next file. | 1594 | ;; If value is non-nil, continue to scan the next file. |
| 1571 | (eval tags-loop-operate)) | 1595 | (tags-loop-eval tags-loop-operate)) |
| 1572 | (setq file-finished t)) | 1596 | (setq file-finished t)) |
| 1573 | (and messaged | 1597 | (and messaged |
| 1574 | (null tags-loop-operate) | 1598 | (null tags-loop-operate) |