+1997-02-12 MORIOKA Tomohiko <morioka@jaist.ac.jp>
+
+ * emu: Version 7.37.7 was released.
+ * tm: Version 7.104 was released.
+
+1997-02-11 MORIOKA Tomohiko <morioka@jaist.ac.jp>
+
+ * TM-MK (make-mime-setup): Delete old mime-setup.el before
+ generate mime-setup.el if it is exist.
+
+1997-02-11 MORIOKA Tomohiko <morioka@jaist.ac.jp>
+
+ * tm-ew-e.el (tm-eword::encode-string-1): Unused local variable
+ `sl' was abolished.
+
+1997-02-11 MORIOKA Tomohiko <morioka@jaist.ac.jp>
+
+ * tm-pgp.el: Variable `pgp-verify-function',
+ `pgp-decrypt-function', `pgp-fetch-key-function' and
+ `pgp-snarf-keys-function' were abolished.
+
+ (pgp-function-alist): New variable.
+ (pgp-function): New function.
+
+ (mime-article/view-application/pgp): Use `pgp-function' instead of
+ variable `pgp-verify-function' and `pgp-decrypt-function'.
+ (mime-article/check-pgp-signature): Use `pgp-function' instead of
+ variable `pgp-fetch-key-function'.
+ (mime-article/add-pgp-keys): Use `pgp-function' instead of
+ variable `pgp-snarf-keys-function'.
+
+1997-02-11 MORIOKA Tomohiko <morioka@jaist.ac.jp>
+
+ * tm-pgp.el (pgp-fetch-key-function): Function `mc-pgp-fetch-key'
+ is in mc-pgp.el.
+
+1997-02-10 MORIOKA Tomohiko <morioka@jaist.ac.jp>
+
+ * tm-image.el (mime-preview/filter-for-application/postscript):
+ Display message before/after decoding.
+
+ * tm-image.el: Don't require `annotations'.
+
+ * tm-image.el: Variable `mime-preview/x-face-function' was
+ abolished.
+
+1997-02-10 MORIOKA Tomohiko <morioka@jaist.ac.jp>
+
+ * tm-image.el: Unused variable `mime-viewer/x-face-to-xbm-command'
+ was abolished.
+
+ * tm-image.el (mime-preview/filter-for-application/postscript):
+ New implementation.
+
+1997-02-10 MORIOKA Tomohiko <morioka@jaist.ac.jp>
+
+ * tm-image.el (image-inline-p): New function.
+ Variable `tm-image/inline-image-types' was abolished.
+ (mime-preview/filter-for-image): Add xbm decoding.
+ Function `mime-preview/filter-for-image/xbm' was abolished.
+
+ * tm-image.el (bitmap-insert-xbm-file): New implementation.
+
+1997-02-10 MORIOKA Tomohiko <morioka@jaist.ac.jp>
+
+ * tm-image.el: Variable `mime-viewer/shell-command' and
+ `mime-viewer/shell-arguments' were abolished.
+ Variable `mime-viewer/graphic-converter-alist' was abolished.
+ Function `mime-preview/filter-for-inline-image' was abolished.
+
+ (mime-preview/filter-for-image): New implementation; use function
+ `image-normalize'.
+
+1997-02-10 MORIOKA Tomohiko <morioka@jaist.ac.jp>
+
+ * tm-setup.el (tm-setup/load-rmail): New function; check variable
+ `rmail-support-mime' to detect "Radical RMAIL".
+
+1997-02-10 MORIOKA Tomohiko <morioka@jaist.ac.jp>
+
+ * tm-view.el (mime-viewer/follow-content): Display message if
+ following method is not implemented.
+
+1997-02-10 MORIOKA Tomohiko <morioka@jaist.ac.jp>
+
+ * tm-edit.el (mime-editor::edit-again): Delete
+ application/pgp-signature parts.
+
+1997-02-07 Steven L. Baur <steve@miranova.com>
+
+ * tm-image.el (mime-preview/filter-for-inline-image): Use better
+ method (cf. [tm-en:1204], [xemacs-beta:2462])
+
+1997-02-07 MORIOKA Tomohiko <morioka@jaist.ac.jp>
+
+ * tm-ftp.el (mime-view-ftp-module): New variable; require it if it
+ is non-nil.
+
+\f
1997-02-06 MORIOKA Tomohiko <morioka@jaist.ac.jp>
* tm: Version 7.103.5 was released.
* emu: Version 7.37.4 was released.
* tl: Version 7.61.16 was released.
* MU: Version 0.39.1 was released.
+ * bitmap-mule: Version 7.16 was released.
* tm: Version 7.101 was released.
Tue Jan 21 07:23:27 1997 MORIOKA Tomohiko <morioka@jaist.ac.jp>
;;; tm-image.el --- tm-view filter to display images in XEmacs or MULE buffers
-;; Copyright (C) 1995,1996 MORIOKA Tomohiko
+;; Copyright (C) 1995,1996,1997 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.15 1996/09/17 04:38:00 morioka Exp $
+;; Version: $Id: tm-image.el,v 7.27 1997/02/10 16:16:21 morioka Exp $
-;; Keywords: mail, news, MIME, multimedia, image, picture, X-Face
+;; Keywords: image, picture, X-Face, MIME, multimedia, mail, news
-;; This file is part of tm (Tools for MIME).
+;; This file is part of XEmacs.
;; This program is free software; you can redistribute it and/or
;; modify it under the terms of the GNU General Public License as
;; 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,
+;; along with GNU XEmacs; see the file COPYING. If not, write to the
+;; Free Software Foundation, Inc., 59 Temple Place - Suite 330,
;; Boston, MA 02111-1307, USA.
;;; Commentary:
(require 'tm-view)
(cond (running-xemacs
- (require 'annotations)
+ (require 'images)
- (set-alist 'mime-viewer/content-filter-alist
- "image/jpeg"
- (if (featurep 'jpeg) ; Use built-in suport if available
- (function mime-preview/filter-for-inline-image)
- (function mime-preview/filter-for-image)
- ))
+ (defun-maybe image-inline-p (format)
+ (or (memq format image-native-formats)
+ (find-if (function
+ (lambda (native)
+ (image-converter-chain format native)
+ ))
+ image-native-formats)
+ ))
- (set-alist 'mime-viewer/content-filter-alist
- "image/gif"
- (if (featurep 'gif) ; Use built-in suport if available
- (function mime-preview/filter-for-inline-image)
- (function mime-preview/filter-for-image)
- ))
-
- (set-alist 'mime-viewer/content-filter-alist
- "image/x-xpixmap"
- (if (featurep 'xpm) ; Use built-in suport if available
- (function mime-preview/filter-for-inline-image)
- (function mime-preview/filter-for-image)
- ))
-
- (set-alist 'mime-viewer/content-filter-alist
- "image/tiff" (function mime-preview/filter-for-image))
- (set-alist 'mime-viewer/content-filter-alist
- "image/x-tiff" (function mime-preview/filter-for-image))
-
- (set-alist 'mime-viewer/content-filter-alist
- "image/x-pic" (function mime-preview/filter-for-image))
-
- (set-alist 'mime-viewer/content-filter-alist
- "image/x-mag" (function mime-preview/filter-for-image))
-
- (defvar tm-image/inline-image-types
- (if (featurep 'gif)
- (nconc
- '("image/jpeg" "image/gif" "image/tiff"
- "image/x-tiff" "image/x-pic" "image/x-mag"
- "image/x-xbm" "image/x-xpixmap")
- (if (featurep 'gif)
- '("application/postscript")
- )
- )))
+ (image-register-netpbm-utilities)
+ (image-register-converter 'pic 'ppm "pictoppm")
+ (image-register-converter 'mag 'ppm "magtoppm")
(defun bitmap-insert-xbm-file (file)
- (let (gl)
- (while (progn
- (setq gl (make-glyph file))
- (eq (image-instance-type (glyph-image-instance gl))
- 'text)
- ))
- (make-annotation gl (point) 'text)
- ))
-
- (defvar mime-viewer/image-converter-alist
- '(("image/jpeg" . jpeg)
- ("image/gif" . gif)
- ("image/x-png" . png)
- ("image/x-xpixmap" . xpm)
+ (let ((gl (make-glyph (list (cons 'x file))))
+ (e (make-extent (point) (point)))
+ )
+ (set-extent-end-glyph e gl)
))
- (defvar mime-preview/x-face-function
- (function mime-preview/x-face-function-use-highlight-headers))
-
+ ;;
+ ;; X-Face
+ ;;
(autoload 'highlight-headers "highlight-headers")
(defun mime-preview/x-face-function-use-highlight-headers ()
(highlight-headers (point-min) (re-search-forward "^$" nil t) t)
)
+
+ (add-hook 'mime-viewer/content-header-filter-hook
+ 'mime-preview/x-face-function-use-highlight-headers)
+
)
((featurep 'mule)
;; for MULE 2.* or mule merged EMACS
(require 'x-face-mule)
+
+ (defvar image-native-formats '(xbm))
- (defvar tm-image/inline-image-types '("image/x-mag" "image/x-xbm"))
+ (defun-maybe image-inline-p (format)
+ (memq format image-native-formats)
+ )
+
+ (defun-maybe image-normalize (format data)
+ (and (eq format 'xbm)
+ (vector 'xbm ':data data)
+ ))
- (defvar mime-preview/x-face-function
- (function x-face-decode-message-header))
+ ;;
+ ;; X-Face
+ ;;
+ (add-hook 'mime-viewer/content-header-filter-hook
+ 'x-face-decode-message-header)
))
-(defvar mime-viewer/shell-command "/bin/sh")
-(defvar mime-viewer/shell-arguments '("-c"))
+(or (fboundp 'image-invalid-glyph-p)
+ (defsubst image-invalid-glyph-p (glyph)
+ (or (null (aref glyph 0))
+ (null (aref glyph 2))
+ (equal (aref glyph 2) "")
+ ))
+ )
-(defvar mime-viewer/ps-to-gif-command "pstogif")
+(defvar mime-viewer/image-converter-alist nil)
-(defvar mime-viewer/graphic-converter-alist
- '(("image/jpeg" . "djpeg -color 256 < %s | ppmtoxpm > %s")
- ("image/gif" . "giftopnm < %s | ppmtoxpm > %s")
- ("image/tiff" . "tifftopnm < %s | ppmquant 256 | ppmtoxpm > %s")
- ("image/x-tiff" . "tifftopnm < %s | ppmquant 256 | ppmtoxpm > %s")
- ("image/x-pic" . "pictoppm < %s | ppmquant 256 | ppmtoxpm > %s")
- ("image/x-mag" . "magtoppm < %s | ppmtoxpm > %s")
- ))
-
-
-;;; @ X-Face
-;;;
-
-(defvar mime-viewer/x-face-to-xbm-command
- (concat mime-viewer/x-face-to-pbm-command " | pbmtoxbm"))
+(mapcar (function
+ (lambda (rule)
+ (let ((ctype (car rule))
+ (format (cdr rule))
+ )
+ (if (image-inline-p format)
+ (progn
+ (set-alist 'mime-viewer/content-filter-alist
+ ctype
+ (function mime-preview/filter-for-image))
+ (set-alist 'mime-viewer/image-converter-alist
+ ctype format)
+ (add-to-list
+ 'mime-viewer/default-showing-Content-Type-list
+ ctype)
+ )
+ ))))
+ '(("image/jpeg" . jpeg)
+ ("image/gif" . gif)
+ ("image/tiff" . tiff)
+ ("image/x-tiff" . tiff)
+ ("image/xbm" . xbm)
+ ("image/x-xbm" . xbm)
+ ("image/x-xpixmap" . xpm)
+ ("image/x-pic" . pic)
+ ("image/x-mag" . mag)
+ ))
-(if mime-preview/x-face-function
- (add-hook 'mime-viewer/content-header-filter-hook
- mime-preview/x-face-function)
- )
+(defvar mime-viewer/ps-to-gif-command "pstogif")
;;; @ content filter for images
(defun mime-preview/filter-for-image (ctype params encoding)
(let* ((mode mime::preview/original-major-mode)
(m (assq mode mime-viewer/code-converter-alist))
- (filter (assoc-value ctype mime-viewer/graphic-converter-alist))
- )
- (if filter
- (let* ((beg (point-min)) (end (point-max))
- (orig-file
- (make-temp-name (expand-file-name "tm" mime/tmp-dir)))
- (xbm-file (concat orig-file ".xbm"))
- gl annot)
- ;;(remove-text-properties beg end '(face nil))
- (mime-decode-region beg end encoding)
- (write-region (point-min)(point-max) orig-file)
- (delete-region (point-min)(point-max))
- (message "Now translating, please wait...")
- (apply (function call-process)
- mime-viewer/shell-command nil nil nil
- (append mime-viewer/shell-arguments
- (list (format filter orig-file xbm-file)))
- )
- (setq gl (make-glyph xbm-file))
- (setq annot (make-annotation gl (point) 'text))
- (unwind-protect
- (delete-file orig-file)
- (condition-case nil
- (delete-file xbm-file)
- (error nil)))
- (goto-char (point-max))
- (insert "\n")
- (message "Translation done.")
- )
- (message (format "%s is not supported." ctype))
- )))
-
-
-;;; @ content filter for xbm
-;;;
-
-(defun mime-preview/filter-for-image/xbm (ctype params encoding)
- (let* ((mode mime::preview/original-major-mode)
- (m (assq mode mime-viewer/code-converter-alist))
(charset (assoc "charset" params))
(beg (point-min)) (end (point-max))
- (xbm-file (make-temp-name (expand-file-name "tm" mime/tmp-dir)))
)
(remove-text-properties beg end '(face nil))
+ (message "Decoding image...")
(mime-decode-region beg end encoding)
- (write-region (point-min)(point-max) xbm-file)
- (delete-region (point-min)(point-max))
- (bitmap-insert-xbm-file xbm-file)
- (delete-file xbm-file)
- ))
-
-(set-alist 'mime-viewer/content-filter-alist
- "image/xbm" (function mime-preview/filter-for-image/xbm))
-
-(set-alist 'mime-viewer/content-filter-alist
- "image/x-xbm" (function mime-preview/filter-for-image/xbm))
-
-
-;;; @ content filter for support in-line image types
-;;;
-;; (for XEmacs 19.14 or later)
-
-(defun mime-preview/filter-for-inline-image (ctype params encoding)
- (let* ((mode mime::preview/original-major-mode)
- (m (assq mode mime-viewer/code-converter-alist))
- (charset (assoc "charset" params))
- (beg (point-min)) (end (point-max))
- )
- (remove-text-properties beg end '(face nil))
- (mime-decode-region beg end encoding)
- (let ((data (buffer-string))
- (minor (assoc-value ctype mime-viewer/image-converter-alist))
- gl)
+ (let* ((minor (assoc-value ctype mime-viewer/image-converter-alist))
+ (gl (image-normalize minor (buffer-string)))
+ e)
(delete-region (point-min)(point-max))
- (while (progn
- (setq gl (make-glyph (vector minor :data data)))
- (eq (image-instance-type (glyph-image-instance gl))
- 'text)
- ))
- (make-annotation gl (point) 'text)
+ (cond ((image-invalid-glyph-p gl)
+ (setq gl nil)
+ (message "Invalid glyph!")
+ )
+ ((eq (aref gl 0) 'xbm)
+ (let ((xbm-file
+ (make-temp-name (expand-file-name "tm" mime/tmp-dir))))
+ (insert (aref gl 2))
+ (write-region (point-min)(point-max) xbm-file)
+ (message "Decoding image...")
+ (delete-region (point-min)(point-max))
+ (bitmap-insert-xbm-file xbm-file)
+ (delete-file xbm-file)
+ )
+ (message "Decoding image... done")
+ )
+ (t
+ (setq gl (make-glyph gl))
+ (setq e (make-extent (point) (point)))
+ (set-extent-end-glyph e gl)
+ (message "Decoding image... done")
+ ))
)
(insert "\n")
))
(gif-file (concat file-base ".gif"))
)
(remove-text-properties beg end '(face nil))
+ (message "Decoding Postscript...")
(mime-decode-region beg end encoding)
(write-region (point-min)(point-max) ps-file)
+ (message "Decoding Postscript...")
(delete-region (point-min)(point-max))
(call-process mime-viewer/ps-to-gif-command nil nil nil ps-file)
- (let (gl)
- (while (progn
- (setq gl (make-glyph (vector 'gif :file gif-file)))
- (eq (image-instance-type (glyph-image-instance gl))
- 'text)
- ))
- (make-annotation gl (point) 'text)
- )
+ (set-extent-end-glyph (make-extent (point) (point))
+ (make-glyph (vector 'gif :file gif-file)))
+ (message "Decoding Postscript... done")
(delete-file ps-file)
(delete-file gif-file)
))
"application/postscript"
(function mime-preview/filter-for-application/postscript))
-
-;;; @ setting
-;;;
-
-(mapcar
- (lambda (ctype)
- (or (member ctype mime-viewer/default-showing-Content-Type-list)
- (setq mime-viewer/default-showing-Content-Type-list
- (cons ctype
- mime-viewer/default-showing-Content-Type-list))
- ))
- tm-image/inline-image-types)
+(if (featurep 'gif)
+ (add-to-list 'mime-viewer/default-showing-Content-Type-list
+ "application/postscript")
+ )
;;; @ end
;; Author: MORIOKA Tomohiko <morioka@jaist.ac.jp>
;; Created: 1995/12/7
-;; Version: $Id: tm-pgp.el,v 7.28 1997/01/29 15:18:53 morioka Exp $
+;; Version: $Id: tm-pgp.el,v 7.30 1997/02/11 08:57:58 morioka Exp $
;; Keywords: mail, news, MIME, multimedia, PGP, security
;; This file is part of tm (Tools for MIME).
(require 'tm-play)
-(defvar pgp-verify-function
- 'mc-verify "*PGP verify function.")
-
-(defvar pgp-decrypt-function
- 'mc-decrypt "*PGP decrypt function.")
-
-(defvar pgp-fetch-key-function
- 'mc-pgp-fetch-key "*PGP fetch key function.")
+(defvar pgp-function-alist
+ '((verify mc-verify "mc-toplev")
+ (decrypt mc-decrypt "mc-toplev")
+ (fetch-key mc-pgp-fetch-key "mc-pgp")
+ (snarf-keys mc-snarf-keys "mc-toplev")
+ ))
-(defvar pgp-snarf-keys-function
- 'mc-snarf-keys "*PGP snarf keys function.")
+(defsubst pgp-function (method)
+ (car (cdr (assq method pgp-function-alist)))
+ )
-(autoload pgp-verify-function "mc-toplev")
-(autoload pgp-decrypt-function "mc-toplev")
-(autoload pgp-fetch-key-function "mc-toplev")
-(autoload pgp-snarf-keys-function "mc-toplev")
+(mapcar (function
+ (lambda (method)
+ (autoload (second method)(third method))
+ ))
+ pgp-function-alist)
;;; @ internal method for application/pgp
(goto-char (point-min))
(re-search-forward "^-+BEGIN PGP SIGNED MESSAGE-+$" nil t)
)
- (funcall pgp-verify-function)
+ (funcall (pgp-function 'verify))
(goto-char (point-min))
(delete-region
(point-min)
(goto-char (point-min))
(re-search-forward "^-+BEGIN PGP MESSAGE-+$" nil t)
)
- (as-binary-process (funcall pgp-decrypt-function))
+ (as-binary-process (funcall (pgp-function 'decrypt)))
(goto-char (point-min))
(delete-region (point-min)
(and
(format "Key %s not found; attempt to fetch? " pgp-id))
)
(progn
- (funcall pgp-fetch-key-function (cons nil pgp-id))
+ (funcall (pgp-function 'fetch-key) (cons nil pgp-id))
(mime::article/call-pgp-to-check-signature
mime/output-buffer-name orig-file)
))
(delete-region (point-min) (match-end 0))
)
(mime-decode-region (point-min)(point-max) encoding)
- (funcall pgp-snarf-keys-function)
+ (funcall (pgp-function 'snarf-keys))
(kill-buffer (current-buffer))
))