
dispicon - obtain a displayed icon for specified file name.
		  				       by Yuuichi Teranishi
							  ARISAWA Akihiro
							  Hideyuki Shirai

How to use:

Put dispicon.exe on your exec-path and put dispicon.el on your load-path.
Then put following setting on your '.emacs'.

(autoload 'dispicon "dispicon")

You can use following API:

FUNCTION
dispicon (filename &optional type size depth bgcolor ignore-errors)

Obtain an icon which associates to FILENAME.
If optional TYPE is specified, icon type is changed.
It is a symbol of `small' or `large' or `thumbnail'.
If second optional SIZE is specified, it is used as width and height of
the icon.
If third optional DEPTH is specified, it is used as the depth of the icon.
If fourth optional BGCOLOR is specified, it is used as the default bgcolor.
If fifth optional IGNORE-ERRORS is specified, error is ignored.

Customization:

If your Emacs does not support inline bmp type image, you have to convert
output of dispicon.exe.
For example, if your Emacs only supports xpm, create dispimage-xpm.bat
and set as follows:

(setq dispicon-program "dispicon-xpm.bat"
      dispicon-image-type 'xpm)

-----------------------------( dispimage-xpm.bat )-----------------------------
@dispicon.exe %* | convert bmp:- xpm:-
-------------------------------------------------------------------------------

How to setup:

;; Display icons on SEMI.
(eval-after-load "mime-view"
  '(defun mime-view-entity-title (entity)
     (or (mime-entity-read-field entity 'Content-Description)
	 (mime-entity-read-field entity 'Subject)
	 (let ((file (mime-entity-filename entity)))
	   (when file
	     (concat (dispicon file) file)))
	 "")))

;; Display icons on Dired.
(autoload 'dired-dispicon-setup
          "dired-dispicon" "dispicon & dropfile on dired" t)
(add-hook 'dired-mode-hook
	  (lambda ()
	    (define-key dired-mode-map "\C-c\C-d" 'dired-dispicon-toggle)
	    (define-key dired-mode-map "\C-c\C-t" 'dired-dispicon-toggle-type)
	    (dired-dispicon-setup)))
