Function: with-category-table

with-category-table is a macro defined in mule.el.gz.

Signature

(with-category-table TABLE &rest BODY)

Documentation

Execute BODY like progn with TABLE the current category table.

The category table of the current buffer is saved, BODY is evaluated, then the saved table is restored, even in case of an abnormal exit. Value is what BODY returns.

Source Code

;; Defined in /usr/src/emacs/lisp/international/mule.el.gz
(defmacro with-category-table (table &rest body)
  "Execute BODY like `progn' with TABLE the current category table.
The category table of the current buffer is saved, BODY is evaluated,
then the saved table is restored, even in case of an abnormal exit.
Value is what BODY returns."
  (declare (indent 1) (debug t))
  (let ((old-table (make-symbol "old-table"))
	(old-buffer (make-symbol "old-buffer")))
    `(let ((,old-table (category-table))
	   (,old-buffer (current-buffer)))
       (unwind-protect
	   (progn
	     (set-category-table ,table)
	     ,@body)
	 (with-current-buffer ,old-buffer
	   (set-category-table ,old-table))))))