Function: with-coding-priority

with-coding-priority is an autoloaded macro defined in mule-util.el.gz.

Signature

(with-coding-priority CODING-SYSTEMS &rest BODY)

Documentation

Execute BODY like progn with CODING-SYSTEMS at the front of priority list.

CODING-SYSTEMS is a list of coding systems. See set-coding-system-priority. This affects the implicit sorting of lists of coding systems returned by operations such as find-coding-systems-region.

Probably introduced at or before Emacs version 23.1.

Source Code

;; Defined in /usr/src/emacs/lisp/international/mule-util.el.gz
;;;###autoload
(defmacro with-coding-priority (coding-systems &rest body)
  "Execute BODY like `progn' with CODING-SYSTEMS at the front of priority list.
CODING-SYSTEMS is a list of coding systems.  See `set-coding-system-priority'.
This affects the implicit sorting of lists of coding systems returned by
operations such as `find-coding-systems-region'."
  (declare (indent 1) (debug t))
  (let ((current (make-symbol "current")))
  `(let ((,current (coding-system-priority-list)))
     (apply #'set-coding-system-priority ,coding-systems)
     (unwind-protect
	 (progn ,@body)
       (apply #'set-coding-system-priority ,current)))))