X-Git-Url: http://git.chise.org/gitweb/?a=blobdiff_plain;f=lisp%2Fmm-decode.el;h=ff8973949d91df47e7a8bf8bc58f567c0d8f71df;hb=d76871064e653ab5d23a4e0e6b2272cb46a1cf99;hp=78d0cb1492ad8ab274b117ecee2deb4f150dfbae;hpb=ee45385e3354a5a4ab01141305257feeca458dfc;p=elisp%2Fgnus.git- diff --git a/lisp/mm-decode.el b/lisp/mm-decode.el index 78d0cb1..ff89739 100644 --- a/lisp/mm-decode.el +++ b/lisp/mm-decode.el @@ -35,7 +35,8 @@ (require 'mail-parse) (require 'gnus-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) @@ -617,12 +623,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)