From: "Chong Yidong" <cyd@stupidchicken.com>
Subject: isearch magic space
Date: Tue, 15 Mar 2005 06:14:13 -0500 (EST) [thread overview]
Message-ID: <1491.220.255.169.59.1110885253.squirrel@220.255.169.59> (raw)
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.
next reply other threads:[~2005-03-15 11:14 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2005-03-15 11:14 Chong Yidong [this message]
2005-03-15 13:09 ` isearch magic space Juri Linkov
2005-03-15 15:00 ` Chong Yidong
2005-03-15 15:05 ` Chong Yidong
2005-03-18 3:18 ` Miles Bader
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1491.220.255.169.59.1110885253.squirrel@220.255.169.59 \
--to=cyd@stupidchicken.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
Code repositories for project(s) associated with this external index
https://git.savannah.gnu.org/cgit/emacs.git
https://git.savannah.gnu.org/cgit/emacs/org-mode.git
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.