0

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 
     (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))

Versions

Linux Mint 20

Emacs 26.3

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

6
  • 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 at 2:01
  • Do you have the openwith package installed? Mar 13 at 9:51
  • @FranBurstall Yes, I was installed package "openWith". I updated my post Mar 13 at 18:31
  • @Drew No I'm not show image in Emacs in general Mar 13 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 at 3:28
2

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.

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

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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