changeset 32962:496ce24f9ddc

2000-10-27 Dave Love <fx@gnu.org> * mm-decode.el (mm-valid-and-fit-image-p): Don't test display-graphic-p here. 2000-10-27 ShengHuo ZHU <zsh@cs.rochester.edu> * mm-decode.el (mm-viewer-completion-map): New. (mm-interactively-view-part): Use it.
author Dave Love <fx@gnu.org>
date Fri, 27 Oct 2000 16:45:53 +0000
parents 5357dbf00515
children 214c0fec919e
files lisp/gnus/mm-decode.el
diffstat 1 files changed, 14 insertions(+), 3 deletions(-) [+]
line wrap: on
line diff
--- a/lisp/gnus/mm-decode.el	Fri Oct 27 16:31:57 2000 +0000
+++ b/lisp/gnus/mm-decode.el	Fri Oct 27 16:45:53 2000 +0000
@@ -3,6 +3,7 @@
 
 ;; Author: Lars Magne Ingebrigtsen <larsi@gnus.org>
 ;;	MORIOKA Tomohiko <morioka@jaist.ac.jp>
+;; Maintainer: bugs@gnus.org
 ;; This file is part of GNU Emacs.
 
 ;; GNU Emacs is free software; you can redistribute it and/or modify
@@ -219,6 +220,15 @@
 ;; "message/rfc822".
 (defvar mm-dissect-default-type "text/plain")
 
+(defvar mm-viewer-completion-map
+  (let ((map (make-sparse-keymap 'mm-viewer-completion-map)))
+    (set-keymap-parent map minibuffer-local-completion-map)
+    map)
+  "Keymap for input viewer with completion.")
+
+;; Should we bind other key to minibuffer-complete-word?
+(define-key mm-viewer-completion-map " " 'self-insert-command) 
+
 ;;; The functions.
 
 (defun mm-dissect-buffer (&optional no-strict-mime)
@@ -710,7 +720,9 @@
 	 (methods
 	  (mapcar (lambda (i) (list (cdr (assoc 'viewer i))))
 		  (mailcap-mime-info type 'all)))
-	 (method (completing-read "Viewer: " methods)))
+	 (method (let ((minibuffer-local-completion-map
+			mm-viewer-completion-map))
+		   (completing-read "Viewer: " methods))))
     (when (string= method "")
       (error "No method given"))
     (if (string-match "^[^% \t]+$" method) 
@@ -828,8 +840,7 @@
 
 (defun mm-valid-and-fit-image-p (format handle)
   "Say whether FORMAT can be displayed natively and HANDLE fits the window."
-  (and (display-graphic-p)
-       (mm-valid-image-format-p format)
+  (and (mm-valid-image-format-p format)
        (mm-image-fit-p handle)))
 
 (provide 'mm-decode)