aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRichard M. Stallman1998-05-26 20:55:22 +0000
committerRichard M. Stallman1998-05-26 20:55:22 +0000
commit6e30a99a10037e7a5e962bb1c2b92e7780f19a10 (patch)
tree17d35a99b1fbd51aacaa7795f4bf9edfcff5e728
parentfdc4f7a08a5f7e0623eef831f1231edb6ffa5e9e (diff)
downloademacs-6e30a99a10037e7a5e962bb1c2b92e7780f19a10.tar.gz
emacs-6e30a99a10037e7a5e962bb1c2b92e7780f19a10.zip
(minibuffer-history-case-insensitive-variables): New var.
(previous-matching-history-element): Implement it.
-rw-r--r--lisp/simple.el19
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.")
652(defun minibuffer-history-initialize () 652(defun minibuffer-history-initialize ()
653 (setq minibuffer-text-before-history nil)) 653 (setq minibuffer-text-before-history nil))
654 654
655(defcustom minibuffer-history-case-insensitive-variables nil
656 "*Minibuffer history variables for which matching should ignore case.
657If a history variable is a member of this list, then the
658\\[previous-matching-history-element] and \\[next-matching-history-element]\
659 commands ignore case when searching it, regardless of `case-fold-search'."
660 :type '(repeat variable)
661 :group 'minibuffer)
662
655(defun previous-matching-history-element (regexp n) 663(defun previous-matching-history-element (regexp n)
656 "Find the previous history element that matches REGEXP. 664 "Find the previous history element that matches REGEXP.
657\(Previous history elements refer to earlier actions.) 665\(Previous history elements refer to earlier actions.)
658With prefix argument N, search for Nth previous match. 666With prefix argument N, search for Nth previous match.
659If N is negative, find the next or Nth next match. 667If N is negative, find the next or Nth next match.
660An uppercase letter in REGEXP makes the search case-sensitive." 668An uppercase letter in REGEXP makes the search case-sensitive.
669See also `minibuffer-history-case-insensitive-variables'."
661 (interactive 670 (interactive
662 (let* ((enable-recursive-minibuffers t) 671 (let* ((enable-recursive-minibuffers t)
663 (regexp (read-from-minibuffer "Previous element matching (regexp): " 672 (regexp (read-from-minibuffer "Previous element matching (regexp): "
@@ -678,8 +687,12 @@ An uppercase letter in REGEXP makes the search case-sensitive."
678 (let ((history (symbol-value minibuffer-history-variable)) 687 (let ((history (symbol-value minibuffer-history-variable))
679 (case-fold-search 688 (case-fold-search
680 (if (isearch-no-upper-case-p regexp t) ; assume isearch.el is dumped 689 (if (isearch-no-upper-case-p regexp t) ; assume isearch.el is dumped
681 ;; Respect the user's setting for case-fold-search: 690 ;; On some systems, ignore case for file names.
682 case-fold-search 691 (if (memq minibuffer-history-variable
692 minibuffer-history-case-insensitive-variables)
693 t
694 ;; Respect the user's setting for case-fold-search:
695 case-fold-search)
683 nil)) 696 nil))
684 prevpos 697 prevpos
685 (pos minibuffer-history-position)) 698 (pos minibuffer-history-position))