diff options
| author | Richard M. Stallman <rms@gnu.org> | 1998-05-26 20:55:22 +0000 |
|---|---|---|
| committer | Richard M. Stallman <rms@gnu.org> | 1998-05-26 20:55:22 +0000 |
| commit | 6e30a99a10037e7a5e962bb1c2b92e7780f19a10 (patch) | |
| tree | 17d35a99b1fbd51aacaa7795f4bf9edfcff5e728 /lisp | |
| parent | fdc4f7a08a5f7e0623eef831f1231edb6ffa5e9e (diff) | |
| download | emacs-6e30a99a10037e7a5e962bb1c2b92e7780f19a10.tar.gz | |
(minibuffer-history-case-insensitive-variables): New var.
(previous-matching-history-element): Implement it.
Diffstat (limited to 'lisp')
| -rw-r--r-- | lisp/simple.el | 19 |
1 files changed, 16 insertions, 3 deletions
diff --git a/lisp/simple.el b/lisp/simple.el index e025788bb70..96f77b95cd6 100644 --- a/lisp/simple.el +++ b/lisp/simple.el @@ -652,12 +652,21 @@ in this use of the minibuffer.") (defun minibuffer-history-initialize () (setq minibuffer-text-before-history nil)) +(defcustom minibuffer-history-case-insensitive-variables nil + "*Minibuffer history variables for which matching should ignore case. +If a history variable is a member of this list, then the +\\[previous-matching-history-element] and \\[next-matching-history-element]\ + commands ignore case when searching it, regardless of `case-fold-search'." + :type '(repeat variable) + :group 'minibuffer) + (defun previous-matching-history-element (regexp n) "Find the previous history element that matches REGEXP. \(Previous history elements refer to earlier actions.) With prefix argument N, search for Nth previous match. If N is negative, find the next or Nth next match. -An uppercase letter in REGEXP makes the search case-sensitive." +An uppercase letter in REGEXP makes the search case-sensitive. +See also `minibuffer-history-case-insensitive-variables'." (interactive (let* ((enable-recursive-minibuffers t) (regexp (read-from-minibuffer "Previous element matching (regexp): " @@ -678,8 +687,12 @@ An uppercase letter in REGEXP makes the search case-sensitive." (let ((history (symbol-value minibuffer-history-variable)) (case-fold-search (if (isearch-no-upper-case-p regexp t) ; assume isearch.el is dumped - ;; Respect the user's setting for case-fold-search: - case-fold-search + ;; On some systems, ignore case for file names. + (if (memq minibuffer-history-variable + minibuffer-history-case-insensitive-variables) + t + ;; Respect the user's setting for case-fold-search: + case-fold-search) nil)) prevpos (pos minibuffer-history-position)) |
