diff options
| author | Dave Love | 1998-01-25 22:55:08 +0000 |
|---|---|---|
| committer | Dave Love | 1998-01-25 22:55:08 +0000 |
| commit | 73f48953972a8fd51b23c559b291ec69e73668b6 (patch) | |
| tree | c204bd7a663c53918102f6f0fd4d20b18b1a4c70 | |
| parent | 1c6bb4821d80bac60fa6e2535199d9a0d063af57 (diff) | |
| download | emacs-73f48953972a8fd51b23c559b291ec69e73668b6.tar.gz emacs-73f48953972a8fd51b23c559b291ec69e73668b6.zip | |
(imenu-case-fold-search): New buffer-local variable.
| -rw-r--r-- | lisp/imenu.el | 17 |
1 files changed, 15 insertions, 2 deletions
diff --git a/lisp/imenu.el b/lisp/imenu.el index a054c756a23..eeaae1670fa 100644 --- a/lisp/imenu.el +++ b/lisp/imenu.el | |||
| @@ -186,7 +186,10 @@ For emacs-lisp-mode for example PATTERN would look like: | |||
| 186 | (\"*Vars*\" \"^\\\\s-*(def\\\\(var\\\\|const\\\\)\\\\s-+\\\\([-A-Za-z0-9+]+\\\\)\" 2) | 186 | (\"*Vars*\" \"^\\\\s-*(def\\\\(var\\\\|const\\\\)\\\\s-+\\\\([-A-Za-z0-9+]+\\\\)\" 2) |
| 187 | (\"*Types*\" \"^\\\\s-*(def\\\\(type\\\\|struct\\\\|class\\\\|ine-condition\\\\)\\\\s-+\\\\([-A-Za-z0-9+]+\\\\)\" 2)) | 187 | (\"*Types*\" \"^\\\\s-*(def\\\\(type\\\\|struct\\\\|class\\\\|ine-condition\\\\)\\\\s-+\\\\([-A-Za-z0-9+]+\\\\)\" 2)) |
| 188 | 188 | ||
| 189 | The variable is buffer-local.") | 189 | The variable is buffer-local. |
| 190 | |||
| 191 | The variable `imenu-case-fold-search' determines whether or not the | ||
| 192 | regexp matches are case sensitive.") | ||
| 190 | 193 | ||
| 191 | ;;;###autoload | 194 | ;;;###autoload |
| 192 | (make-variable-buffer-local 'imenu-generic-expression) | 195 | (make-variable-buffer-local 'imenu-generic-expression) |
| @@ -679,6 +682,15 @@ Their results are gathered into an index alist." | |||
| 679 | ;;; Generic index gathering function. | 682 | ;;; Generic index gathering function. |
| 680 | ;;; | 683 | ;;; |
| 681 | 684 | ||
| 685 | (defvar imenu-case-fold-search t | ||
| 686 | "Defines whether `imenu--generic-function' should fold case when matching. | ||
| 687 | |||
| 688 | This buffer-local variable should be set (only) by initialization code | ||
| 689 | for modes which use `imenu--generic-function'. If it is not set, that | ||
| 690 | function will use the current value of `case-fold-search' to match | ||
| 691 | patterns.") | ||
| 692 | (make-variable-buffer-local 'imenu-case-fold-search) | ||
| 693 | |||
| 682 | (defun imenu--generic-function (patterns) | 694 | (defun imenu--generic-function (patterns) |
| 683 | ;; Built on some ideas that Erik Naggum <erik@naggum.no> once posted | 695 | ;; Built on some ideas that Erik Naggum <erik@naggum.no> once posted |
| 684 | ;; to comp.emacs | 696 | ;; to comp.emacs |
| @@ -719,7 +731,8 @@ pattern. | |||
| 719 | (function (lambda (pattern) (identity (cadr pattern)))) | 731 | (function (lambda (pattern) (identity (cadr pattern)))) |
| 720 | patterns "\\)\\|\\(") | 732 | patterns "\\)\\|\\(") |
| 721 | "\\)")) | 733 | "\\)")) |
| 722 | prev-pos) | 734 | prev-pos |
| 735 | (case-fold-search imenu-case-fold-search)) | ||
| 723 | 736 | ||
| 724 | (goto-char (point-max)) | 737 | (goto-char (point-max)) |
| 725 | (imenu-progress-message prev-pos 0 t) | 738 | (imenu-progress-message prev-pos 0 t) |