changeset 50846:1ac6f8245bff

(imenu--generic-function): Use font-lock-defaults case setting if imenu-case-fold-search is not locally set.
author Stefan Monnier <monnier@iro.umontreal.ca>
date Tue, 06 May 2003 15:16:27 +0000
parents ac2120f868b9
children 47453bc2423e
files lisp/imenu.el
diffstat 1 files changed, 6 insertions(+), 4 deletions(-) [+]
line wrap: on
line diff
--- a/lisp/imenu.el	Tue May 06 14:55:56 2003 +0000
+++ b/lisp/imenu.el	Tue May 06 15:16:27 2003 +0000
@@ -745,9 +745,8 @@
   "Defines whether `imenu--generic-function' should fold case when matching.
 
 This variable should be set (only) by initialization code
-for modes which use `imenu--generic-function'.  If it is not set, that
-function will use the current value of `case-fold-search' to match
-patterns.")
+for modes which use `imenu--generic-function'.  If it is not set, but
+`font-lock-defaults' is set, then font-lock's setting is used.")
 ;;;###autoload
 (make-variable-buffer-local 'imenu-case-fold-search)
 
@@ -779,7 +778,10 @@
 
   (let ((index-alist (list 'dummy))
 	prev-pos beg
-        (case-fold-search imenu-case-fold-search)
+        (case-fold-search (if (or (local-variable-p 'imenu-case-fold-search)
+				  (not (local-variable-p 'font-lock-defaults)))
+			      imenu-case-fold-search
+			    (nth 2 font-lock-defaults)))
         (old-table (syntax-table))
         (table (copy-syntax-table (syntax-table)))
         (slist imenu-syntax-alist))