Commit ece6e35a authored by Gerd Moellmann's avatar Gerd Moellmann
Browse files

(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.
parent d152fb46
......@@ -39,6 +39,17 @@ Use the `etags' program to make a tags table file.")
(defgroup etags nil "Tags tables"
:group 'tools)
(defcustom tags-case-fold-search 'default
"*Whether tags operations should be case-sensitive.
A value of t means case-insensitive, a value of nil means case-sensitive.
Any other value means use the setting of `case-fold-search'."
:group 'etags
:type '(choice (const :tag "Case-sensitive" nil)
(const :tag "Case-insensitive" t)
(other :tag "Use default" default))
:version "21.1")
;; Use `visit-tags-table-buffer' to cycle through tags tables in this list.
(defcustom tags-table-list nil
......@@ -1009,6 +1020,9 @@ where they were found."
(tag-order order)
(match-marker (make-marker))
(case-fold-search (if (memq tags-case-fold-search '(nil t))
......@@ -1519,6 +1533,16 @@ if the file was newly read in, the value is the filename."
If it returns non-nil, this file needs processing by evalling
\`tags-loop-operate'. Otherwise, move on to the next file.")
(defun tags-loop-eval (form)
"Evaluate FORM and return its result.
Bind `case-fold-search' during the evaluation, depending on the value of
(let ((case-fold-search (if (memq tags-case-fold-search '(t nil))
(eval form)))
(defun tags-loop-continue (&optional first-time)
"Continue last \\[tags-search] or \\[tags-query-replace] command.
......@@ -1542,7 +1566,7 @@ nil, we exit; otherwise we scan the next file."
(while (or first-time file-finished
(not (eval tags-loop-scan))))
(not (tags-loop-eval tags-loop-scan))))
(setq file-finished nil)
(setq new (next-file first-time t))
;; If NEW is non-nil, we got a temp buffer,
......@@ -1568,7 +1592,7 @@ nil, we exit; otherwise we scan the next file."
;; Now operate on the file.
;; If value is non-nil, continue to scan the next file.
(eval tags-loop-operate))
(tags-loop-eval tags-loop-operate))
(setq file-finished t))
(and messaged
(null tags-loop-operate)
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment