Linux Mint 20

Emacs 26.3

I installed package dired-icon (https://www.topbug.net/dired-icon/) and restarted Emacs. I then did

M-x dired-icon-mode

But icon in dired mode does not show and in the mini buffer 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))
  • 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? – Fran Burstall Mar 13 at 9:51
  • @FranBurstall Yes, I was installed package "openWith". I updated my post – a_subscriber Mar 13 at 18:31
  • @Drew No I'm not show image in Emacs in general – a_subscriber 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

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 – a_subscriber 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.