changeset 20510:d175ee25287e

(previous-matching-history-element): Bind case-fold-search to nil if REGEXP contains an uppercase letter. (previous-matching-history-element, next-matching-history-element): Doc fixes.
author Richard M. Stallman <rms@gnu.org>
date Mon, 22 Dec 1997 21:33:35 +0000
parents b0d79b1edeb6
children 9a051580fa02
files lisp/simple.el
diffstat 1 files changed, 9 insertions(+), 2 deletions(-) [+]
line wrap: on
line diff
--- a/lisp/simple.el	Mon Dec 22 19:26:10 1997 +0000
+++ b/lisp/simple.el	Mon Dec 22 21:33:35 1997 +0000
@@ -638,7 +638,8 @@
   "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."
+If N is negative, find the next or Nth next match.
+An uppercase letter in REGEXP makes the search case-sensitive."
   (interactive
    (let* ((enable-recursive-minibuffers t)
 	  (regexp (read-from-minibuffer "Previous element matching (regexp): "
@@ -657,6 +658,11 @@
 	   (null minibuffer-text-before-history))
       (setq minibuffer-text-before-history (buffer-string)))
   (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
+	   nil))
 	prevpos
 	(pos minibuffer-history-position))
     (while (/= n 0)
@@ -689,7 +695,8 @@
   "Find the next history element that matches REGEXP.
 \(The next history element refers to a more recent action.)
 With prefix argument N, search for Nth next match.
-If N is negative, find the previous or Nth previous match."
+If N is negative, find the previous or Nth previous match.
+An uppercase letter in REGEXP makes the search case-sensitive."
   (interactive
    (let* ((enable-recursive-minibuffers t)
 	  (regexp (read-from-minibuffer "Next element matching (regexp): "