109 |
:type 'boolean |
:type 'boolean |
110 |
:group 'isearch) |
:group 'isearch) |
111 |
|
|
112 |
(defcustom search-whitespace-regexp "\\(?:\\s-+\\)" |
(defcustom search-whitespace-regexp "\\s-+" |
113 |
"*If non-nil, regular expression to match a sequence of whitespace chars. |
"*If non-nil, regular expression to match a sequence of whitespace chars. |
114 |
This applies to regular expression incremental search. |
This applies to regular expression incremental search. |
115 |
You might want to use something like \"\\\\(?:[ \\t\\r\\n]+\\\\)\" instead. |
When you put a space or spaces in the incremental regexp, it stands for |
116 |
In the Customization buffer, that is `\\(?:[' followed by a space, |
this, unless it is inside of a regexp construct such as [...] or *, + or ?. |
117 |
a tab, a carriage return (control-M), a newline, and `]+\\)'." |
You might want to use something like \"[ \\t\\r\\n]+\" instead. |
118 |
|
In the Customization buffer, that is `[' followed by a space, |
119 |
|
a tab, a carriage return (control-M), a newline, and `]+'." |
120 |
:type 'regexp |
:type 'regexp |
121 |
:group 'isearch) |
:group 'isearch) |
122 |
|
|
258 |
(define-key map "\r" 'isearch-exit) |
(define-key map "\r" 'isearch-exit) |
259 |
(define-key map "\C-j" 'isearch-printing-char) |
(define-key map "\C-j" 'isearch-printing-char) |
260 |
(define-key map "\t" 'isearch-printing-char) |
(define-key map "\t" 'isearch-printing-char) |
|
(define-key map " " 'isearch-whitespace-chars) |
|
|
(define-key map [?\S-\ ] 'isearch-whitespace-chars) |
|
261 |
|
|
262 |
(define-key map "\C-w" 'isearch-yank-word-or-char) |
(define-key map "\C-w" 'isearch-yank-word-or-char) |
263 |
(define-key map "\M-\C-w" 'isearch-del-char) |
(define-key map "\M-\C-w" 'isearch-del-char) |
481 |
Do incremental search forward for regular expression. |
Do incremental search forward for regular expression. |
482 |
With a prefix argument, do a regular string search instead. |
With a prefix argument, do a regular string search instead. |
483 |
Like ordinary incremental search except that your input |
Like ordinary incremental search except that your input |
484 |
is treated as a regexp. See \\[isearch-forward] for more info." |
is treated as a regexp. See \\[isearch-forward] for more info. |
485 |
|
|
486 |
|
In regexp incremental searches, a space or spaces normally matches |
487 |
|
any whitespace (the variable `search-whitespace-regexp' controls |
488 |
|
precisely what that means). If you want to search for a literal space |
489 |
|
and nothing else, enter `[ ]'." |
490 |
(interactive "P\np") |
(interactive "P\np") |
491 |
(isearch-mode t (null not-regexp) nil (not no-recursive-edit))) |
(isearch-mode t (null not-regexp) nil (not no-recursive-edit))) |
492 |
|
|
1677 |
;; Assume character codes 0200 - 0377 stand for characters in some |
;; Assume character codes 0200 - 0377 stand for characters in some |
1678 |
;; single-byte character set, and convert them to Emacs |
;; single-byte character set, and convert them to Emacs |
1679 |
;; characters. |
;; characters. |
1680 |
(and enable-multibyte-characters |
(if (and isearch-regexp (= char ?\ )) |
1681 |
(>= char ?\200) |
(if (subregexp-context-p isearch-string pos) |
1682 |
(<= char ?\377) |
(isearch-process-search-string "[ ]" " ") |
1683 |
(setq char (unibyte-char-to-multibyte char))) |
(isearch-process-search-char char)) |
1684 |
(isearch-process-search-char char))) |
(and enable-multibyte-characters |
1685 |
|
(>= char ?\200) |
1686 |
|
(<= char ?\377) |
1687 |
|
(setq char (unibyte-char-to-multibyte char))) |
1688 |
|
(isearch-process-search-char char)))) |
1689 |
|
|
1690 |
(defun isearch-return-char () |
(defun isearch-return-char () |
1691 |
"Convert return into newline for incremental search. |
"Convert return into newline for incremental search. |
1709 |
(isearch-process-search-multibyte-characters char) |
(isearch-process-search-multibyte-characters char) |
1710 |
(isearch-process-search-char char))))) |
(isearch-process-search-char char))))) |
1711 |
|
|
|
(defun isearch-whitespace-chars () |
|
|
"Match all whitespace chars, if in regexp mode. |
|
|
If you want to search for just a space, type \\<isearch-mode-map>\\[isearch-quote-char] SPC." |
|
|
(interactive) |
|
|
(if isearch-regexp |
|
|
(if (and search-whitespace-regexp (not isearch-within-brackets) |
|
|
(not isearch-invalid-regexp)) |
|
|
(isearch-process-search-string search-whitespace-regexp " ") |
|
|
(isearch-printing-char)) |
|
|
(progn |
|
|
;; This way of doing word search doesn't correctly extend current search. |
|
|
;; (setq isearch-word t) |
|
|
;; (setq isearch-adjusted t) |
|
|
;; (goto-char isearch-barrier) |
|
|
(isearch-printing-char)))) |
|
|
|
|
1712 |
(defun isearch-process-search-char (char) |
(defun isearch-process-search-char (char) |
1713 |
;; Append the char to the search string, update the message and re-search. |
;; Append the char to the search string, update the message and re-search. |
1714 |
(isearch-process-search-string |
(isearch-process-search-string |
1949 |
(let ((inhibit-point-motion-hooks search-invisible) |
(let ((inhibit-point-motion-hooks search-invisible) |
1950 |
(inhibit-quit nil) |
(inhibit-quit nil) |
1951 |
(case-fold-search isearch-case-fold-search) |
(case-fold-search isearch-case-fold-search) |
1952 |
|
(search-spaces-regexp search-whitespace-regexp) |
1953 |
(retry t)) |
(retry t)) |
1954 |
(if isearch-regexp (setq isearch-invalid-regexp nil)) |
(if isearch-regexp (setq isearch-invalid-regexp nil)) |
1955 |
(setq isearch-within-brackets nil) |
(setq isearch-within-brackets nil) |
2363 |
(defun isearch-lazy-highlight-search () |
(defun isearch-lazy-highlight-search () |
2364 |
"Search ahead for the next or previous match, for lazy highlighting. |
"Search ahead for the next or previous match, for lazy highlighting. |
2365 |
Attempt to do the search exactly the way the pending isearch would." |
Attempt to do the search exactly the way the pending isearch would." |
2366 |
(let ((case-fold-search isearch-case-fold-search)) |
(let ((case-fold-search isearch-case-fold-search) |
2367 |
|
(search-spaces-regexp search-whitespace-regexp)) |
2368 |
(funcall (isearch-search-fun) |
(funcall (isearch-search-fun) |
2369 |
isearch-string |
isearch-string |
2370 |
(if isearch-forward |
(if isearch-forward |