Mercurial > emacs
comparison lisp/international/mule-util.el @ 88842:bf78a07ee032
(with-coding-priority): Fix.
author | Dave Love <fx@gnu.org> |
---|---|
date | Thu, 11 Jul 2002 22:59:06 +0000 |
parents | c949437b3a53 |
children | 438e610d8d06 |
comparison
equal
deleted
inserted
replaced
88841:8d1b688eca17 | 88842:bf78a07ee032 |
---|---|
287 (detect-coding-region from to))))) | 287 (detect-coding-region from to))))) |
288 | 288 |
289 ;;;###autoload | 289 ;;;###autoload |
290 (defmacro with-coding-priority (coding-systems &rest body) | 290 (defmacro with-coding-priority (coding-systems &rest body) |
291 "Execute BODY like `progn' with CODING-SYSTEMS at the front of priority list. | 291 "Execute BODY like `progn' with CODING-SYSTEMS at the front of priority list. |
292 CODING-SYSTEMS is a list of coding systems." | 292 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'." | |
293 (let ((current (make-symbol "current"))) | 295 (let ((current (make-symbol "current"))) |
294 `(let ((,current (coding-system-priorities))) | 296 `(let ((,current (coding-system-priority-list))) |
295 (apply #'set-coding-priority ,coding-systems) | 297 (apply #'set-coding-system-priority ,coding-systems) |
296 (unwind-protect | 298 (unwind-protect |
297 (progn ,@body) | 299 (progn ,@body) |
298 (set-coding-priority ,current))))) | 300 (apply #'set-coding-system-priority ,current))))) |
299 (put 'with-coding-priority 'lisp-indent-function 1) | 301 (put 'with-coding-priority 'lisp-indent-function 1) |
300 (put 'with-coding-priority 'edebug-form-spec t) | 302 (put 'with-coding-priority 'edebug-form-spec t) |
301 | 303 |
302 (provide 'mule-util) | 304 (provide 'mule-util) |
303 | 305 |