289 |
;;;###autoload |
;;;###autoload |
290 |
(defmacro with-coding-priority (coding-systems &rest body) |
(defmacro with-coding-priority (coding-systems &rest body) |
291 |
"Execute BODY like `progn' with CODING-SYSTEMS at the front of priority list. |
"Execute BODY like `progn' with CODING-SYSTEMS at the front of priority list. |
292 |
CODING-SYSTEMS is a list of coding systems." |
CODING-SYSTEMS is a list of coding systems. See |
293 |
|
`set-coding-priority'. This affects the implicit sorting of lists of |
294 |
|
coding sysems returned by operations such as `find-coding-systems-region'." |
295 |
(let ((current (make-symbol "current"))) |
(let ((current (make-symbol "current"))) |
296 |
`(let ((,current (coding-system-priorities))) |
`(let ((,current (coding-system-priority-list))) |
297 |
(apply #'set-coding-priority ,coding-systems) |
(apply #'set-coding-system-priority ,coding-systems) |
298 |
(unwind-protect |
(unwind-protect |
299 |
(progn ,@body) |
(progn ,@body) |
300 |
(set-coding-priority ,current))))) |
(apply #'set-coding-system-priority ,current))))) |
301 |
(put 'with-coding-priority 'lisp-indent-function 1) |
(put 'with-coding-priority 'lisp-indent-function 1) |
302 |
(put 'with-coding-priority 'edebug-form-spec t) |
(put 'with-coding-priority 'edebug-form-spec t) |
303 |
|
|