changeset 92780:23eda9299411

(mh-uncompface, mh-picon-file-contents): Use set-buffer-multibyte... (mh-face-display-function, mh-x-image-display): ...rather than bind default-enable-multibyte-characters.
author Stefan Monnier <monnier@iro.umontreal.ca>
date Wed, 12 Mar 2008 20:51:26 +0000
parents e9bef8bf2940
children f231a5d1706d
files lisp/mh-e/ChangeLog lisp/mh-e/mh-xface.el
diffstat 2 files changed, 14 insertions(+), 10 deletions(-) [+]
line wrap: on
line diff
--- a/lisp/mh-e/ChangeLog	Wed Mar 12 20:48:46 2008 +0000
+++ b/lisp/mh-e/ChangeLog	Wed Mar 12 20:51:26 2008 +0000
@@ -1,3 +1,10 @@
+2008-03-12  Stefan Monnier  <monnier@iro.umontreal.ca>
+
+	* mh-xface.el (mh-uncompface, mh-picon-file-contents):
+	Use set-buffer-multibyte...
+	(mh-face-display-function, mh-x-image-display): ...rather than bind
+	default-enable-multibyte-characters.
+
 2008-02-24  Bill Wohler  <wohler@newt.com>
 
 	* mh-comp.el (mh-send-letter): Call split-string on mh-send-args
--- a/lisp/mh-e/mh-xface.el	Wed Mar 12 20:48:46 2008 +0000
+++ b/lisp/mh-e/mh-xface.el	Wed Mar 12 20:51:26 2008 +0000
@@ -60,7 +60,6 @@
     (funcall mh-show-xface-function)))
 
 ;; Shush compiler.
-(defvar default-enable-multibyte-characters) ; XEmacs
 
 (defun mh-face-display-function ()
   "Display a Face, X-Face, or X-Image-URL header field.
@@ -71,7 +70,6 @@
     (re-search-forward "\n\n" (point-max) t)
     (narrow-to-region (point-min) (point))
     (let* ((case-fold-search t)
-           (default-enable-multibyte-characters nil)
            (face (message-fetch-field "face" t))
            (x-face (message-fetch-field "x-face" t))
            (url (message-fetch-field "x-image-url" t))
@@ -130,6 +128,7 @@
 (defun mh-face-to-png (data)
   "Convert base64 encoded DATA to png image."
   (with-temp-buffer
+    (set-buffer-multibyte nil)
     (insert data)
     (ignore-errors (base64-decode-region (point-min) (point-max)))
     (buffer-string)))
@@ -137,6 +136,7 @@
 (defun mh-uncompface (data)
   "Run DATA through `uncompface' to generate bitmap."
   (with-temp-buffer
+    (set-buffer-multibyte nil)
     (insert data)
     (when (and mh-uncompface-executable
                (equal (call-process-region (point-min) (point-max)
@@ -274,6 +274,7 @@
 elements of the list are nil."
   (if (stringp file)
       (with-temp-buffer
+        (set-buffer-multibyte nil)
         (let ((type (and (string-match ".*\\.\\(...\\)$" file)
                          (intern (match-string 1 file)))))
           (insert-file-contents-literally file)
@@ -397,10 +398,8 @@
 
 (defun mh-x-image-display (image marker)
   "Display IMAGE at MARKER."
-  (save-excursion
-    (set-buffer (marker-buffer marker))
-    (let ((buffer-read-only nil)
-          (default-enable-multibyte-characters nil)
+  (with-current-buffer (marker-buffer marker)
+    (let ((inhibit-read-only t)
           (buffer-modified-flag (buffer-modified-p)))
       (unwind-protect
           (when (and (file-readable-p image) (not (file-symlink-p image))
@@ -428,8 +427,7 @@
                                         mh-temp-fetch-buffer)))
             (filename (or (mh-funcall-if-exists make-temp-file "mhe-fetch")
                           (expand-file-name (make-temp-name "~/mhe-fetch")))))
-        (save-excursion
-          (set-buffer buffer)
+        (with-current-buffer buffer
           (set (make-local-variable 'mh-x-image-url-cache-file) cache-file)
           (set (make-local-variable 'mh-x-image-marker) marker)
           (set (make-local-variable 'mh-x-image-temp-file) filename))
@@ -445,8 +443,7 @@
 The argument CHANGE is ignored."
   (when (eq (process-status process) 'exit)
     (let (marker temp-file cache-filename wget-buffer)
-      (save-excursion
-        (set-buffer (setq wget-buffer (process-buffer process)))
+      (with-current-buffer (setq wget-buffer (process-buffer process))
         (setq marker mh-x-image-marker
               cache-filename mh-x-image-url-cache-file
               temp-file mh-x-image-temp-file))