From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: =?UTF-8?Q?Andreas_R=c3=b6hler?= Newsgroups: gmane.emacs.help Subject: Re: Is it obvious that string-match syntax matching is affected by the current buffer? Date: Sun, 13 Mar 2016 17:52:32 +0100 Message-ID: <56E59AD0.5070302@easy-emacs.de> References: NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=windows-1252; format=flowed Content-Transfer-Encoding: 7bit X-Trace: ger.gmane.org 1457887897 14940 80.91.229.3 (13 Mar 2016 16:51:37 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Sun, 13 Mar 2016 16:51:37 +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:51:29 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 1af9El-0007Oh-QT for geh-help-gnu-emacs@m.gmane.org; Sun, 13 Mar 2016 17:51:27 +0100 Original-Received: from localhost ([::1]:36807 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1af9El-0004XF-81 for geh-help-gnu-emacs@m.gmane.org; Sun, 13 Mar 2016 12:51:27 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:60145) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1af9Eb-0004X7-1V for help-gnu-emacs@gnu.org; Sun, 13 Mar 2016 12:51:17 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1af9EW-0005oC-2C for help-gnu-emacs@gnu.org; Sun, 13 Mar 2016 12:51:16 -0400 Original-Received: from mout.kundenserver.de ([217.72.192.73]:58859) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1af9EV-0005o8-PC for help-gnu-emacs@gnu.org; Sun, 13 Mar 2016 12:51:11 -0400 Original-Received: from [192.168.178.35] ([95.119.43.24]) by mrelayeu.kundenserver.de (mreue101) with ESMTPSA (Nemesis) id 0LmLVi-1a6MRi0GkU-00ZuPQ for ; Sun, 13 Mar 2016 17:51:08 +0100 User-Agent: Mozilla/5.0 (X11; Linux i686; rv:38.0) Gecko/20100101 Icedove/38.5.0 In-Reply-To: X-Provags-ID: V03:K0:24Q7H0fFU5i1Lsj9Zqb7y76v0ZLn/wkpeEI/kxIydIJ11dR1gRu 3J9Vf7ZFzHoLb85iLRlRLz+qPDa9swAcn9DC6mi1vyKGL4IfWrX4cfSurQQCHnlkervpi1O NbeFFr/TWb2u9P8kf2mF367PDgP+fJD1N5iBZkhXIrcWXHochhvhjj1FqJCPf8W/W5gRXLG bsx0YZpvtSxiYVv+WFuag== X-UI-Out-Filterresults: notjunk:1;V01:K0:wFU1fCJ1KZk=:Pi3RZoB+yhOHY+sXBZ8pQf bJbdk9ahdjp9TdmOPA0rxgRprQ66ZIvHKX67qgfnxs5NwMcdoCzH9gKzzdKogKrUpdwp1sgF+ z+Y0SemAhM54onLUhH0Z8yf+oTEoRQWZPZMaBv3nwiqTdhBxpndpOQa6rDWgdnZ7dku1keS6q 2+8u1fNvDqYixf9eex3uppJmjiLTgbYMbQWioZO5cbcTc5f0MEM/dszBCcRZf54cHPCbpTY+7 5Jeo2Jp2o919qssni+VbGOiEy4nba5D4VhCpBeCEJag/eYxqRsL9S/9DsCc7UtGUlg+9eI4MD +ynKvTaV+CHAUh+09fbJ30TKXj1w7sj4KGLm6Gxzz2pKDL/CSAS7Sg65+ZejsTlLtEbHqaZ6r VnUzC/7swopheoBzzulsZqZ7NnqkSA8SAxK5oaxlvcepodvcNkef13fQaMcruU2/iqHM5TBMr Ccemz39miNdDlGUTJhbJ15WTg7whctEfoml2rnfwd+cKQ1dX7QpAcQQvTI+xk/AddbCvlRo+s dfdeNnlZ5KUr/zlUkx0STFlsV3d57ofPyYJ7ooos0SROVVrvc/OhJz3q3kDuEzSgz9cmN4a93 d4AQp0Fdi/PoEFELyngufBOaIDu0fwEpb52/kMohRwyEI6QunDqxcbLC7MbowvQyg39OIbn+1 R0xWGldr22BjAfLRfhH2AX55wupD747V00hXElCp1Nw14ppIfS0byzB9RWojZPH/Hx78ejqV1 q92Lnv/j5fXQkYdA X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 217.72.192.73 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:109558 Archived-At: On 13.03.2016 17:31, Tom wrote: > 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.) > > > string-match here is called from inside a let, so the settings there prevail. Also from inside let: "with-syntax-table tab" - whilst"tab" is also let-bound. Let protects against outer settings, so current-buffer or not seems not at stake.