From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Tom Newsgroups: gmane.emacs.help 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) Message-ID: NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit X-Trace: ger.gmane.org 1457886736 30514 80.91.229.3 (13 Mar 2016 16:32:16 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Sun, 13 Mar 2016 16:32:16 +0000 (UTC) To: help-gnu-emacs@gnu.org Original-X-From: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Sun Mar 13 17:32:07 2016 Return-path: Envelope-to: geh-help-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([208.118.235.17]) by plane.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1af8w2-0005s7-Th for geh-help-gnu-emacs@m.gmane.org; Sun, 13 Mar 2016 17:32:07 +0100 Original-Received: from localhost ([::1]:36750 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1af8vz-00088g-5T for geh-help-gnu-emacs@m.gmane.org; Sun, 13 Mar 2016 12:32:03 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:57304) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1af8vo-00088Y-7t for help-gnu-emacs@gnu.org; Sun, 13 Mar 2016 12:31:53 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1af8vl-0001d7-2e for help-gnu-emacs@gnu.org; Sun, 13 Mar 2016 12:31:52 -0400 Original-Received: from plane.gmane.org ([80.91.229.3]:60493) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1af8vk-0001bK-S1 for help-gnu-emacs@gnu.org; Sun, 13 Mar 2016 12:31:48 -0400 Original-Received: from list by plane.gmane.org with local (Exim 4.69) (envelope-from ) id 1af8vj-0005jL-DQ for help-gnu-emacs@gnu.org; Sun, 13 Mar 2016 17:31:47 +0100 Original-Received: from 94-21-43-53.pool.digikabel.hu ([94.21.43.53]) by main.gmane.org with esmtp (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Sun, 13 Mar 2016 17:31:47 +0100 Original-Received: from adatgyujto by 94-21-43-53.pool.digikabel.hu with local (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Sun, 13 Mar 2016 17:31:47 +0100 X-Injected-Via-Gmane: http://gmane.org/ Original-Lines: 24 Original-X-Complaints-To: usenet@ger.gmane.org X-Gmane-NNTP-Posting-Host: sea.gmane.org User-Agent: Loom/3.14 (http://gmane.org/) X-Loom-IP: 94.21.43.53 (Mozilla/5.0 (Windows NT 6.3; WOW64; rv:44.0) Gecko/20100101 Firefox/44.0) X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 80.91.229.3 X-BeenThere: help-gnu-emacs@gnu.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: Users list for the GNU Emacs text editor List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Original-Sender: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.help:109557 Archived-At: 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.)