[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Is it obvious that string-match syntax matching is affected by the curre
From: |
Tom |
Subject: |
Is it obvious that string-match syntax matching is affected by the current buffer? |
Date: |
Sun, 13 Mar 2016 16:31:42 +0000 (UTC) |
User-agent: |
Loom/3.14 (http://gmane.org/) |
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.)
- Is it obvious that string-match syntax matching is affected by the current buffer?,
Tom <=
- Re: Is it obvious that string-match syntax matching is affected by the current buffer?, Andreas Röhler, 2016/03/13
- Re: Is it obvious that string-match syntax matching is affected by the current buffer?, Tom, 2016/03/13
- Re: Is it obvious that string-match syntax matching is affected by the current buffer?, Eli Zaretskii, 2016/03/13
- Re: Is it obvious that string-match syntax matching is affected by the current buffer?, Tom, 2016/03/13
- Re: Is it obvious that string-match syntax matching is affected by the current buffer?, Eli Zaretskii, 2016/03/13
- Re: Is it obvious that string-match syntax matching is affected by the current buffer?, Stefan Monnier, 2016/03/13
- RE: Is it obvious that string-match syntax matching is affected by the current buffer?, Drew Adams, 2016/03/13