unofficial mirror of bug-gnu-emacs@gnu.org 
 help / color / mirror / code / Atom feed
* bug#22147: Obsolete search-forward-lax-whitespace
@ 2015-12-11 23:52 Juri Linkov
  2015-12-12  0:44 ` Artur Malabarba
  0 siblings, 1 reply; 33+ messages in thread
From: Juri Linkov @ 2015-12-11 23:52 UTC (permalink / raw)
  To: 22147

After commit e5ece322 that removed a layer of indirection for lax-whitespace
it's not possible anymore to override search-forward-lax-whitespace
with own implementation to ignore all possible whitespace instead of
just spaces in the search string.

For example, such customization as this one:

(setq  search-whitespace-regexp "\\(\\s-\\|\n\\)+")
(defun search-whitespace-regexp (string)
  "Return a regexp which ignores all possible whitespace in search string.
Uses the value of the variable `search-whitespace-regexp'."
  (if (or (not (stringp search-whitespace-regexp))
          (null (if isearch-regexp
                    isearch-regexp-lax-whitespace
                  isearch-lax-whitespace)))
      string
    (replace-regexp-in-string
     search-whitespace-regexp
     search-whitespace-regexp
     string nil t)))
(defun search-forward-lax-whitespace (string &optional bound noerror count)
  (re-search-forward (search-whitespace-regexp (regexp-quote string)) bound noerror count))
(defun search-backward-lax-whitespace (string &optional bound noerror count)
  (re-search-backward (search-whitespace-regexp (regexp-quote string)) bound noerror count))
(defun re-search-forward-lax-whitespace (regexp &optional bound noerror count)
  (re-search-forward (search-whitespace-regexp regexp) bound noerror count))
(defun re-search-backward-lax-whitespace (regexp &optional bound noerror count)
  (re-search-backward (search-whitespace-regexp regexp) bound noerror count))

allowed to search for a string with a newline like ‘C-s abc C-q C-j def’
and match the text “abc def”.

It's not clear what to do with this customization now using
a replacement recommended in (make-obsolete old "instead, use (let
((search-spaces-regexp search-whitespace-regexp)) (re-search-... ...))"





^ permalink raw reply	[flat|nested] 33+ messages in thread

end of thread, other threads:[~2020-09-07 18:34 UTC | newest]

Thread overview: 33+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2015-12-11 23:52 bug#22147: Obsolete search-forward-lax-whitespace Juri Linkov
2015-12-12  0:44 ` Artur Malabarba
2015-12-12 23:31   ` Juri Linkov
2015-12-13  0:29     ` Artur Malabarba
2015-12-14  0:23       ` Juri Linkov
2015-12-14  1:11         ` Artur Malabarba
2015-12-14 23:58           ` Juri Linkov
2015-12-15 10:15             ` Artur Malabarba
2015-12-16  0:57               ` Juri Linkov
2015-12-16  1:47                 ` Drew Adams
2016-05-14 20:45                   ` Juri Linkov
2016-05-14 22:20                     ` Artur Malabarba
2016-05-14 22:27                       ` Drew Adams
2016-05-15 20:45                       ` Juri Linkov
2016-05-14 22:22                     ` Drew Adams
2016-05-15 20:56                       ` Juri Linkov
2016-05-15 21:51                         ` Drew Adams
2016-05-17 20:55                           ` Juri Linkov
2016-05-17 21:55                             ` Drew Adams
2016-05-18  3:00                               ` Artur Malabarba
2016-05-18 19:34                                 ` Juri Linkov
2016-05-18 20:40                                   ` Artur Malabarba
2016-05-30 20:57                                     ` Juri Linkov
2016-06-01 15:03                                       ` Artur Malabarba
2020-09-05 14:54                                         ` Lars Ingebrigtsen
2020-09-07 18:34                                           ` Juri Linkov
2015-12-16 10:59                 ` Artur Malabarba
2015-12-17  0:57                   ` Juri Linkov
2015-12-17 16:33                     ` Artur Malabarba
2015-12-17 17:21                       ` Drew Adams
2015-12-17 18:47                         ` Artur Malabarba
2015-12-17 22:16                           ` Drew Adams
2015-12-18  0:55                             ` Artur Malabarba

Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).