]> git.eshelyaron.com Git - emacs.git/commitdiff
* subr.el (with-case-table): New macro.
authorChong Yidong <cyd@stupidchicken.com>
Wed, 4 Apr 2007 15:34:43 +0000 (15:34 +0000)
committerChong Yidong <cyd@stupidchicken.com>
Wed, 4 Apr 2007 15:34:43 +0000 (15:34 +0000)
lisp/subr.el

index 4cc2a34c1c906e52e6c4196aaacd25d41eeede43..1a49ae6c73e8621f38b650aed3285b84227d88f3 100644 (file)
@@ -2480,6 +2480,16 @@ in BODY."
        (let ((combine-after-change-calls t))
         . ,body)
      (combine-after-change-execute)))
+
+(defmacro with-case-table (table &rest body)
+  "Execute the forms in BODY with TABLE as the current case table.
+The value returned is the value of the last form in BODY."
+  (declare (indent 1) (debug t))
+  `(let ((old-case-table (current-case-table)))
+     (unwind-protect
+        (progn (set-case-table ,table)
+               ,@body)
+       (set-case-table old-case-table))))
 \f
 ;;;; Constructing completion tables.