aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRichard M. Stallman1994-01-15 16:24:47 +0000
committerRichard M. Stallman1994-01-15 16:24:47 +0000
commitc5f6b35625231dd32a479a05669b33d5baed68f0 (patch)
tree95376e29f879c1ebad9babb57411c8c656e81fe6
parent81860e46eba7ec673a69223d07566e427ea43799 (diff)
downloademacs-c5f6b35625231dd32a479a05669b33d5baed68f0.tar.gz
emacs-c5f6b35625231dd32a479a05669b33d5baed68f0.zip
SPC is not special in regexp within brackets.
(isearch-within-brackets): New variable. (isearch-mode): Set that. (isearch-edit-string): Bind that. (isearch-search-and-update): Set that. (isearch-top-state): Set that. (isearch-push-state): Use that. (isearch-search): Set that.
-rw-r--r--lisp/isearch.el17
1 files changed, 13 insertions, 4 deletions
diff --git a/lisp/isearch.el b/lisp/isearch.el
index 8044ca0dcfe..b7534ba737b 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/02 17:43:16 $|$Revision: 1.59 $ 7;; |$Date: 1994/01/10 22:27:52 $|$Revision: 1.60 $
8 8
9;; This file is part of GNU Emacs. 9;; This file is part of GNU Emacs.
10 10
@@ -335,6 +335,7 @@ Default value, nil, means edit the string instead.")
335 335
336(defvar isearch-success t) ; Searching is currently successful. 336(defvar isearch-success t) ; Searching is currently successful.
337(defvar isearch-invalid-regexp nil) ; Regexp not well formed. 337(defvar isearch-invalid-regexp nil) ; Regexp not well formed.
338(defvar isearch-within-brackets nil) ; Regexp has unclosed [.
338(defvar isearch-other-end nil) ; Start (end) of match if forward (backward). 339(defvar isearch-other-end nil) ; Start (end) of match if forward (backward).
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)
@@ -492,6 +493,7 @@ is treated as a regexp. See \\[isearch-forward] for more info."
492 isearch-adjusted nil 493 isearch-adjusted nil
493 isearch-yank-flag nil 494 isearch-yank-flag nil
494 isearch-invalid-regexp nil 495 isearch-invalid-regexp nil
496 isearch-within-brackets nil
495 ;; Use (baud-rate) for now, for sake of other versions. 497 ;; Use (baud-rate) for now, for sake of other versions.
496 isearch-slow-terminal-mode (and (<= (baud-rate) search-slow-speed) 498 isearch-slow-terminal-mode (and (<= (baud-rate) search-slow-speed)
497 (> (window-height) 499 (> (window-height)
@@ -699,6 +701,7 @@ If first char entered is \\[isearch-yank-word], then do word search instead."
699 (isearch-adjusted isearch-adjusted) 701 (isearch-adjusted isearch-adjusted)
700 (isearch-yank-flag isearch-yank-flag) 702 (isearch-yank-flag isearch-yank-flag)
701 (isearch-invalid-regexp isearch-invalid-regexp) 703 (isearch-invalid-regexp isearch-invalid-regexp)
704 (isearch-within-brackets isearch-within-brackets)
702 (isearch-other-end isearch-other-end) 705 (isearch-other-end isearch-other-end)
703 (isearch-opoint isearch-opoint) 706 (isearch-opoint isearch-opoint)
704 (isearch-slow-terminal-mode isearch-slow-terminal-mode) 707 (isearch-slow-terminal-mode isearch-slow-terminal-mode)
@@ -956,6 +959,7 @@ If no previous match was done, just beep."
956 (min isearch-opoint isearch-barrier)))) 959 (min isearch-opoint isearch-barrier))))
957 (setq isearch-success t 960 (setq isearch-success t
958 isearch-invalid-regexp nil 961 isearch-invalid-regexp nil
962 isearch-within-brackets nil
959 isearch-other-end (match-end 0)) 963 isearch-other-end (match-end 0))
960 ;; Not regexp, not reverse, or no match at point. 964 ;; Not regexp, not reverse, or no match at point.
961 (if (and isearch-other-end (not isearch-adjusted)) 965 (if (and isearch-other-end (not isearch-adjusted))
@@ -1068,7 +1072,7 @@ Obsolete."
1068If you want to search for just a space, type C-q SPC." 1072If you want to search for just a space, type C-q SPC."
1069 (interactive) 1073 (interactive)
1070 (if isearch-regexp 1074 (if isearch-regexp
1071 (if search-whitespace-regexp 1075 (if (and search-whitespace-regexp (not isearch-within-brackets))
1072 (isearch-process-search-string search-whitespace-regexp " ") 1076 (isearch-process-search-string search-whitespace-regexp " ")
1073 (isearch-printing-char)) 1077 (isearch-printing-char))
1074 (progn 1078 (progn
@@ -1236,7 +1240,8 @@ If there is no completion possible, say so and continue searching."
1236 isearch-word (nth 6 cmd) 1240 isearch-word (nth 6 cmd)
1237 isearch-invalid-regexp (nth 7 cmd) 1241 isearch-invalid-regexp (nth 7 cmd)
1238 isearch-wrapped (nth 8 cmd) 1242 isearch-wrapped (nth 8 cmd)
1239 isearch-barrier (nth 9 cmd)) 1243 isearch-barrier (nth 9 cmd)
1244 isearch-within-brackets (nth 10 cmd))
1240 (goto-char (car (cdr (cdr cmd)))))) 1245 (goto-char (car (cdr (cdr cmd))))))
1241 1246
1242(defun isearch-pop-state () 1247(defun isearch-pop-state ()
@@ -1249,7 +1254,8 @@ If there is no completion possible, say so and continue searching."
1249 (cons (list isearch-string isearch-message (point) 1254 (cons (list isearch-string isearch-message (point)
1250 isearch-success isearch-forward isearch-other-end 1255 isearch-success isearch-forward isearch-other-end
1251 isearch-word 1256 isearch-word
1252 isearch-invalid-regexp isearch-wrapped isearch-barrier) 1257 isearch-invalid-regexp isearch-wrapped isearch-barrier
1258 isearch-within-brackets)
1253 isearch-cmds))) 1259 isearch-cmds)))
1254 1260
1255 1261
@@ -1308,6 +1314,7 @@ If there is no completion possible, say so and continue searching."
1308 (let ((inhibit-quit nil) 1314 (let ((inhibit-quit nil)
1309 (case-fold-search isearch-case-fold-search)) 1315 (case-fold-search isearch-case-fold-search))
1310 (if isearch-regexp (setq isearch-invalid-regexp nil)) 1316 (if isearch-regexp (setq isearch-invalid-regexp nil))
1317 (setq isearch-within-brackets nil)
1311 (setq isearch-success 1318 (setq isearch-success
1312 (funcall 1319 (funcall
1313 (cond (isearch-word 1320 (cond (isearch-word
@@ -1328,6 +1335,8 @@ If there is no completion possible, say so and continue searching."
1328 1335
1329 (invalid-regexp 1336 (invalid-regexp
1330 (setq isearch-invalid-regexp (car (cdr lossage))) 1337 (setq isearch-invalid-regexp (car (cdr lossage)))
1338 (setq isearch-within-brackets (string-match "\\`Unmatched \\["
1339 isearch-invalid-regexp))
1331 (if (string-match 1340 (if (string-match
1332 "\\`Premature \\|\\`Unmatched \\|\\`Invalid " 1341 "\\`Premature \\|\\`Unmatched \\|\\`Invalid "
1333 isearch-invalid-regexp) 1342 isearch-invalid-regexp)