comparison lisp/gnus/mm-decode.el @ 65767:1b9137e0ecc1

(mm-inline-media-tests): Check presence of the diff-mode function rather than the diff-mode.el package. (mm-display-external): Use with-current-buffer. (mm-viewer-completion-map, mm-viewer-completion-map): Move initialization inside declaration.
author Stefan Monnier <monnier@iro.umontreal.ca>
date Sat, 01 Oct 2005 04:00:50 +0000
parents 5265a4059126
children 28264c86d408 aa89c814f853
comparison
equal deleted inserted replaced
65766:028535d7e8fc 65767:1b9137e0ecc1
220 ("text/plain" mm-inline-text identity) 220 ("text/plain" mm-inline-text identity)
221 ("text/enriched" mm-inline-text identity) 221 ("text/enriched" mm-inline-text identity)
222 ("text/richtext" mm-inline-text identity) 222 ("text/richtext" mm-inline-text identity)
223 ("text/x-patch" mm-display-patch-inline 223 ("text/x-patch" mm-display-patch-inline
224 (lambda (handle) 224 (lambda (handle)
225 (locate-library "diff-mode"))) 225 ;; If the diff-mode.el package is installed, the function is
226 ;; autoloaded. Checking (locate-library "diff-mode") would be trying
227 ;; to cater to broken installations. OTOH checking the function
228 ;; makes it possible to install another package which provides an
229 ;; alternative implementation of diff-mode. --Stef
230 (fboundp 'diff-mode)))
226 ("application/emacs-lisp" mm-display-elisp-inline identity) 231 ("application/emacs-lisp" mm-display-elisp-inline identity)
227 ("application/x-emacs-lisp" mm-display-elisp-inline identity) 232 ("application/x-emacs-lisp" mm-display-elisp-inline identity)
228 ("text/html" 233 ("text/html"
229 mm-inline-text-html 234 mm-inline-text-html
230 (lambda (handle) 235 (lambda (handle)
449 :group 'mime-security) 454 :group 'mime-security)
450 455
451 (defvar mm-viewer-completion-map 456 (defvar mm-viewer-completion-map
452 (let ((map (make-sparse-keymap 'mm-viewer-completion-map))) 457 (let ((map (make-sparse-keymap 'mm-viewer-completion-map)))
453 (set-keymap-parent map minibuffer-local-completion-map) 458 (set-keymap-parent map minibuffer-local-completion-map)
459 ;; Should we bind other key to minibuffer-complete-word?
460 (define-key map " " 'self-insert-command)
454 map) 461 map)
455 "Keymap for input viewer with completion.") 462 "Keymap for input viewer with completion.")
456
457 ;; Should we bind other key to minibuffer-complete-word?
458 (define-key mm-viewer-completion-map " " 'self-insert-command)
459 463
460 (defvar mm-viewer-completion-map 464 (defvar mm-viewer-completion-map
461 (let ((map (make-sparse-keymap 'mm-viewer-completion-map))) 465 (let ((map (make-sparse-keymap 'mm-viewer-completion-map)))
462 (set-keymap-parent map minibuffer-local-completion-map) 466 (set-keymap-parent map minibuffer-local-completion-map)
467 ;; Should we bind other key to minibuffer-complete-word?
468 (define-key map " " 'self-insert-command)
463 map) 469 map)
464 "Keymap for input viewer with completion.") 470 "Keymap for input viewer with completion.")
465
466 ;; Should we bind other key to minibuffer-complete-word?
467 (define-key mm-viewer-completion-map " " 'self-insert-command)
468 471
469 ;;; The functions. 472 ;;; The functions.
470 473
471 (defun mm-alist-to-plist (alist) 474 (defun mm-alist-to-plist (alist)
472 "Convert association list ALIST into the equivalent property-list form. 475 "Convert association list ALIST into the equivalent property-list form.
562 (mm-alist-to-plist (cdr ctl)) (car ctl)) 565 (mm-alist-to-plist (cdr ctl)) (car ctl))
563 566
564 ;; what really needs to be done here is a way to link a 567 ;; what really needs to be done here is a way to link a
565 ;; MIME handle back to it's parent MIME handle (in a multilevel 568 ;; MIME handle back to it's parent MIME handle (in a multilevel
566 ;; MIME article). That would probably require changing 569 ;; MIME article). That would probably require changing
567 ;; the mm-handle API so we simply store the multipart buffert 570 ;; the mm-handle API so we simply store the multipart buffer
568 ;; name as a text property of the "multipart/whatever" string. 571 ;; name as a text property of the "multipart/whatever" string.
569 (add-text-properties 0 (length (car ctl)) 572 (add-text-properties 0 (length (car ctl))
570 (list 'buffer (mm-copy-to-buffer) 573 (list 'buffer (mm-copy-to-buffer)
571 'from from 574 'from from
572 'start start) 575 'start start)
805 nil 808 nil
806 shell-command-switch 809 shell-command-switch
807 (mm-mailcap-command 810 (mm-mailcap-command
808 method file (mm-handle-type handle))) 811 method file (mm-handle-type handle)))
809 (if (buffer-live-p buffer) 812 (if (buffer-live-p buffer)
810 (save-excursion 813 (with-current-buffer buffer
811 (set-buffer buffer)
812 (buffer-string)))) 814 (buffer-string))))
813 (progn 815 (progn
814 (ignore-errors (delete-file file)) 816 (ignore-errors (delete-file file))
815 (ignore-errors (delete-directory 817 (ignore-errors (delete-directory
816 (file-name-directory file))) 818 (file-name-directory file)))