aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorStefan Monnier2008-03-12 20:51:26 +0000
committerStefan Monnier2008-03-12 20:51:26 +0000
commit5d2e28bfb45805e2ae248d44ceb4b7a65b331656 (patch)
tree91f4d1ffeddcbbf8b70475821aeab533f19238fb
parentd0081058014b153500ad8dee2b0a1c0e3122cd6f (diff)
downloademacs-5d2e28bfb45805e2ae248d44ceb4b7a65b331656.tar.gz
emacs-5d2e28bfb45805e2ae248d44ceb4b7a65b331656.zip
(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.
-rw-r--r--lisp/mh-e/ChangeLog7
-rw-r--r--lisp/mh-e/mh-xface.el17
2 files changed, 14 insertions, 10 deletions
diff --git a/lisp/mh-e/ChangeLog b/lisp/mh-e/ChangeLog
index 1ec3039b68c..3c773fb8f1f 100644
--- a/lisp/mh-e/ChangeLog
+++ b/lisp/mh-e/ChangeLog
@@ -1,3 +1,10 @@
12008-03-12 Stefan Monnier <monnier@iro.umontreal.ca>
2
3 * mh-xface.el (mh-uncompface, mh-picon-file-contents):
4 Use set-buffer-multibyte...
5 (mh-face-display-function, mh-x-image-display): ...rather than bind
6 default-enable-multibyte-characters.
7
12008-02-24 Bill Wohler <wohler@newt.com> 82008-02-24 Bill Wohler <wohler@newt.com>
2 9
3 * mh-comp.el (mh-send-letter): Call split-string on mh-send-args 10 * mh-comp.el (mh-send-letter): Call split-string on mh-send-args
diff --git a/lisp/mh-e/mh-xface.el b/lisp/mh-e/mh-xface.el
index 2cf1b146911..a8582e161e3 100644
--- a/lisp/mh-e/mh-xface.el
+++ b/lisp/mh-e/mh-xface.el
@@ -60,7 +60,6 @@
60 (funcall mh-show-xface-function))) 60 (funcall mh-show-xface-function)))
61 61
62;; Shush compiler. 62;; Shush compiler.
63(defvar default-enable-multibyte-characters) ; XEmacs
64 63
65(defun mh-face-display-function () 64(defun mh-face-display-function ()
66 "Display a Face, X-Face, or X-Image-URL header field. 65 "Display a Face, X-Face, or X-Image-URL header field.
@@ -71,7 +70,6 @@ in this order is used."
71 (re-search-forward "\n\n" (point-max) t) 70 (re-search-forward "\n\n" (point-max) t)
72 (narrow-to-region (point-min) (point)) 71 (narrow-to-region (point-min) (point))
73 (let* ((case-fold-search t) 72 (let* ((case-fold-search t)
74 (default-enable-multibyte-characters nil)
75 (face (message-fetch-field "face" t)) 73 (face (message-fetch-field "face" t))
76 (x-face (message-fetch-field "x-face" t)) 74 (x-face (message-fetch-field "x-face" t))
77 (url (message-fetch-field "x-image-url" t)) 75 (url (message-fetch-field "x-image-url" t))
@@ -130,6 +128,7 @@ in this order is used."
130(defun mh-face-to-png (data) 128(defun mh-face-to-png (data)
131 "Convert base64 encoded DATA to png image." 129 "Convert base64 encoded DATA to png image."
132 (with-temp-buffer 130 (with-temp-buffer
131 (set-buffer-multibyte nil)
133 (insert data) 132 (insert data)
134 (ignore-errors (base64-decode-region (point-min) (point-max))) 133 (ignore-errors (base64-decode-region (point-min) (point-max)))
135 (buffer-string))) 134 (buffer-string)))
@@ -137,6 +136,7 @@ in this order is used."
137(defun mh-uncompface (data) 136(defun mh-uncompface (data)
138 "Run DATA through `uncompface' to generate bitmap." 137 "Run DATA through `uncompface' to generate bitmap."
139 (with-temp-buffer 138 (with-temp-buffer
139 (set-buffer-multibyte nil)
140 (insert data) 140 (insert data)
141 (when (and mh-uncompface-executable 141 (when (and mh-uncompface-executable
142 (equal (call-process-region (point-min) (point-max) 142 (equal (call-process-region (point-min) (point-max)
@@ -274,6 +274,7 @@ file contents as a string is returned. If FILE is nil, then both
274elements of the list are nil." 274elements of the list are nil."
275 (if (stringp file) 275 (if (stringp file)
276 (with-temp-buffer 276 (with-temp-buffer
277 (set-buffer-multibyte nil)
277 (let ((type (and (string-match ".*\\.\\(...\\)$" file) 278 (let ((type (and (string-match ".*\\.\\(...\\)$" file)
278 (intern (match-string 1 file))))) 279 (intern (match-string 1 file)))))
279 (insert-file-contents-literally file) 280 (insert-file-contents-literally file)
@@ -397,10 +398,8 @@ filenames. In addition, replaces * with %2a. See URL
397 398
398(defun mh-x-image-display (image marker) 399(defun mh-x-image-display (image marker)
399 "Display IMAGE at MARKER." 400 "Display IMAGE at MARKER."
400 (save-excursion 401 (with-current-buffer (marker-buffer marker)
401 (set-buffer (marker-buffer marker)) 402 (let ((inhibit-read-only t)
402 (let ((buffer-read-only nil)
403 (default-enable-multibyte-characters nil)
404 (buffer-modified-flag (buffer-modified-p))) 403 (buffer-modified-flag (buffer-modified-p)))
405 (unwind-protect 404 (unwind-protect
406 (when (and (file-readable-p image) (not (file-symlink-p image)) 405 (when (and (file-readable-p image) (not (file-symlink-p image))
@@ -428,8 +427,7 @@ actual display is carried out by the SENTINEL function."
428 mh-temp-fetch-buffer))) 427 mh-temp-fetch-buffer)))
429 (filename (or (mh-funcall-if-exists make-temp-file "mhe-fetch") 428 (filename (or (mh-funcall-if-exists make-temp-file "mhe-fetch")
430 (expand-file-name (make-temp-name "~/mhe-fetch"))))) 429 (expand-file-name (make-temp-name "~/mhe-fetch")))))
431 (save-excursion 430 (with-current-buffer buffer
432 (set-buffer buffer)
433 (set (make-local-variable 'mh-x-image-url-cache-file) cache-file) 431 (set (make-local-variable 'mh-x-image-url-cache-file) cache-file)
434 (set (make-local-variable 'mh-x-image-marker) marker) 432 (set (make-local-variable 'mh-x-image-marker) marker)
435 (set (make-local-variable 'mh-x-image-temp-file) filename)) 433 (set (make-local-variable 'mh-x-image-temp-file) filename))
@@ -445,8 +443,7 @@ actual display is carried out by the SENTINEL function."
445The argument CHANGE is ignored." 443The argument CHANGE is ignored."
446 (when (eq (process-status process) 'exit) 444 (when (eq (process-status process) 'exit)
447 (let (marker temp-file cache-filename wget-buffer) 445 (let (marker temp-file cache-filename wget-buffer)
448 (save-excursion 446 (with-current-buffer (setq wget-buffer (process-buffer process))
449 (set-buffer (setq wget-buffer (process-buffer process)))
450 (setq marker mh-x-image-marker 447 (setq marker mh-x-image-marker
451 cache-filename mh-x-image-url-cache-file 448 cache-filename mh-x-image-url-cache-file
452 temp-file mh-x-image-temp-file)) 449 temp-file mh-x-image-temp-file))