• Home
  • History
  • Annotate
  • Raw
  • Download
  • only in /macosx-10.9.5/emacs-92/emacs/lisp/gnus/

Lines Matching +defs:mm +defs:view

0 ;;; mm-view.el --- functions for viewing MIME objects
31 (require 'mm-bodies)
32 (require 'mm-decode)
51 (defvar mm-text-html-renderer-alist
52 '((w3 . mm-inline-text-html-render-with-w3)
53 (w3m . mm-inline-text-html-render-with-w3m)
54 (w3m-standalone . mm-inline-text-html-render-with-w3m-standalone)
55 (links mm-inline-render-with-file
56 mm-links-remove-leading-blank
58 (lynx mm-inline-render-with-stdin nil
60 (html2text mm-inline-render-with-function html2text))
63 (defvar mm-text-html-washer-alist
67 (links mm-inline-wash-with-file
68 mm-links-remove-leading-blank
70 (lynx mm-inline-wash-with-stdin nil
75 (defcustom mm-fill-flowed t
87 (defun mm-inline-image-emacs (handle)
90 (put-image (mm-get-image handle) b)
92 (mm-handle-set-undisplayer
100 (defun mm-inline-image-xemacs (handle)
103 (let ((annot (make-annotation (mm-get-image handle) nil 'text))
105 (mm-handle-set-undisplayer
112 (set-extent-property annot 'mm t)
117 (defalias 'mm-inline-image 'mm-inline-image-xemacs)
118 (defalias 'mm-inline-image 'mm-inline-image-emacs)))
120 (defvar mm-w3-setup nil)
121 (defun mm-setup-w3 ()
122 (unless mm-w3-setup
128 (setq mm-w3-setup t)))
130 (defun mm-inline-text-html-render-with-w3 (handle)
131 (mm-setup-w3)
132 (let ((text (mm-get-part handle))
138 (url-generic-parse-url (format "cid:%s" (mm-handle-id handle))))
141 (mm-handle-type handle) 'charset)))
159 (mm-charset-to-coding-system bsubstr)))
162 (insert (mm-decode-string text charset))
177 (mm-handle-type handle) 'charset)))
182 (mm-insert-part handle)
184 (insert (mm-decode-string (mm-get-part handle)
188 (mm-handle-set-undisplayer
201 (defvar mm-w3m-setup nil
204 (defun mm-setup-w3m ()
206 (unless mm-w3m-setup
209 (push (cons 'gnus-article-mode 'mm-w3m-cid-retrieve)
211 (setq mm-w3m-setup t))
212 (setq w3m-display-inline-images mm-inline-text-html-with-images))
214 (defun mm-w3m-cid-retrieve-1 (url handle)
217 (when (equal url (mm-handle-id elem))
218 (mm-insert-part elem)
219 (throw 'found-handle (mm-handle-media-type elem)))
221 (equal "multipart" (mm-handle-media-supertype elem)))
222 (mm-w3m-cid-retrieve-1 url elem)))))
224 (defun mm-w3m-cid-retrieve (url &rest args)
228 (mm-w3m-cid-retrieve-1
236 (defun mm-inline-text-html-render-with-w3m (handle)
238 (mm-setup-w3m)
239 (let ((text (mm-get-part handle))
241 (charset (or (mail-content-type-get (mm-handle-type handle) 'charset)
244 (insert (if charset (mm-decode-string text charset) text))
251 (insert (mm-decode-string text charset))))
252 (let ((w3m-safe-url-regexp mm-w3m-safe-url-regexp)
255 (when (and mm-inline-text-html-with-w3m-keymap
262 'mm-inline-text-html-with-w3m t)))
263 (mm-handle-set-undisplayer
276 (defvar mm-w3m-standalone-supports-m17n-p (if (featurep 'mule) 'undecided)
279 (defun mm-w3m-standalone-supports-m17n-p ()
281 (cond ((eq mm-w3m-standalone-supports-m17n-p t) t)
282 ((eq mm-w3m-standalone-supports-m17n-p nil) nil)
283 ((not (featurep 'mule)) (setq mm-w3m-standalone-supports-m17n-p nil))
287 (str (mm-decode-coding-string "\
289 (mm-with-multibyte-buffer
297 (setq mm-w3m-standalone-supports-m17n-p t))
300 (setq mm-w3m-standalone-supports-m17n-p nil))))
302 (defun mm-inline-text-html-render-with-w3m-standalone (handle)
304 (if (mm-w3m-standalone-supports-m17n-p)
305 (let ((source (mm-get-part handle))
306 (charset (or (mail-content-type-get (mm-handle-type handle)
311 (setq cs (mm-charset-to-coding-system charset))
316 (mm-insert-inline
318 (mm-with-unibyte-buffer
320 (mm-enable-multibyte)
328 (mm-inline-render-with-stdin handle nil "w3m" "-dump" "-T" "text/html")))
330 (defun mm-links-remove-leading-blank ()
337 (defun mm-inline-wash-with-file (post-func cmd &rest args)
338 (let ((file (mm-make-temp-file
339 (expand-file-name "mm" mm-tmp-directory))))
348 (defun mm-inline-wash-with-stdin (post-func cmd &rest args)
354 (defun mm-inline-render-with-file (handle post-func cmd &rest args)
355 (let ((source (mm-get-part handle)))
356 (mm-insert-inline
358 (mm-with-unibyte-buffer
360 (apply 'mm-inline-wash-with-file post-func cmd args)
363 (defun mm-inline-render-with-stdin (handle post-func cmd &rest args)
364 (let ((source (mm-get-part handle)))
365 (mm-insert-inline
367 (mm-with-unibyte-buffer
369 (apply 'mm-inline-wash-with-stdin post-func cmd args)
372 (defun mm-inline-render-with-function (handle func &rest args)
373 (let ((source (mm-get-part handle))
374 (charset (or (mail-content-type-get (mm-handle-type handle) 'charset)
376 (mm-insert-inline
378 (mm-with-multibyte-buffer
380 (mm-decode-string source charset)
385 (defun mm-inline-text-html (handle)
386 (let* ((func (or mm-inline-text-html-renderer mm-text-html-renderer))
387 (entry (assq func mm-text-html-renderer-alist))
397 (defun mm-inline-text-vcard (handle)
399 (mm-insert-inline
404 (vcard-pretty-print (mm-get-part handle))
406 (vcard-parse-string (mm-get-part handle)
409 (defun mm-inline-text (handle)
411 (type (mm-handle-media-subtype handle))
413 (mm-handle-type handle) 'charset))
421 (mm-insert-part handle)
423 (insert (mm-decode-string (mm-get-part handle) charset)))
424 (when (and mm-fill-flowed
426 (equal (cdr (assoc 'format (mm-handle-type handle)))
440 (mm-handle-set-undisplayer
447 (defun mm-insert-inline (handle text)
451 (mm-handle-set-undisplayer
458 (defun mm-inline-audio (handle)
461 (defun mm-view-sound-file ()
464 (defun mm-w3-prepare-buffer ()
471 (defun mm-view-message ()
472 (mm-enable-multibyte)
475 ;; Double decode problem may happen. See mm-inline-message.
481 (mm-merge-handles gnus-article-mime-handles handles))))
485 (defun mm-inline-message (handle)
489 (mm-handle-type handle) 'charset))
499 (mm-insert-part handle)
504 (unless (eq charset 'gnus-decoded) ;; mm-uu might set it.
506 (let ((gnus-original-article-buffer (mm-handle-buffer handle)))
519 (mm-merge-handles gnus-article-mime-handles handles)))
520 (mm-handle-set-undisplayer
532 (defun mm-display-inline-fontify (handle mode)
543 (mm-insert-part handle)
565 (mm-insert-inline handle text)))
572 (defun mm-display-patch-inline (handle)
573 (mm-display-inline-fontify handle 'diff-mode))
575 (defun mm-display-elisp-inline (handle)
576 (mm-display-inline-fontify handle 'emacs-lisp-mode))
580 (defvar mm-pkcs7-signed-magic
581 (mm-string-as-unibyte
591 (defvar mm-pkcs7-enveloped-magic
592 (mm-string-as-unibyte
600 (defun mm-view-pkcs7-get-type (handle)
601 (mm-with-unibyte-buffer
602 (mm-insert-part handle)
603 (cond ((looking-at mm-pkcs7-enveloped-magic)
605 ((looking-at mm-pkcs7-signed-magic)
610 (defun mm-view-pkcs7 (handle)
611 (case (mm-view-pkcs7-get-type handle)
612 (enveloped (mm-view-pkcs7-decrypt handle))
613 (signed (mm-view-pkcs7-verify handle))
616 (defun mm-view-pkcs7-verify (handle)
618 (mm-insert-part handle)
634 (defun mm-view-pkcs7-decrypt (handle)
635 (insert-buffer-substring (mm-handle-buffer handle))
638 (mm-insert-headers "application/pkcs7-mime" "base64" "smime.p7m")
655 (provide 'mm-view)
658 ;;; mm-view.el ends here