(replace-space-with-underline): New inline function; copied from
[elisp/semi.git] / mime-view.el
index caa27a3..a4bdaa6 100644 (file)
@@ -6,7 +6,7 @@
 ;; Created: 1994/7/13
 ;;     Renamed: 1994/8/31 from tm-body.el
 ;;     Renamed: 1997/02/19 from tm-view.el
-;; Version: $Revision: 0.6 $
+;; Version: $Revision: 0.20 $
 ;; Keywords: MIME, multimedia, mail, news
 
 ;; This file is part of SEMI (SEMI is Emacs MIME Interfaces).
 
 ;;; Code:
 
-(require 'tl-str)
-(require 'tl-list)
-(require 'tl-atype)
-(require 'tl-misc)
+(require 'cl)
 (require 'std11)
 (require 'mel)
-(require 'tm-ew-d)
-(require 'tm-def)
+(require 'eword-decode)
 (require 'mime-parse)
 (require 'mime-text)
 
@@ -44,7 +40,7 @@
 ;;;
 
 (defconst mime-view-RCS-ID
-  "$Id: mime-view.el,v 0.6 1997-02-21 07:42:32 tmorioka Exp $")
+  "$Id: mime-view.el,v 0.20 1997-02-28 05:34:21 tmorioka Exp $")
 
 (defconst mime-view-version (get-version-string mime-view-RCS-ID))
 
@@ -234,7 +230,7 @@ Each elements are regexp of field-name. [mime-view.el]")
     (narrow-to-region (point)(point))
     (let ((access-type (assoc "access-type" params))
          (charset (assoc "charset" params))
-         (num (or (assoc-value "x-part-number" params)
+         (num (or (cdr (assoc "x-part-number" params))
                   (if (consp rcnum)
                       (mapconcat (function
                                   (lambda (num)
@@ -272,8 +268,8 @@ Each elements are regexp of field-name. [mime-view.el]")
                 )
               (insert rest)
               ))))
-    (tm:add-button (point-min)(1- (point-max))
-                  (function mime-view-play-content))
+    (mime-add-button (point-min)(1- (point-max))
+                    (function mime-view-play-content))
     ))
 
 (defun mime-preview/default-content-button-function
@@ -315,7 +311,7 @@ Each elements are regexp of field-name. [mime-view.el]")
 
 (defun mime-view-default-content-header-filter ()
   (mime-preview/cut-header)
-  (mime/decode-message-header)
+  (eword-decode-header)
   )
 
 (defvar mime-view-content-header-filter-alist nil)
@@ -504,7 +500,7 @@ The compressed face will be piped to this command.")
     (save-restriction
       (narrow-to-region beg end)
       (setq subj
-           (mime-eword/decode-string
+           (eword-decode-string
             (mime-article/get-subject params encoding)))
       )
     (set-buffer obuf)
@@ -581,8 +577,8 @@ The compressed face will be piped to this command.")
     (let ((be (point-max)))
       (narrow-to-region be be)
       (insert mime-view-announcement-for-message/partial)
-      (tm:add-button (point-min)(point-max)
-                    (function mime-view-play-content))
+      (mime-add-button (point-min)(point-max)
+                      (function mime-view-play-content))
       )))
 
 (defun mime-article/get-uu-filename (param &optional encoding)
@@ -713,31 +709,31 @@ The compressed face will be piped to this command.")
     )
   "Menu for MIME Viewer")
 
-(if running-xemacs
-    (progn
-      (defvar mime-view-xemacs-popup-menu
-       (cons mime-view-menu-title
-             (mapcar (function
-                      (lambda (item)
-                        (vector (nth 1 item)(nth 2 item) t)
-                        ))
-                     mime-view-menu-list)))
-      (defun mime-view-xemacs-popup-menu (event)
-       "Popup the menu in the MIME Viewer buffer"
-       (interactive "e")
-       (select-window (event-window event))
-       (set-buffer (event-buffer event))
-       (popup-menu 'mime-view-xemacs-popup-menu))
-      ))
+(cond (running-xemacs
+       (defvar mime-view-xemacs-popup-menu
+        (cons mime-view-menu-title
+              (mapcar (function
+                       (lambda (item)
+                         (vector (nth 1 item)(nth 2 item) t)
+                         ))
+                      mime-view-menu-list)))
+       (defun mime-view-xemacs-popup-menu (event)
+        "Popup the menu in the MIME Viewer buffer"
+        (interactive "e")
+        (select-window (event-window event))
+        (set-buffer (event-buffer event))
+        (popup-menu 'mime-view-xemacs-popup-menu))
+       (defvar mouse-button-2 'button2)
+       )
+      (t
+       (defvar mouse-button-2 [mouse-2])
+       ))
 
 (defun mime-view-define-keymap (&optional default)
   (let ((mime-view-mode-map (if (keymapp default)
                                (copy-keymap default)
                              (make-sparse-keymap)
                              )))
-    (or (keymapp default)
-       (suppress-keymap mime-view-mode-map)
-       )
     (define-key mime-view-mode-map
       "u"        (function mime-view-up-content))
     (define-key mime-view-mode-map
@@ -784,7 +780,7 @@ The compressed face will be piped to this command.")
              ))
     (if mouse-button-2
        (define-key mime-view-mode-map
-         mouse-button-2 (function tm:button-dispatcher))
+         mouse-button-2 (function mime-button-dispatcher))
       )
     (cond (running-xemacs
           (define-key mime-view-mode-map
@@ -1011,7 +1007,7 @@ button-2  Move to point under the mouse cursor
                      ))
                (setq rest (cdr rest))
                ))
-           (mime/decode-message-header)
+           (eword-decode-header)
            )
          (let ((f (cdr (assq mode mime-view-following-method-alist))))
            (if (functionp f)