comparison lisp/progmodes/etags.el @ 28243:9669a6691caa

(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.
author Gerd Moellmann <gerd@gnu.org>
date Tue, 21 Mar 2000 21:47:47 +0000
parents 32e893b03ad2
children 351e38e6b866
comparison
equal deleted inserted replaced
28242:503eb7ee07bd 28243:9669a6691caa
36 ;; Make M-x set-variable tags-file-name like M-x visit-tags-table. 36 ;; Make M-x set-variable tags-file-name like M-x visit-tags-table.
37 ;;;###autoload (put 'tags-file-name 'variable-interactive "fVisit tags table: ") 37 ;;;###autoload (put 'tags-file-name 'variable-interactive "fVisit tags table: ")
38 38
39 (defgroup etags nil "Tags tables" 39 (defgroup etags nil "Tags tables"
40 :group 'tools) 40 :group 'tools)
41
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")
41 52
42 ;;;###autoload 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.
1007 tag-info ;where to find the tag in FILE 1018 tag-info ;where to find the tag in FILE
1008 (first-table t) 1019 (first-table t)
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
1015 (if first-search 1029 (if first-search
1016 ;; This is the start of a search for a fresh tag. 1030 ;; This is the start of a search for a fresh tag.
1517 "No \\[tags-search] or \\[tags-query-replace] in progress")) 1531 "No \\[tags-search] or \\[tags-query-replace] in progress"))
1518 "Form for `tags-loop-continue' to eval to scan one file. 1532 "Form for `tags-loop-continue' to eval to scan one file.
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.
1525 Used noninteractively with non-nil argument to begin such a command (the 1549 Used noninteractively with non-nil argument to begin such a command (the
1526 argument is passed to `next-file', which see). 1550 argument is passed to `next-file', which see).
1540 (progn 1564 (progn
1541 ;; Scan files quickly for the first or next interesting one. 1565 ;; Scan files quickly for the first or next interesting one.
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,
1549 ;; and NEW is the file name. 1573 ;; and NEW is the file name.
1550 (if (or messaged 1574 (if (or messaged
1566 1590
1567 (switch-to-buffer (current-buffer)) 1591 (switch-to-buffer (current-buffer))
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)
1575 (message "Scanning file %s...found" buffer-file-name)))) 1599 (message "Scanning file %s...found" buffer-file-name))))
1576 ;;;###autoload (define-key esc-map "," 'tags-loop-continue) 1600 ;;;###autoload (define-key esc-map "," 'tags-loop-continue)