I installed the package dired-icon and restarted Emacs. I then ran

M-x dired-icon-mode

But no icon shows up in Dired mode and in the minibuffer the following message is shown:

Opened text-plain.png in external program

enter image description here

In my init.el file:

(add-to-list 'load-path "~/.emacs.d/elpa/openwith")
;; https://github.com/emacsmirror/openwith
(require 'openwith)
;; Settings for package "openwith"
(when (require 'openwith nil 'noerror)
  (setq openwith-associations
     (list (openwith-make-extension-regexp '("doc" "docx" "rtf")) "word" '(file))
     (list (openwith-make-extension-regexp '("mpg" "mpeg" "mp3" "mp4" "avi" "wmv" "wav" "mov" "mkv")) "vlc" '(file))
     (list (openwith-make-extension-regexp '("pdf")) "FoxitReader" '(file))
     (list (openwith-make-extension-regexp '("bmp" "gif" "jpeg" "jpg" "png" "tif")) "xnview" '(file))
     (list (openwith-make-extension-regexp '("rdp")) "Remote Desctop Connection" '(file))
     (list (openwith-make-extension-regexp '("xls" "xlsx")) "excel" '(file))
  (openwith-mode 1))


Linux Mint 20

Emacs 26.3

What do I need to do, to see icons in Dired?

  • Can you show images in Emacs in general? I'm guessing no, from that error - in which case the question isn't about Dired or dired-icon. Sounds like you haven't done what it takes to have image support. Hopefully someone will advise you here. Please specify your OS etc., to help others help you.
    – Drew
    Mar 13, 2021 at 2:01
  • Do you have the openwith package installed? Mar 13, 2021 at 9:51
  • @FranBurstall Yes, I was installed package "openWith". I updated my post Mar 13, 2021 at 18:31
  • @Drew No I'm not show image in Emacs in general Mar 13, 2021 at 18:31
  • 1
    If you can't show images in your Emacs then please say that in the question itself. Comments can be deleted at any time - questions need to stand on their own. And in that case, please change the question and its title and tags (it's not about Dired), to indicate that that is your problem: how to set up Emacs so it shows images.
    – Drew
    Mar 14, 2021 at 3:28

1 Answer 1


The issue is that openwith is set to open any .png file with the external program xnview.

Remove "png" from the fourth openwith-make-extension-regexp list and reload. Now emacs will handle the .pngfile natively if it can.

  • Thanks. Now show icons in dired mode Mar 14, 2021 at 17:41

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Not the answer you're looking for? Browse other questions tagged or ask your own question.