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: Sun, 16 Feb 2003 18:53:46 -0500 Sender: emacs-devel-bounces+emacs-devel=quimby.gnus.org@gnu.org Message-ID: <200302162353.h1GNrkG24335@rum.cs.yale.edu> References: <3E26DA700109A72E@mel-rta8.wanadoo.fr> (added by postmaster@wanadoo.fr) NNTP-Posting-Host: main.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Trace: main.gmane.org 1045439619 5035 80.91.224.249 (16 Feb 2003 23:53:39 GMT) X-Complaints-To: usenet@main.gmane.org NNTP-Posting-Date: Sun, 16 Feb 2003 23:53:39 +0000 (UTC) Cc: emacs-devel Return-path: Original-Received: from quimby.gnus.org ([80.91.224.244]) by main.gmane.org with esmtp (Exim 3.35 #1 (Debian)) id 18kYbK-0001J4-00 for ; Mon, 17 Feb 2003 00:53:38 +0100 Original-Received: from monty-python.gnu.org ([199.232.76.173]) by quimby.gnus.org with esmtp (Exim 3.12 #1 (Debian)) id 18kYpS-000264-00 for ; Mon, 17 Feb 2003 01:08:15 +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 18kYdH-0000K4-07 for emacs-devel@quimby.gnus.org; Sun, 16 Feb 2003 18:55:39 -0500 Original-Received: from list by monty-python.gnu.org with tmda-scanned (Exim 4.10.13) id 18kYbf-0007rk-00 for emacs-devel@gnu.org; Sun, 16 Feb 2003 18:53:59 -0500 Original-Received: from mail by monty-python.gnu.org with spam-scanned (Exim 4.10.13) id 18kYbV-0007dN-00 for emacs-devel@gnu.org; Sun, 16 Feb 2003 18:53:50 -0500 Original-Received: from rum.cs.yale.edu ([128.36.229.169]) by monty-python.gnu.org with esmtp (Exim 4.10.13) id 18kYbU-0007az-00 for emacs-devel@gnu.org; Sun, 16 Feb 2003 18:53:48 -0500 Original-Received: (from monnier@localhost) by rum.cs.yale.edu (8.11.6/8.11.6) id h1GNrkG24335; Sun, 16 Feb 2003 18:53:46 -0500 X-Mailer: exmh version 2.4 06/23/2000 with nmh-1.0.4 Original-To: "David PONCE" 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:11689 X-Report-Spam: http://spam.gmane.org/gmane.emacs.devel:11689 > The problem is that `scheme-mode-syntax-table' is not initialized > with the syntax-table built in the let form, but with a standard > syntax table. 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 ? Stefan --- subr.el 4 Feb 2003 12:06:43 -0000 1.340 +++ subr.el 16 Feb 2003 23:52:07 -0000 @@ -1709,7 +1743,7 @@ parent)) (defmacro with-syntax-table (table &rest body) - "Evaluate BODY with syntax table of current buffer set to a copy of TABLE. + "Evaluate BODY with syntax table of current buffer set to TABLE. The syntax table of the current buffer is saved, BODY is evaluated, and the saved table is restored, even in case of an abnormal exit. Value is what BODY returns." @@ -1719,7 +1753,7 @@ (,old-buffer (current-buffer))) (unwind-protect (progn - (set-syntax-table (copy-syntax-table ,table)) + (set-syntax-table ,table) ,@body) (save-current-buffer (set-buffer ,old-buffer)