tm 7.80.
[elisp/tm.git] / tm-image.el
index ecc9fc7..84c109b 100644 (file)
@@ -1,39 +1,37 @@
-;;;
-;;; tm-image.el --- a tm-view content filter to display images in
-;;;                 XEmacs or Mule buffers
-;;;
-;;; Copyright (C) 1995,1996 MORIOKA Tomohiko
-;;; Copyright (C) 1996 Dan Rich
-;;;
-;;; Author: MORIOKA Tomohiko <morioka@jaist.ac.jp>
-;;;         Dan Rich <drich@morpheus.corp.sgi.com>
-;;; Maintainer: MORIOKA Tomohiko <morioka@jaist.ac.jp>
-;;; Created: 1995/12/15
-;;; Version:
-;;;    $Id: tm-image.el,v 7.12 1996/08/01 06:42:04 morioka Exp $
-;;;
-;;; Keywords: mail, news, MIME, multimedia, image, picture
-;;;
-;;; This file is part of tm (Tools for MIME).
-;;;
-;;; This program 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 2, or
-;;; (at your option) any later version.
-;;;
-;;; This program is distributed in the hope that it will be useful,
-;;; but WITHOUT ANY WARRANTY; without even the implied warranty of
-;;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
-;;; General Public License for more details.
-;;;
-;;; You should have received a copy of the GNU General Public License
-;;; along with This program.  If not, write to the Free Software
-;;; Foundation, 675 Mass Ave, Cambridge, MA 02139, USA.
-;;;
+;;; tm-image.el --- tm-view filter to display images in XEmacs or MULE buffers
+
+;; Copyright (C) 1995,1996 MORIOKA Tomohiko
+;; Copyright (C) 1996 Dan Rich
+
+;; Author: MORIOKA Tomohiko <morioka@jaist.ac.jp>
+;;         Dan Rich <drich@morpheus.corp.sgi.com>
+;; Maintainer: MORIOKA Tomohiko <morioka@jaist.ac.jp>
+;; Created: 1995/12/15
+;; Version: $Id: tm-image.el,v 7.14 1996/08/28 18:43:29 morioka Exp $
+
+;; Keywords: mail, news, MIME, multimedia, image, picture, X-Face
+
+;; This file is part of tm (Tools for MIME).
+
+;; This program 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 2, or (at
+;; your option) any later version.
+
+;; This program is distributed in the hope that it will be useful, but
+;; WITHOUT ANY WARRANTY; without even the implied warranty of
+;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+;; General Public License for more details.
+
+;; You should have received a copy of the GNU General Public License
+;; along with this program; see the file COPYING.  If not, write to
+;; the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
+;; Boston, MA 02111-1307, USA.
+
 ;;; Commentary:
-;;;   If you use this program with Mule, please install
-;;;   etl8x16-bitmap.bdf font included in tl package.
-;;;
+;;     If you use this program with MULE, please install
+;;     etl8x16-bitmap.bdf font included in tl package.
+
 ;;; Code:
 
 (require 'tm-view)
           ("image/x-xpixmap" . xpm)
           ))
        
-       (defvar mime-viewer/use-highlight-headers t)
-
        (defvar mime-preview/x-face-function
-        (if (and mime-viewer/use-highlight-headers
-                 (progn
-                   (require 'highlight-headers)
-                   highlight-headers-hack-x-face-p
-                   ))
-            (function mime-preview/x-face-function-use-highlight-headers)
-          (function mime-preview/x-face-function-for-xemacs)
-          ))
+        (function mime-preview/x-face-function-use-highlight-headers))
+       
+       (autoload 'highlight-headers "highlight-headers")
+       
+       (defun mime-preview/x-face-function-use-highlight-headers ()
+        (highlight-headers (point-min) (re-search-forward "^$" nil t) t)
+        )
        )
       ((boundp 'MULE)
        (require 'x-face-mule)
              mime-preview/x-face-function)
   )
 
-(defun mime-preview/x-face-function-use-highlight-headers ()
-  (highlight-headers (point-min) (re-search-forward "^$" nil t) t)
-  )
-
-(defun mime-preview/x-face-function-for-xemacs ()
-  (save-restriction
-    (narrow-to-region (point-min) (re-search-forward "^$" nil t))
-    (goto-char (point-min))
-    (if (re-search-forward "^X-Face:[ \t]*" nil t)
-       (let ((beg (match-end 0))
-             (end (rfc822/field-end))
-             (xbm-file
-              (make-temp-name (expand-file-name "tmxf" mime/tmp-dir))
-              ))
-         (call-process-region
-          beg end "sh" nil 0 nil
-          "-c"
-          (format "%s > %s"
-                  mime-viewer/x-face-to-xbm-command
-                  xbm-file))
-         (while (not (file-exists-p xbm-file)))
-         (delete-region beg end)
-         (bitmap-insert-xbm-file xbm-file)
-         (condition-case nil
-             (delete-file xbm-file)
-           (error nil))
-         ))))
-
 
 ;;; @ content filter for images
 ;;;