[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
isearch magic space
From: |
Chong Yidong |
Subject: |
isearch magic space |
Date: |
Tue, 15 Mar 2005 06:14:13 -0500 (EST) |
User-agent: |
SquirrelMail/1.4.3a |
Some time ago, I proposed providing a magic space for ordinary isearch.
The response was generally favorable, but my papers were not in order, so
the patch could not be applied. My copyright assignment is settled now;
can the patch be applied, or is it too late?
*** emacs/lisp/isearch.el~ Tue Mar 15 19:06:42 2005
--- emacs/lisp/isearch.el Tue Mar 15 19:15:49 2005
***************
*** 109,114 ****
--- 109,123 ----
:type 'boolean
:group 'isearch)
+ (defcustom search-string-whitespace-regexp "[ \t\r\n]+"
+ "*If non-nil, regular expression to match a sequence of whitespace chars.
+ This applies to ordinary (string) incremental search. When you
+ put a space or spaces in the incremental regexp, it stands for
+ this, unless it is inside of a regexp construct such as [...]
+ or *, + or ?."
+ :type 'regexp
+ :group 'isearch)
+
(defcustom search-whitespace-regexp "\\s-+"
"*If non-nil, regular expression to match a sequence of whitespace chars.
This applies to regular expression incremental search.
***************
*** 2027,2033 ****
(isearch-regexp
(if isearch-forward 're-search-forward 're-search-backward))
(t
! (if isearch-forward 'search-forward 'search-backward)))))
(defun isearch-search ()
;; Do the search with the current search string.
--- 2036,2051 ----
(isearch-regexp
(if isearch-forward 're-search-forward 're-search-backward))
(t
! (if isearch-forward
! 'isearch-search-forward 'isearch-search-backward)))))
!
! (defun isearch-search-forward (string &optional bound noerror count)
! (let ((search-spaces-regexp search-string-whitespace-regexp))
! (re-search-forward (regexp-quote string) bound noerror count)))
!
! (defun isearch-search-backward (string &optional bound noerror count)
! (let ((search-spaces-regexp search-string-whitespace-regexp))
! (re-search-backward (regexp-quote string) bound noerror count)))
(defun isearch-search ()
;; Do the search with the current search string.
- isearch magic space,
Chong Yidong <=