comparison lisp/international/mule.el @ 74164:a3d2bf407246

(load-with-code-conversion, with-category-table): Use with-current-buffer. (after-insert-file-set-coding): Use restore-buffer-modified-p.
author Stefan Monnier <monnier@iro.umontreal.ca>
date Fri, 24 Nov 2006 18:43:58 +0000
parents 223a7f633c49
children 43cc94d955c2 c71725faff1a f1d13e615070
comparison
equal deleted inserted replaced
74163:f7736a8bd079 74164:a3d2bf407246
69 (push file preloaded-file-list)) 69 (push file preloaded-file-list))
70 (unwind-protect 70 (unwind-protect
71 (let ((load-file-name fullname) 71 (let ((load-file-name fullname)
72 (set-auto-coding-for-load t) 72 (set-auto-coding-for-load t)
73 (inhibit-file-name-operation nil)) 73 (inhibit-file-name-operation nil))
74 (save-excursion 74 (with-current-buffer buffer
75 (set-buffer buffer)
76 ;; Don't let deactivate-mark remain set. 75 ;; Don't let deactivate-mark remain set.
77 (let (deactivate-mark) 76 (let (deactivate-mark)
78 (insert-file-contents fullname)) 77 (insert-file-contents fullname))
79 ;; If the loaded file was inserted with no-conversion or 78 ;; If the loaded file was inserted with no-conversion or
80 ;; raw-text coding system, make the buffer unibyte. 79 ;; raw-text coding system, make the buffer unibyte.
1869 ;; part of producing the buffer's initial contents. 1868 ;; part of producing the buffer's initial contents.
1870 (let ((buffer-undo-list t)) 1869 (let ((buffer-undo-list t))
1871 (set-buffer-multibyte nil)) 1870 (set-buffer-multibyte nil))
1872 (set-buffer-multibyte nil)) 1871 (set-buffer-multibyte nil))
1873 (setq inserted (- pos-marker (point))))) 1872 (setq inserted (- pos-marker (point)))))
1874 (set-buffer-modified-p modified-p)))) 1873 (restore-buffer-modified-p modified-p))))
1875 inserted) 1874 inserted)
1876 1875
1877 ;; The coding-spec and eol-type of coding-system returned is decided 1876 ;; The coding-spec and eol-type of coding-system returned is decided
1878 ;; independently in the following order. 1877 ;; independently in the following order.
1879 ;; 1. That of buffer-file-coding-system locally bound. 1878 ;; 1. That of buffer-file-coding-system locally bound.
2221 (,old-buffer (current-buffer))) 2220 (,old-buffer (current-buffer)))
2222 (unwind-protect 2221 (unwind-protect
2223 (progn 2222 (progn
2224 (set-category-table ,table) 2223 (set-category-table ,table)
2225 ,@body) 2224 ,@body)
2226 (save-current-buffer 2225 (with-current-buffer ,old-buffer
2227 (set-buffer ,old-buffer)
2228 (set-category-table ,old-table)))))) 2226 (set-category-table ,old-table))))))
2229 2227
2230 (defun define-translation-hash-table (symbol table) 2228 (defun define-translation-hash-table (symbol table)
2231 "Define SYMBOL as the name of the hash translation TABLE for use in CCL. 2229 "Define SYMBOL as the name of the hash translation TABLE for use in CCL.
2232 2230