aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRichard M. Stallman1994-05-03 08:27:40 +0000
committerRichard M. Stallman1994-05-03 08:27:40 +0000
commit4453091dd3f92858b8b368d90915eb306d1eeeb6 (patch)
treee0ec32ebfef5e3d8cb35e890a183ba58e4a3a62f
parenta874c10477ffc0117be7ae3fa95846e88ad10e7d (diff)
downloademacs-4453091dd3f92858b8b368d90915eb306d1eeeb6.tar.gz
emacs-4453091dd3f92858b8b368d90915eb306d1eeeb6.zip
(isearch-case-fold-search): new possible value `yes'
is like t except that mixed case in search string is ignored. (isearch-toggle-case-fold): New function. (isearch-search): Don't undo the work of isearch-toggle-case-fold.
-rw-r--r--lisp/isearch.el23
1 files changed, 20 insertions, 3 deletions
diff --git a/lisp/isearch.el b/lisp/isearch.el
index d172dcef284..ec86de79cdf 100644
--- a/lisp/isearch.el
+++ b/lisp/isearch.el
@@ -4,7 +4,7 @@
4 4
5;; Author: Daniel LaLiberte <liberte@cs.uiuc.edu> 5;; Author: Daniel LaLiberte <liberte@cs.uiuc.edu>
6 6
7;; |$Date: 1994/01/21 04:19:19 $|$Revision: 1.64 $ 7;; |$Date: 1994/04/07 20:28:23 $|$Revision: 1.65 $
8 8
9;; This file is part of GNU Emacs. 9;; This file is part of GNU Emacs.
10 10
@@ -301,6 +301,7 @@ Default value, nil, means edit the string instead.")
301 301
302;; Some bindings you may want to put in your isearch-mode-hook. 302;; Some bindings you may want to put in your isearch-mode-hook.
303;; Suggest some alternates... 303;; Suggest some alternates...
304;; (define-key isearch-mode-map "\C-t" 'isearch-toggle-case-fold)
304;; (define-key isearch-mode-map "\C-t" 'isearch-toggle-regexp) 305;; (define-key isearch-mode-map "\C-t" 'isearch-toggle-regexp)
305;; (define-key isearch-mode-map "\C-^" 'isearch-edit-string) 306;; (define-key isearch-mode-map "\C-^" 'isearch-edit-string)
306 307
@@ -339,7 +340,10 @@ Default value, nil, means edit the string instead.")
339(defvar isearch-wrapped nil) ; Searching restarted from the top (bottom). 340(defvar isearch-wrapped nil) ; Searching restarted from the top (bottom).
340(defvar isearch-barrier 0) 341(defvar isearch-barrier 0)
341 342
342(defvar isearch-case-fold-search nil) ; case-fold-search while searching. 343; case-fold-search while searching.
344; either nil, t, or 'yes. 'yes means the same as t except that mixed
345; case in the search string is ignored.
346(defvar isearch-case-fold-search nil)
343 347
344(defvar isearch-adjusted nil) 348(defvar isearch-adjusted nil)
345(defvar isearch-slow-terminal-mode nil) 349(defvar isearch-slow-terminal-mode nil)
@@ -875,6 +879,19 @@ Use `isearch-exit' to quit without signalling."
875 (if isearch-regexp (setq isearch-word nil)) 879 (if isearch-regexp (setq isearch-word nil))
876 (isearch-update)) 880 (isearch-update))
877 881
882(defun isearch-toggle-case-fold ()
883 "Toggle case folding in searching on or off."
884 (interactive)
885 (setq isearch-case-fold-search
886 (if isearch-case-fold-search nil 'yes))
887 (message "%s%s [case %ssensitive]"
888 (isearch-message-prefix)
889 isearch-message
890 (if isearch-case-fold-search "in" ""))
891 (setq isearch-adjusted t)
892 (sit-for 1)
893 (isearch-update))
894
878(defun isearch-delete-char () 895(defun isearch-delete-char ()
879 "Discard last input item and move point back. 896 "Discard last input item and move point back.
880If no previous match was done, just beep." 897If no previous match was done, just beep."
@@ -1306,7 +1323,7 @@ If there is no completion possible, say so and continue searching."
1306(defun isearch-search () 1323(defun isearch-search ()
1307 ;; Do the search with the current search string. 1324 ;; Do the search with the current search string.
1308 (isearch-message nil t) 1325 (isearch-message nil t)
1309 (if (and isearch-case-fold-search search-upper-case) 1326 (if (and (eq isearch-case-fold-search t) search-upper-case)
1310 (setq isearch-case-fold-search 1327 (setq isearch-case-fold-search
1311 (isearch-no-upper-case-p isearch-string isearch-regexp))) 1328 (isearch-no-upper-case-p isearch-string isearch-regexp)))
1312 (condition-case lossage 1329 (condition-case lossage