2001-07-12 15:00:00 ShengHuo ZHU <zsh@cs.rochester.edu>
authorShengHuo ZHU <zsh@cs.rochester.edu>
Thu, 12 Jul 2001 23:44:43 +0000 (23:44 +0000)
committerShengHuo ZHU <zsh@cs.rochester.edu>
Thu, 12 Jul 2001 23:44:43 +0000 (23:44 +0000)
* mm-decode.el (mm-external-terminal-program): New variable.
(mm-display-external): Use it. Use term to display when no
window-system.

lisp/ChangeLog
lisp/mm-decode.el

index e2fd959..d3e73b8 100644 (file)
@@ -1,3 +1,9 @@
+2001-07-12 15:00:00  ShengHuo ZHU  <zsh@cs.rochester.edu>
+
+       * mm-decode.el (mm-external-terminal-program): New variable.
+       (mm-display-external): Use it. Use term to display when no
+       window-system.
+
 2001-07-12  Bj\e,Av\e(Brn Torkelsson  <torkel@hpc2n.umu.se>
 
        * gnus-srvr.el (gnus-browse-make-menu-bar): Changed one of the
index fe500c7..17839af 100644 (file)
@@ -35,7 +35,8 @@
 (require 'mail-parse)
 (require 'mailcap)
 (require 'mm-bodies)
-(eval-when-compile (require 'cl))
+(eval-when-compile (require 'cl)
+                   (require 'term))
 
 (eval-and-compile
   (autoload 'mm-inline-partial "mm-partial")
@@ -278,6 +279,11 @@ If not set, `default-directory' will be used."
   :type 'directory
   :group 'mime-display)
 
+(defcustom mm-external-terminal-program "xterm"
+  "The program to start an external terminal."
+  :type 'string
+  :group 'mime-display)
+
 ;;; Internal variables.
 
 (defvar mm-dissection-list nil)
@@ -613,12 +619,23 @@ external if displayed external."
          (message "Viewing with %s" method)
          (cond (needsterm
                 (unwind-protect
-                    (start-process "*display*" nil
-                                   "xterm"
-                                   "-e" shell-file-name
-                                   shell-command-switch
-                                   (mm-mailcap-command
-                                    method file (mm-handle-type handle)))
+                     (if window-system
+                         (start-process "*display*" nil
+                                        mm-external-terminal-program
+                                        "-e" shell-file-name
+                                        shell-command-switch
+                                        (mm-mailcap-command
+                                         method file (mm-handle-type handle)))
+                       (require 'term)
+                       (switch-to-buffer 
+                        (make-term "display"
+                                   shell-file-name
+                                   nil
+                                   shell-command-switch
+                                   (mm-mailcap-command
+                                    method file (mm-handle-type handle))))
+                       (term-mode)
+                       (term-char-mode))
                   (mm-handle-set-external-undisplayer handle (cons file buffer)))
                 (message "Displaying %s..." (format method file))
                 'external)