From mboxrd@z Thu Jan 1 00:00:00 1970 Path: main.gmane.org!not-for-mail From: "Stefan Monnier" Newsgroups: gmane.emacs.devel Subject: Re: scheme.el bug & fix Date: Mon, 17 Feb 2003 09:39:17 -0500 Sender: emacs-devel-bounces+emacs-devel=quimby.gnus.org@gnu.org Message-ID: <200302171439.h1HEdH926957@rum.cs.yale.edu> References: <3E26DA700109A72E@mel-rta8.wanadoo.fr> (added by postmaster@wanadoo.fr) <200302162353.h1GNrkG24335@rum.cs.yale.edu> <200302170105.TAA17107@eel.dms.auburn.edu> NNTP-Posting-Host: main.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Trace: main.gmane.org 1045493326 25131 80.91.224.249 (17 Feb 2003 14:48:46 GMT) X-Complaints-To: usenet@main.gmane.org NNTP-Posting-Date: Mon, 17 Feb 2003 14:48:46 +0000 (UTC) Cc: monnier+gnu/emacs@rum.cs.yale.edu Return-path: Original-Received: from quimby.gnus.org ([80.91.224.244]) by main.gmane.org with esmtp (Exim 3.35 #1 (Debian)) id 18kmZ3-0006Vk-00 for ; Mon, 17 Feb 2003 15:48:13 +0100 Original-Received: from monty-python.gnu.org ([199.232.76.173]) by quimby.gnus.org with esmtp (Exim 3.12 #1 (Debian)) id 18kmnU-0001xW-00 for ; Mon, 17 Feb 2003 16:03:08 +0100 Original-Received: from localhost ([127.0.0.1] helo=monty-python.gnu.org) by monty-python.gnu.org with esmtp (Exim 4.10.13) id 18kmVX-0003OE-04 for emacs-devel@quimby.gnus.org; Mon, 17 Feb 2003 09:44:35 -0500 Original-Received: from list by monty-python.gnu.org with tmda-scanned (Exim 4.10.13) id 18kmTD-0001yU-00 for emacs-devel@gnu.org; Mon, 17 Feb 2003 09:42:11 -0500 Original-Received: from mail by monty-python.gnu.org with spam-scanned (Exim 4.10.13) id 18kmQR-00005g-00 for emacs-devel@gnu.org; Mon, 17 Feb 2003 09:39:22 -0500 Original-Received: from rum.cs.yale.edu ([128.36.229.169]) by monty-python.gnu.org with esmtp (Exim 4.10.13) id 18kmQR-00005I-00 for emacs-devel@gnu.org; Mon, 17 Feb 2003 09:39:19 -0500 Original-Received: (from monnier@localhost) by rum.cs.yale.edu (8.11.6/8.11.6) id h1HEdH926957; Mon, 17 Feb 2003 09:39:17 -0500 X-Mailer: exmh version 2.4 06/23/2000 with nmh-1.0.4 Original-To: Luc Teirlinck Original-cc: David.Ponce@wanadoo.fr Original-cc: emacs-devel@gnu.org X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1b5 Precedence: list List-Id: Emacs development discussions. List-Help: List-Post: List-Subscribe: , List-Archive: List-Unsubscribe: , Errors-To: emacs-devel-bounces+emacs-devel=quimby.gnus.org@gnu.org Xref: main.gmane.org gmane.emacs.devel:11709 X-Report-Spam: http://spam.gmane.org/gmane.emacs.devel:11709 > It turns out the problem is that > > (with-syntax-table st (modify-syntex-entry foo bar)) > > does not modify `st' because `with-syntax-table' does not use `st' > but a copy of it. Actually it's even documented in the docstring. > This sounds silly. Does anybody have an idea why it is defined that way ? > If not, any objection the patch below which should also improve > (very marginally) the performance of Emacs ? > > Are you sure that you are not going to break plenty of existing code > this way? I grepped through lisp/**/*.el and couldn't find a single case where the table needed to be copied. > People could very legitimately have relied on the present > behavior, which is, as you state yourself, very explicitly mentioned > in the doc string. The reason for the "silly" behavior seems obvious: > to avoid accidental modification of st. But it is extremely rare to use modify-syntax-entry with no third argument and within a with-syntax-table thing, so the risk of accidental modification is basically inexistent. As a matter of fact, syntax-tables are very rarely modified at all, other than when they're created. > Is there any reason why scheme.el can not possibly define its syntax > table in a more standard and more natural way? Of course, it can. That's a separate question. Please someone install the patch as soon as you can: it's obviously the right thing to do. > (I believe it is meant to very temporarily change the syntax table of > the current buffer, not to be used to actually define syntax tables.) Indeed, and you don't want this temporary syntax-table-switch to make a copy of the table and then drop it on the floor (turning it into garbage) unless there's a very good reason for it. For example with-category-table does not copy the table. Stefan