I did a word constituent match with string-match and a question
occured to me: what controls what is considered word constituent
in this case?
I checked info, but I saw no mention of this, so I did a test and
yes, the current syntax table affects string-match:
(let ((tab (make-syntax-table)))
(modify-syntax-entry ?a " " tab)
(with-syntax-table tab
(string-match "\\s-" "a")))
Isn't a strange? E.g. I'm doing a string match in elisp, so I'm
not working with the current buffer, yet its active syntax table
affects the result of string-match. Seems to me these are
different domains and string-match should have its own
string-match-syntax-table or something, so there can be no
match side effects depending on the currently active buffer.
Do you think it's obvious for the elisp users that string-match
is affected by the current buffer? Maybe the documentation should
mention this. (Maybe it does, but I didn't see it.)