X-Git-Url: https://git.hcoop.net/bpt/emacs.git/blobdiff_plain/d02fe47dd3be7310d1bfd6e802d1fac2ea5f5e9d..acaf905b1130aae80fa59d2c861ffd4c8eb75486:/lisp/mh-e/mh-xface.el diff --git a/lisp/mh-e/mh-xface.el b/lisp/mh-e/mh-xface.el index a8582e161e..5749a2c346 100644 --- a/lisp/mh-e/mh-xface.el +++ b/lisp/mh-e/mh-xface.el @@ -1,6 +1,6 @@ ;;; mh-xface.el --- MH-E X-Face and Face header field display -;; Copyright (C) 2002, 2003, 2005, 2006, 2007, 2008 Free Software Foundation, Inc. +;; Copyright (C) 2002-2003, 2005-2012 Free Software Foundation, Inc. ;; Author: Bill Wohler ;; Maintainer: Bill Wohler @@ -9,10 +9,10 @@ ;; This file is part of GNU Emacs. -;; GNU Emacs is free software; you can redistribute it and/or modify +;; GNU Emacs is free software: you can redistribute it and/or modify ;; it under the terms of the GNU General Public License as published by -;; the Free Software Foundation; either version 3, or (at your option) -;; any later version. +;; the Free Software Foundation, either version 3 of the License, or +;; (at your option) any later version. ;; GNU Emacs is distributed in the hope that it will be useful, ;; but WITHOUT ANY WARRANTY; without even the implied warranty of @@ -20,9 +20,7 @@ ;; GNU General Public License for more details. ;; You should have received a copy of the GNU General Public License -;; along with GNU Emacs; see the file COPYING. If not, write to the -;; Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, -;; Boston, MA 02110-1301, USA. +;; along with GNU Emacs. If not, see . ;;; Commentary: @@ -59,8 +57,6 @@ mh-clean-message-header-flag)) (funcall mh-show-xface-function))) -;; Shush compiler. - (defun mh-face-display-function () "Display a Face, X-Face, or X-Image-URL header field. If more than one of these are present, then the first one found @@ -79,7 +75,8 @@ in this order is used." (x-face (setq raw (mh-uncompface x-face) type 'pbm)) (url (setq type 'url)) - (t (multiple-value-setq (type raw) (mh-picon-get-image)))) + (t (multiple-value-setq (type raw) + (values-list (mh-picon-get-image))))) (when type (goto-char (point-min)) (when (re-search-forward "^from:" (point-max) t) @@ -128,7 +125,8 @@ in this order is used." (defun mh-face-to-png (data) "Convert base64 encoded DATA to png image." (with-temp-buffer - (set-buffer-multibyte nil) + (if (fboundp 'set-buffer-multibyte) + (set-buffer-multibyte nil)) (insert data) (ignore-errors (base64-decode-region (point-min) (point-max))) (buffer-string))) @@ -136,7 +134,8 @@ in this order is used." (defun mh-uncompface (data) "Run DATA through `uncompface' to generate bitmap." (with-temp-buffer - (set-buffer-multibyte nil) + (if (fboundp 'set-buffer-multibyte) + (set-buffer-multibyte nil)) (insert data) (when (and mh-uncompface-executable (equal (call-process-region (point-min) (point-max) @@ -208,7 +207,7 @@ The directories are searched for in the order they appear in the list.") (cond (cached-value (return-from mh-picon-get-image cached-value)) ((not host-list) (return-from mh-picon-get-image nil))) (setq match - (block 'loop + (block loop ;; u@h search (loop for dir in mh-picon-existing-directory-list do (loop for type in mh-picon-image-types @@ -216,15 +215,15 @@ The directories are searched for in the order they appear in the list.") for file1 = (format "%s/%s.%s" dir canonical-address type) when (file-exists-p file1) - do (return-from 'loop file1) + do (return-from loop file1) ;; [path]user for file2 = (format "%s/%s.%s" dir user type) when (file-exists-p file2) - do (return-from 'loop file2) + do (return-from loop file2) ;; [path]host for file3 = (format "%s/%s.%s" dir host type) when (file-exists-p file3) - do (return-from 'loop file3))) + do (return-from loop file3))) ;; facedb search ;; Search order for user@foo.net: ;; [path]net/foo/user @@ -242,11 +241,11 @@ The directories are searched for in the order they appear in the list.") do (loop for type in mh-picon-image-types for z1 = (format "%s.%s" y type) when (file-exists-p z1) - do (return-from 'loop z1) + do (return-from loop z1) for z2 = (format "%s/face.%s" y type) when (file-exists-p z2) - do (return-from 'loop z2))))))) + do (return-from loop z2))))))) (setf (gethash canonical-address mh-picon-cache) (mh-picon-file-contents match))))) @@ -274,12 +273,13 @@ file contents as a string is returned. If FILE is nil, then both elements of the list are nil." (if (stringp file) (with-temp-buffer - (set-buffer-multibyte nil) + (if (fboundp 'set-buffer-multibyte) + (set-buffer-multibyte nil)) (let ((type (and (string-match ".*\\.\\(...\\)$" file) (intern (match-string 1 file))))) (insert-file-contents-literally file) - (values type (buffer-string)))) - (values nil nil))) + (list type (buffer-string)))) + (list nil nil))) @@ -473,5 +473,4 @@ The argument CHANGE is ignored." ;; sentence-end-double-space: nil ;; End: -;; arch-tag: a79dd33f-d0e5-4b19-a53a-be690f90229a ;;; mh-xface.el ends here