Action 1: evaluate the lisp expression: (search-forward-regexp "\\s'")
in a buffer in lisp-interaction-mode
containing the text:
The pandemic market was cooling, but homes in north Seattle were still going for over asking price. 'A few homes they were interested in received multiple offers,' she said, 'and sold for 10 to 15 percent over list price.'
Result 1: the comma after "cooling" will be found.
Action 2: evaluate the exact same expression above in another buffer, containing the exact same text, except that this time the bufer is in text-mode
.
Result 2: nothing will be found and a search-failed
error is issued.
The question is thus: what justifies this weird behavior?
I cannot understand why a buffer's mode would affect the
behavior of search-forward-regexp
. It totally
blows my mind that the "comma" is found in the first case.
Regarding the second case, things are still incomprehensible since
"\\s"
is described in the manual as
Match whitespace, it is a synonym for ‘[[:space:]]’
so the second search should match the space before "A few homes" followed by the single quote.
Could I possibly be interpreting things in the wrong way?
grep
manual, which explains the confusion.