* spam-stat.el (with-syntax-table): Remove with-syntax-table
authorJesper Harder <harder@ifa.au.dk>
Mon, 5 Jan 2004 18:18:53 +0000 (18:18 +0000)
committerJesper Harder <harder@ifa.au.dk>
Mon, 5 Jan 2004 18:18:53 +0000 (18:18 +0000)
definition.

* rfc2047.el (with-syntax-table): Remove with-syntax-table Emacs
20 compatibility code.

lisp/ChangeLog
lisp/rfc2047.el
lisp/spam-stat.el

index 7dce9b5..0b99ab4 100644 (file)
@@ -1,5 +1,11 @@
 2004-01-05  Jesper Harder  <harder@ifa.au.dk>
 
+       * spam-stat.el (with-syntax-table): Remove with-syntax-table
+       definition.
+
+       * rfc2047.el (with-syntax-table): Remove with-syntax-table Emacs
+       20 compatibility code.
+
        * spam.el (spam-point-at-eol): Replace with point-at-eol.
 
        * smime.el (smime-point-at-eol): Replace with point-at-eol.
index cc8f52f..4451e12 100644 (file)
 
 (eval-when-compile
   (require 'cl)
-  (defvar message-posting-charset)
-  (unless (fboundp 'with-syntax-table) ; not in Emacs 20
-    (defmacro with-syntax-table (table &rest body)
-      "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."
-      (let ((old-table (make-symbol "table"))
-           (old-buffer (make-symbol "buffer")))
-       `(let ((,old-table (syntax-table))
-              (,old-buffer (current-buffer)))
-          (unwind-protect
-              (progn
-                (set-syntax-table ,table)
-                ,@body)
-            (save-current-buffer
-              (set-buffer ,old-buffer)
-              (set-syntax-table ,old-table))))))))
+  (defvar message-posting-charset))
 
 (require 'qp)
 (require 'mm-util)
index e85e057..2f31f0e 100644 (file)
@@ -203,26 +203,6 @@ This is set by hooking into Gnus.")
     ;; alias puthash is missing from Emacs 20 cl-extra.el
     (defalias 'puthash 'cl-puthash)))
 
-(eval-when-compile
-  (unless (fboundp 'with-syntax-table)
-    ;; Imported from Emacs 21.2
-    (defmacro with-syntax-table (table &rest body) "\
-Evaluate BODY with syntax table of current buffer set to a copy of 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."
-      (let ((old-table (make-symbol "table"))
-           (old-buffer (make-symbol "buffer")))
-       `(let ((,old-table (syntax-table))
-              (,old-buffer (current-buffer)))
-          (unwind-protect
-              (progn
-                (set-syntax-table (copy-syntax-table ,table))
-                ,@body)
-            (save-current-buffer
-              (set-buffer ,old-buffer)
-              (set-syntax-table ,old-table))))))))
-
 ;; Hooking into Gnus
 
 (defun spam-stat-store-current-buffer ()