[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
bug#22147: Obsolete search-forward-lax-whitespace
From: |
Juri Linkov |
Subject: |
bug#22147: Obsolete search-forward-lax-whitespace |
Date: |
Sat, 12 Dec 2015 01:52:03 +0200 |
User-agent: |
Gnus/5.13 (Gnus v5.13) Emacs/25.1.50 (x86_64-pc-linux-gnu) |
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-... ...))"
- bug#22147: Obsolete search-forward-lax-whitespace,
Juri Linkov <=
- bug#22147: Obsolete search-forward-lax-whitespace, Artur Malabarba, 2015/12/11
- bug#22147: Obsolete search-forward-lax-whitespace, Juri Linkov, 2015/12/12
- bug#22147: Obsolete search-forward-lax-whitespace, Artur Malabarba, 2015/12/12
- bug#22147: Obsolete search-forward-lax-whitespace, Juri Linkov, 2015/12/13
- bug#22147: Obsolete search-forward-lax-whitespace, Artur Malabarba, 2015/12/13
- bug#22147: Obsolete search-forward-lax-whitespace, Juri Linkov, 2015/12/14
- bug#22147: Obsolete search-forward-lax-whitespace, Artur Malabarba, 2015/12/15
- bug#22147: Obsolete search-forward-lax-whitespace, Juri Linkov, 2015/12/15
- bug#22147: Obsolete search-forward-lax-whitespace, Drew Adams, 2015/12/15
- bug#22147: Obsolete search-forward-lax-whitespace, Artur Malabarba, 2015/12/16