changeset 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 503eb7ee07bd
children 0a2dc2be3dd4
files lisp/progmodes/etags.el
diffstat 1 files changed, 26 insertions(+), 2 deletions(-) [+]
line wrap: on
line diff
--- a/lisp/progmodes/etags.el	Tue Mar 21 17:43:59 2000 +0000
+++ b/lisp/progmodes/etags.el	Tue Mar 21 21:47:47 2000 +0000
@@ -40,6 +40,17 @@
   :group 'tools)
 
 ;;;###autoload
+(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")
+
+;;;###autoload
 ;; Use `visit-tags-table-buffer' to cycle through tags tables in this list.
 (defcustom tags-table-list nil
   "*List of file names of tags tables to search.
@@ -1009,6 +1020,9 @@
 	(tag-order order)
 	(match-marker (make-marker))
 	goto-func
+	(case-fold-search (if (memq tags-case-fold-search '(nil t))
+			      tags-case-fold-search
+			    case-fold-search))
 	)
     (save-excursion
 
@@ -1519,6 +1533,16 @@
 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
+`tags-case-fold-search'."
+  (let ((case-fold-search (if (memq tags-case-fold-search '(t nil))
+			      tags-case-fold-search
+			    case-fold-search)))
+    (eval form)))
+  
+
 ;;;###autoload
 (defun tags-loop-continue (&optional first-time)
   "Continue last \\[tags-search] or \\[tags-query-replace] command.
@@ -1542,7 +1566,7 @@
 	  (while (or first-time file-finished
 		     (save-restriction
 		       (widen)
-		       (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 @@
 
 	  ;; 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)