unofficial mirror of emacs-devel@gnu.org 
 help / color / mirror / code / Atom feed
From: "Stefan Monnier" <monnier+gnu/emacs@rum.cs.yale.edu>
Cc: emacs-devel <emacs-devel@gnu.org>
Subject: Re: scheme.el bug & fix
Date: Sun, 16 Feb 2003 18:53:46 -0500	[thread overview]
Message-ID: <200302162353.h1GNrkG24335@rum.cs.yale.edu> (raw)
In-Reply-To: 3E26DA700109A72E@mel-rta8.wanadoo.fr

> 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)

       reply	other threads:[~2003-02-16 23:53 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <3E26DA700109A72E@mel-rta8.wanadoo.fr>
2003-02-16 23:53 ` Stefan Monnier [this message]
2003-02-17  1:05   ` scheme.el bug & fix Luc Teirlinck
2003-02-17 10:19     ` Kim F. Storm
2003-02-17  9:34       ` Miles Bader
2003-02-17 20:37       ` Richard Stallman
2003-02-17 14:39     ` Stefan Monnier
2003-02-18  0:30       ` Luc Teirlinck
2003-02-18 15:33         ` Stefan Monnier
2003-02-19  7:17           ` Richard Stallman
2003-02-19 14:31             ` Stefan Monnier
2003-02-19 15:11               ` Miles Bader
2003-02-20 18:21               ` Richard Stallman
2003-02-20 20:14                 ` Stefan Monnier
2003-04-14  1:21                   ` Luc Teirlinck

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://www.gnu.org/software/emacs/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=200302162353.h1GNrkG24335@rum.cs.yale.edu \
    --to=monnier+gnu/emacs@rum.cs.yale.edu \
    --cc=emacs-devel@gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).