From 8e8fcc9f65b9eedc9efd946fb5ab3821b0fe1a3d Mon Sep 17 00:00:00 2001 From: Jimmy Yuen Ho Wong Date: Sat, 28 Mar 2020 19:06:58 +0000 Subject: [PATCH 01/32] make icons use same color as the text --- all-the-icons-dired.el | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/all-the-icons-dired.el b/all-the-icons-dired.el index 0eea72a..2cc3d5c 100644 --- a/all-the-icons-dired.el +++ b/all-the-icons-dired.el @@ -47,6 +47,11 @@ :group 'all-the-icons :type 'number) +(defcustom all-the-icons-dired-monochrome t + "Whether to show the icons as the same color as the text on the same line." + :group 'all-the-icons + :type 'boolean) + (defvar all-the-icons-dired-mode) (defun all-the-icons-dired--add-overlay (pos string) @@ -86,7 +91,11 @@ (all-the-icons-icon-for-dir file :face 'all-the-icons-dired-dir-face :v-adjust all-the-icons-dired-v-adjust) - (all-the-icons-icon-for-file file :v-adjust all-the-icons-dired-v-adjust)))) + (apply 'all-the-icons-icon-for-file file + (append + `(:v-adjust ,all-the-icons-dired-v-adjust) + (when all-the-icons-dired-monochrome + `(:face ,(face-at-point)))))))) (if (member file '("." "..")) (all-the-icons-dired--add-overlay (point) " \t") (all-the-icons-dired--add-overlay (point) (concat icon "\t"))))))) From 9d568c18749a7fffc14bd79e1bf51afb3df17a99 Mon Sep 17 00:00:00 2001 From: Eder Elorriaga Date: Thu, 26 Nov 2020 12:00:46 +0100 Subject: [PATCH 02/32] Refresh icons after directory creation --- all-the-icons-dired.el | 2 ++ 1 file changed, 2 insertions(+) diff --git a/all-the-icons-dired.el b/all-the-icons-dired.el index 0eea72a..fa282c6 100644 --- a/all-the-icons-dired.el +++ b/all-the-icons-dired.el @@ -107,6 +107,7 @@ (advice-add 'dired-internal-do-deletions :around #'all-the-icons-dired--refresh-advice) (advice-add 'dired-insert-subdir :around #'all-the-icons-dired--refresh-advice) (advice-add 'dired-do-kill-lines :around #'all-the-icons-dired--refresh-advice) + (advice-add 'dired-create-directory :around #'all-the-icons-dired--refresh-advice) (with-eval-after-load 'dired-narrow (advice-add 'dired-narrow--internal :around #'all-the-icons-dired--refresh-advice)) (all-the-icons-dired--refresh))) @@ -119,6 +120,7 @@ (advice-remove 'dired-narrow--internal #'all-the-icons-dired--refresh-advice) (advice-remove 'dired-insert-subdir #'all-the-icons-dired--refresh-advice) (advice-remove 'dired-do-kill-lines #'all-the-icons-dired--refresh-advice) + (advice-remove 'dired-create-directory #'all-the-icons-dired--refresh-advice) (all-the-icons-dired--remove-all-overlays)) ;;;###autoload From ea895578d9f9fa5e1ed66d7e07b056bf664ba2a3 Mon Sep 17 00:00:00 2001 From: Eder Elorriaga Date: Thu, 26 Nov 2020 12:01:11 +0100 Subject: [PATCH 03/32] Refresh icons after rename --- all-the-icons-dired.el | 2 ++ 1 file changed, 2 insertions(+) diff --git a/all-the-icons-dired.el b/all-the-icons-dired.el index fa282c6..9ce1194 100644 --- a/all-the-icons-dired.el +++ b/all-the-icons-dired.el @@ -108,6 +108,7 @@ (advice-add 'dired-insert-subdir :around #'all-the-icons-dired--refresh-advice) (advice-add 'dired-do-kill-lines :around #'all-the-icons-dired--refresh-advice) (advice-add 'dired-create-directory :around #'all-the-icons-dired--refresh-advice) + (advice-add 'dired-do-rename :around #'all-the-icons-dired--refresh-advice) (with-eval-after-load 'dired-narrow (advice-add 'dired-narrow--internal :around #'all-the-icons-dired--refresh-advice)) (all-the-icons-dired--refresh))) @@ -121,6 +122,7 @@ (advice-remove 'dired-insert-subdir #'all-the-icons-dired--refresh-advice) (advice-remove 'dired-do-kill-lines #'all-the-icons-dired--refresh-advice) (advice-remove 'dired-create-directory #'all-the-icons-dired--refresh-advice) + (advice-remove 'dired-do-rename #'all-the-icons-dired--refresh-advice) (all-the-icons-dired--remove-all-overlays)) ;;;###autoload From 785cf508c45399fb1bcb5495f2e189bfa5ae78b3 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Sebastian=20Reu=C3=9Fe?= Date: Sat, 9 Jan 2021 11:46:54 +0100 Subject: [PATCH 04/32] Display icons in find-dired output find-dired is not covered by any of the existing advice, so no refresh will be triggered. Since find-dired runs find in a subprocess, we advise the process sentinel instead of find-dired itself. Resolves #48 --- all-the-icons-dired.el | 3 +++ 1 file changed, 3 insertions(+) diff --git a/all-the-icons-dired.el b/all-the-icons-dired.el index 0eea72a..70f8cb2 100644 --- a/all-the-icons-dired.el +++ b/all-the-icons-dired.el @@ -34,6 +34,7 @@ (require 'cl-lib) (require 'dired) +(require 'find-dired) (require 'all-the-icons) (defface all-the-icons-dired-dir-face @@ -107,6 +108,7 @@ (advice-add 'dired-internal-do-deletions :around #'all-the-icons-dired--refresh-advice) (advice-add 'dired-insert-subdir :around #'all-the-icons-dired--refresh-advice) (advice-add 'dired-do-kill-lines :around #'all-the-icons-dired--refresh-advice) + (advice-add 'find-dired-sentinel :around #'all-the-icons-dired--refresh-advice) (with-eval-after-load 'dired-narrow (advice-add 'dired-narrow--internal :around #'all-the-icons-dired--refresh-advice)) (all-the-icons-dired--refresh))) @@ -119,6 +121,7 @@ (advice-remove 'dired-narrow--internal #'all-the-icons-dired--refresh-advice) (advice-remove 'dired-insert-subdir #'all-the-icons-dired--refresh-advice) (advice-remove 'dired-do-kill-lines #'all-the-icons-dired--refresh-advice) + (advice-remove 'find-dired-sentinel #'all-the-icons-dired--refresh-advice) (all-the-icons-dired--remove-all-overlays)) ;;;###autoload From c95dfd9c849931e1d3f96d1735dec9c74e7b81bd Mon Sep 17 00:00:00 2001 From: Jimmy Yuen Ho Wong Date: Thu, 11 Feb 2021 11:09:22 +0000 Subject: [PATCH 05/32] Remove check to detect display Closes jtbm37/all-the-icons-dired#51 and jtbm37/all-the-icons-dired#52 --- all-the-icons-dired.el | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/all-the-icons-dired.el b/all-the-icons-dired.el index 2379901..ddc08b2 100644 --- a/all-the-icons-dired.el +++ b/all-the-icons-dired.el @@ -141,7 +141,7 @@ (define-minor-mode all-the-icons-dired-mode "Display all-the-icons icon for each files in a dired buffer." :lighter " all-the-icons-dired-mode" - (when (and (derived-mode-p 'dired-mode) (display-graphic-p)) + (when (derived-mode-p 'dired-mode) (if all-the-icons-dired-mode (all-the-icons-dired--setup) (all-the-icons-dired--teardown)))) From 2123f786bc824ef89306953939acbc312639f178 Mon Sep 17 00:00:00 2001 From: Jimmy Yuen Ho Wong Date: Thu, 11 Feb 2021 12:21:46 +0000 Subject: [PATCH 06/32] Refactor advices Closes jtbm37/all-the-icons-dired#35 --- all-the-icons-dired.el | 45 +++++++++++++++++++++--------------------- 1 file changed, 22 insertions(+), 23 deletions(-) diff --git a/all-the-icons-dired.el b/all-the-icons-dired.el index ddc08b2..ca952f5 100644 --- a/all-the-icons-dired.el +++ b/all-the-icons-dired.el @@ -34,7 +34,6 @@ (require 'cl-lib) (require 'dired) -(require 'find-dired) (require 'all-the-icons) (defface all-the-icons-dired-dir-face @@ -108,33 +107,33 @@ (when all-the-icons-dired-mode (all-the-icons-dired--refresh))) +(defvar all-the-icons-dired-advice-alist + '((dired-aux dired-create-directory all-the-icons-dired--refresh-advice) + (dired-aux dired-do-create-files all-the-icons-dired--refresh-advice) + (dired-aux dired-do-kill-lines all-the-icons-dired--refresh-advice) + (dired-aux dired-do-rename all-the-icons-dired--refresh-advice) + (dired-aux dired-insert-subdir all-the-icons-dired--refresh-advice) + (dired dired-internal-do-deletions all-the-icons-dired--refresh-advice) + (dired-narrow dired-narrow--internal all-the-icons-dired--refresh-advice) + (dired dired-readin all-the-icons-dired--refresh-advice) + (dired dired-revert all-the-icons-dired--refresh-advice) + (find-dired find-dired-sentinel all-the-icons-dired--refresh-advice)) + "A list of file, adviced function, and advice function.") + (defun all-the-icons-dired--setup () "Setup `all-the-icons-dired'." - (when (derived-mode-p 'dired-mode) - (setq-local tab-width 1) - (advice-add 'dired-readin :around #'all-the-icons-dired--refresh-advice) - (advice-add 'dired-revert :around #'all-the-icons-dired--refresh-advice) - (advice-add 'dired-internal-do-deletions :around #'all-the-icons-dired--refresh-advice) - (advice-add 'dired-insert-subdir :around #'all-the-icons-dired--refresh-advice) - (advice-add 'dired-do-kill-lines :around #'all-the-icons-dired--refresh-advice) - (advice-add 'dired-create-directory :around #'all-the-icons-dired--refresh-advice) - (advice-add 'dired-do-rename :around #'all-the-icons-dired--refresh-advice) - (advice-add 'find-dired-sentinel :around #'all-the-icons-dired--refresh-advice) - (with-eval-after-load 'dired-narrow - (advice-add 'dired-narrow--internal :around #'all-the-icons-dired--refresh-advice)) - (all-the-icons-dired--refresh))) + (setq-local tab-width 1) + (pcase-dolist (`(,file ,sym ,fn) all-the-icons-dired-advice-alist) + (with-eval-after-load file + (advice-add sym :around fn))) + (all-the-icons-dired--refresh)) (defun all-the-icons-dired--teardown () "Functions used as advice when redisplaying buffer." - (advice-remove 'dired-readin #'all-the-icons-dired--refresh-advice) - (advice-remove 'dired-revert #'all-the-icons-dired--refresh-advice) - (advice-remove 'dired-internal-do-deletions #'all-the-icons-dired--refresh-advice) - (advice-remove 'dired-narrow--internal #'all-the-icons-dired--refresh-advice) - (advice-remove 'dired-insert-subdir #'all-the-icons-dired--refresh-advice) - (advice-remove 'dired-do-kill-lines #'all-the-icons-dired--refresh-advice) - (advice-remove 'dired-create-directory #'all-the-icons-dired--refresh-advice) - (advice-remove 'dired-do-rename #'all-the-icons-dired--refresh-advice) - (advice-remove 'find-dired-sentinel #'all-the-icons-dired--refresh-advice) + (kill-local-variable tab-width) + (pcase-dolist (`(,file ,sym ,fn) all-the-icons-dired-advice-alist) + (with-eval-after-load file + (advice-remove sym fn))) (all-the-icons-dired--remove-all-overlays)) ;;;###autoload From dd685166818b92470bcccb3e398f2d443f513e63 Mon Sep 17 00:00:00 2001 From: Jimmy Yuen Ho Wong Date: Sat, 27 Feb 2021 19:43:05 +0000 Subject: [PATCH 07/32] Fork notice --- README.org | 3 +++ 1 file changed, 3 insertions(+) diff --git a/README.org b/README.org index ad20fc0..c862d92 100644 --- a/README.org +++ b/README.org @@ -1,6 +1,9 @@ #+TITLE: all-the-icons-dired #+AUTHOR: jtbm37 #+DATE: 2016-11-08 +** Note +Since 2021-02-21, this is now the fork the =all-the-icons-dired= Melpa recipe points to. Changes can be seen [[https://github.com/jtbm37/all-the-icons-dired/compare/master...wyuenho:master][here]]. + [[file:logo.png]] This adds dired support to [[https://github.com/domtronn/all-the-icons.el][all-the-icons]]. From 6d434065fd0658a9fd5c56dd49c9c85460a615b3 Mon Sep 17 00:00:00 2001 From: Boris Glavic Date: Tue, 2 Mar 2021 07:40:35 -0600 Subject: [PATCH 08/32] kill-local-variable takes symbol causing deactivating of all-the-icons-dired mode to fail --- all-the-icons-dired.el | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/all-the-icons-dired.el b/all-the-icons-dired.el index ca952f5..8aee964 100644 --- a/all-the-icons-dired.el +++ b/all-the-icons-dired.el @@ -130,7 +130,7 @@ (defun all-the-icons-dired--teardown () "Functions used as advice when redisplaying buffer." - (kill-local-variable tab-width) + (kill-local-variable 'tab-width) (pcase-dolist (`(,file ,sym ,fn) all-the-icons-dired-advice-alist) (with-eval-after-load file (advice-remove sym fn))) From 0b929d2b339058289d9239cc965d791ade21318c Mon Sep 17 00:00:00 2001 From: Jimmy Yuen Ho Wong Date: Thu, 8 Apr 2021 16:46:02 +0100 Subject: [PATCH 09/32] Update URL and copyright notice --- all-the-icons-dired.el | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/all-the-icons-dired.el b/all-the-icons-dired.el index 8aee964..0ca4914 100644 --- a/all-the-icons-dired.el +++ b/all-the-icons-dired.el @@ -1,12 +1,14 @@ ;;; all-the-icons-dired.el --- Shows icons for each file in dired mode -*- lexical-binding: t; -*- -;; Copyright (C) 2016 jtbm37 +;; Copyright (C) 2016-2020 jtbm37 +;; Copyright (C) 2021 Jimmy Yuen Ho Wong ;; Author: jtbm37 +;; Maintainer: Jimmy Yuen Ho Wong ;; Version: 1.0 ;; Keywords: files icons dired ;; Package-Requires: ((emacs "24.4") (all-the-icons "2.2.0")) -;; URL: https://github.com/jtbm37/all-the-icons-dired +;; URL: https://github.com/wyuenho/all-the-icons-dired ;; This program is free software; you can redistribute it and/or modify ;; it under the terms of the GNU General Public License as published by From 07f035d2f6df4f1e840572784a96f5b407a74680 Mon Sep 17 00:00:00 2001 From: Jimmy Yuen Ho Wong Date: Sun, 11 Apr 2021 13:24:58 +0100 Subject: [PATCH 10/32] Fix #3 ensure case-fold-search under dired --- all-the-icons-dired.el | 28 ++++++++++++++-------------- 1 file changed, 14 insertions(+), 14 deletions(-) diff --git a/all-the-icons-dired.el b/all-the-icons-dired.el index 0ca4914..ba6637e 100644 --- a/all-the-icons-dired.el +++ b/all-the-icons-dired.el @@ -87,20 +87,20 @@ (goto-char (point-min)) (while (not (eobp)) (when (dired-move-to-filename nil) - (let ((file (dired-get-filename 'relative 'noerror))) - (when file - (let ((icon (if (file-directory-p file) - (all-the-icons-icon-for-dir file - :face 'all-the-icons-dired-dir-face - :v-adjust all-the-icons-dired-v-adjust) - (apply 'all-the-icons-icon-for-file file - (append - `(:v-adjust ,all-the-icons-dired-v-adjust) - (when all-the-icons-dired-monochrome - `(:face ,(face-at-point)))))))) - (if (member file '("." "..")) - (all-the-icons-dired--add-overlay (point) " \t") - (all-the-icons-dired--add-overlay (point) (concat icon "\t"))))))) + (let ((case-fold-search t)) + (when-let* ((file (dired-get-filename 'relative 'noerror)) + (icon (if (file-directory-p file) + (all-the-icons-icon-for-dir file + :face 'all-the-icons-dired-dir-face + :v-adjust all-the-icons-dired-v-adjust) + (apply 'all-the-icons-icon-for-file file + (append + `(:v-adjust ,all-the-icons-dired-v-adjust) + (when all-the-icons-dired-monochrome + `(:face ,(face-at-point)))))))) + (if (member file '("." "..")) + (all-the-icons-dired--add-overlay (point) " \t") + (all-the-icons-dired--add-overlay (point) (concat icon "\t")))))) (forward-line 1)))) (defun all-the-icons-dired--refresh-advice (fn &rest args) From 5408e17600814b656817fb2c423a2f7db42bb856 Mon Sep 17 00:00:00 2001 From: Jimmy Yuen Ho Wong Date: Mon, 12 Apr 2021 16:01:37 +0100 Subject: [PATCH 11/32] Update issue templates --- .github/ISSUE_TEMPLATE/bug_report.md | 30 ++++++++++++++++++++++++++++ 1 file changed, 30 insertions(+) create mode 100644 .github/ISSUE_TEMPLATE/bug_report.md diff --git a/.github/ISSUE_TEMPLATE/bug_report.md b/.github/ISSUE_TEMPLATE/bug_report.md new file mode 100644 index 0000000..caec07b --- /dev/null +++ b/.github/ISSUE_TEMPLATE/bug_report.md @@ -0,0 +1,30 @@ +--- +name: Bug report +about: Create a report to help us improve +title: '' +labels: '' +assignees: '' + +--- + +**Describe the bug** +A clear and concise description of what the bug is. + +**To Reproduce** +Steps to reproduce the behavior: +1. Go to '...' +2. Click on '....' +3. Scroll down to '....' +4. See error + +**Expected behavior** +A clear and concise description of what you expected to happen. + +**Screenshots** +If applicable, add screenshots to help explain your problem. + +**System** +If you think this is important, please also tell me about which version and which port of emacs you are running. + +**Additional context** +Add any other context about the problem here. From dd7dd2777e6501b078d2a1a395b4458e5564b606 Mon Sep 17 00:00:00 2001 From: Jimmy Yuen Ho Wong Date: Mon, 12 Apr 2021 16:14:15 +0100 Subject: [PATCH 12/32] Add note on how to get backtrace --- .github/ISSUE_TEMPLATE/bug_report.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/ISSUE_TEMPLATE/bug_report.md b/.github/ISSUE_TEMPLATE/bug_report.md index caec07b..284b2ac 100644 --- a/.github/ISSUE_TEMPLATE/bug_report.md +++ b/.github/ISSUE_TEMPLATE/bug_report.md @@ -8,7 +8,7 @@ assignees: '' --- **Describe the bug** -A clear and concise description of what the bug is. +A clear and concise description of what the bug is. Set `debug-on-error` to `t` to capture a backtrace. **To Reproduce** Steps to reproduce the behavior: From 82d09a39f74b4f46bdc9c27d9303f121c6a35e13 Mon Sep 17 00:00:00 2001 From: Jimmy Yuen Ho Wong Date: Fri, 16 Apr 2021 23:10:23 +0100 Subject: [PATCH 13/32] Fix void var file error --- all-the-icons-dired.el | 1 + 1 file changed, 1 insertion(+) diff --git a/all-the-icons-dired.el b/all-the-icons-dired.el index ba6637e..b22ae8f 100644 --- a/all-the-icons-dired.el +++ b/all-the-icons-dired.el @@ -37,6 +37,7 @@ (require 'cl-lib) (require 'dired) (require 'all-the-icons) +(require 'subr-x) (defface all-the-icons-dired-dir-face '((((background dark)) :foreground "white") From 65e15ec36acf9432b48b67781474922ce27cee22 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jacob=20Ils=C3=B8?= Date: Wed, 21 Apr 2021 19:31:23 +0200 Subject: [PATCH 14/32] Refresh icons when aborting wdired --- all-the-icons-dired.el | 1 + 1 file changed, 1 insertion(+) diff --git a/all-the-icons-dired.el b/all-the-icons-dired.el index b22ae8f..89dcf32 100644 --- a/all-the-icons-dired.el +++ b/all-the-icons-dired.el @@ -116,6 +116,7 @@ (dired-aux dired-do-kill-lines all-the-icons-dired--refresh-advice) (dired-aux dired-do-rename all-the-icons-dired--refresh-advice) (dired-aux dired-insert-subdir all-the-icons-dired--refresh-advice) + (dired wdired-abort-changes all-the-icons-dired--refresh-advice) (dired dired-internal-do-deletions all-the-icons-dired--refresh-advice) (dired-narrow dired-narrow--internal all-the-icons-dired--refresh-advice) (dired dired-readin all-the-icons-dired--refresh-advice) From f0bad10df82d39d8762db64e2c286f40b3dac7b5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jacob=20Ils=C3=B8?= Date: Wed, 21 Apr 2021 19:32:21 +0200 Subject: [PATCH 15/32] Fixed typo --- all-the-icons-dired.el | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/all-the-icons-dired.el b/all-the-icons-dired.el index 89dcf32..6388190 100644 --- a/all-the-icons-dired.el +++ b/all-the-icons-dired.el @@ -142,7 +142,7 @@ ;;;###autoload (define-minor-mode all-the-icons-dired-mode - "Display all-the-icons icon for each files in a dired buffer." + "Display all-the-icons icon for each file in a dired buffer." :lighter " all-the-icons-dired-mode" (when (derived-mode-p 'dired-mode) (if all-the-icons-dired-mode From a758766878b6e8b9eaaf41d68599a2df99e37f48 Mon Sep 17 00:00:00 2001 From: Jimmy Yuen Ho Wong Date: Mon, 14 Jun 2021 14:50:22 +0100 Subject: [PATCH 16/32] Version 2.0 --- all-the-icons-dired.el | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/all-the-icons-dired.el b/all-the-icons-dired.el index 6388190..625b027 100644 --- a/all-the-icons-dired.el +++ b/all-the-icons-dired.el @@ -5,7 +5,7 @@ ;; Author: jtbm37 ;; Maintainer: Jimmy Yuen Ho Wong -;; Version: 1.0 +;; Version: 2.0 ;; Keywords: files icons dired ;; Package-Requires: ((emacs "24.4") (all-the-icons "2.2.0")) ;; URL: https://github.com/wyuenho/all-the-icons-dired From 42d8d2890ff2b565bc2f37bce09abd59fdcb6257 Mon Sep 17 00:00:00 2001 From: Daniel Nagy Date: Sat, 31 Jul 2021 19:31:48 +0200 Subject: [PATCH 17/32] Add support for `dired-subtree` This adds support for `dired-subtree`, see: https://melpa.org/#/dired-subtree https://github.com/Fuco1/dired-hacks/blob/master/dired-subtree.el --- all-the-icons-dired.el | 2 ++ 1 file changed, 2 insertions(+) diff --git a/all-the-icons-dired.el b/all-the-icons-dired.el index 625b027..4c6e1f5 100644 --- a/all-the-icons-dired.el +++ b/all-the-icons-dired.el @@ -119,6 +119,8 @@ (dired wdired-abort-changes all-the-icons-dired--refresh-advice) (dired dired-internal-do-deletions all-the-icons-dired--refresh-advice) (dired-narrow dired-narrow--internal all-the-icons-dired--refresh-advice) + (dired-subtree dired-subtree-insert all-the-icons-dired--refresh-advice) + (dired-subtree dired-subtree-remove all-the-icons-dired--refresh-advice) (dired dired-readin all-the-icons-dired--refresh-advice) (dired dired-revert all-the-icons-dired--refresh-advice) (find-dired find-dired-sentinel all-the-icons-dired--refresh-advice)) From 7c426932045e5cc47804558b12d81d5177d9fdd7 Mon Sep 17 00:00:00 2001 From: Pavel Kulyov Date: Fri, 1 Oct 2021 09:23:12 +0300 Subject: [PATCH 18/32] Refresh on dired-kill-subdir Signed-off-by: Pavel Kulyov --- all-the-icons-dired.el | 1 + 1 file changed, 1 insertion(+) diff --git a/all-the-icons-dired.el b/all-the-icons-dired.el index 625b027..3e53b06 100644 --- a/all-the-icons-dired.el +++ b/all-the-icons-dired.el @@ -116,6 +116,7 @@ (dired-aux dired-do-kill-lines all-the-icons-dired--refresh-advice) (dired-aux dired-do-rename all-the-icons-dired--refresh-advice) (dired-aux dired-insert-subdir all-the-icons-dired--refresh-advice) + (dired-aux dired-kill-subdir all-the-icons-dired--refresh-advice) (dired wdired-abort-changes all-the-icons-dired--refresh-advice) (dired dired-internal-do-deletions all-the-icons-dired--refresh-advice) (dired-narrow dired-narrow--internal all-the-icons-dired--refresh-advice) From 46ca70416391c1bf3a2b148c4a636dee249aa1b3 Mon Sep 17 00:00:00 2001 From: Jimmy Yuen Ho Wong Date: Thu, 7 Oct 2021 15:05:23 +0100 Subject: [PATCH 19/32] Return result of adviced functions --- all-the-icons-dired.el | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/all-the-icons-dired.el b/all-the-icons-dired.el index 5153468..a661779 100644 --- a/all-the-icons-dired.el +++ b/all-the-icons-dired.el @@ -106,9 +106,10 @@ (defun all-the-icons-dired--refresh-advice (fn &rest args) "Advice function for FN with ARGS." - (apply fn args) - (when all-the-icons-dired-mode - (all-the-icons-dired--refresh))) + (let ((result (apply fn args))) + (when all-the-icons-dired-mode + (all-the-icons-dired--refresh)) + result)) (defvar all-the-icons-dired-advice-alist '((dired-aux dired-create-directory all-the-icons-dired--refresh-advice) From 5e9b097f9950cc9f86de922b07903a4e5fefc733 Mon Sep 17 00:00:00 2001 From: Jimmy Yuen Ho Wong Date: Thu, 7 Oct 2021 18:29:28 +0100 Subject: [PATCH 20/32] Use prog1 --- all-the-icons-dired.el | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/all-the-icons-dired.el b/all-the-icons-dired.el index a661779..2ed7dd7 100644 --- a/all-the-icons-dired.el +++ b/all-the-icons-dired.el @@ -106,10 +106,9 @@ (defun all-the-icons-dired--refresh-advice (fn &rest args) "Advice function for FN with ARGS." - (let ((result (apply fn args))) + (prog1 (apply fn args) (when all-the-icons-dired-mode - (all-the-icons-dired--refresh)) - result)) + (all-the-icons-dired--refresh)))) (defvar all-the-icons-dired-advice-alist '((dired-aux dired-create-directory all-the-icons-dired--refresh-advice) From de9b14c8d25a35bd6399336407f5bb746d771dc6 Mon Sep 17 00:00:00 2001 From: Jimmy Yuen Ho Wong Date: Fri, 4 Mar 2022 07:28:59 +0000 Subject: [PATCH 21/32] Fix #10 put icon before file name during redisplay --- all-the-icons-dired.el | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/all-the-icons-dired.el b/all-the-icons-dired.el index 2ed7dd7..fc4d05a 100644 --- a/all-the-icons-dired.el +++ b/all-the-icons-dired.el @@ -100,8 +100,8 @@ (when all-the-icons-dired-monochrome `(:face ,(face-at-point)))))))) (if (member file '("." "..")) - (all-the-icons-dired--add-overlay (point) " \t") - (all-the-icons-dired--add-overlay (point) (concat icon "\t")))))) + (all-the-icons-dired--add-overlay (dired-move-to-filename) " \t") + (all-the-icons-dired--add-overlay (dired-move-to-filename) (concat icon "\t")))))) (forward-line 1)))) (defun all-the-icons-dired--refresh-advice (fn &rest args) @@ -111,7 +111,8 @@ (all-the-icons-dired--refresh)))) (defvar all-the-icons-dired-advice-alist - '((dired-aux dired-create-directory all-the-icons-dired--refresh-advice) + '((dired dired-do-redisplay all-the-icons-dired--refresh-advice) + (dired-aux dired-create-directory all-the-icons-dired--refresh-advice) (dired-aux dired-do-create-files all-the-icons-dired--refresh-advice) (dired-aux dired-do-kill-lines all-the-icons-dired--refresh-advice) (dired-aux dired-do-rename all-the-icons-dired--refresh-advice) From 147ed0dfd1034a686795a08dc63e2c293128597e Mon Sep 17 00:00:00 2001 From: Jimmy Yuen Ho Wong Date: Fri, 4 Mar 2022 16:38:54 +0000 Subject: [PATCH 22/32] Fix #14 dired-do-redisplay is in dired-aux --- all-the-icons-dired.el | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/all-the-icons-dired.el b/all-the-icons-dired.el index fc4d05a..12ef9aa 100644 --- a/all-the-icons-dired.el +++ b/all-the-icons-dired.el @@ -111,7 +111,7 @@ (all-the-icons-dired--refresh)))) (defvar all-the-icons-dired-advice-alist - '((dired dired-do-redisplay all-the-icons-dired--refresh-advice) + '((dired-aux dired-do-redisplay all-the-icons-dired--refresh-advice) (dired-aux dired-create-directory all-the-icons-dired--refresh-advice) (dired-aux dired-do-create-files all-the-icons-dired--refresh-advice) (dired-aux dired-do-kill-lines all-the-icons-dired--refresh-advice) From ed9d34f34c5343f52e341f1cc0c80cdf194558ab Mon Sep 17 00:00:00 2001 From: Rahguzar Date: Thu, 2 Jun 2022 18:10:17 +0200 Subject: [PATCH 23/32] Use text properties instead of overlays --- all-the-icons-dired.el | 118 +++++++++++++---------------------------- 1 file changed, 37 insertions(+), 81 deletions(-) diff --git a/all-the-icons-dired.el b/all-the-icons-dired.el index 12ef9aa..2c11e01 100644 --- a/all-the-icons-dired.el +++ b/all-the-icons-dired.el @@ -34,7 +34,6 @@ ;;; Code: -(require 'cl-lib) (require 'dired) (require 'all-the-icons) (require 'subr-x) @@ -57,92 +56,49 @@ (defvar all-the-icons-dired-mode) -(defun all-the-icons-dired--add-overlay (pos string) - "Add overlay to display STRING at POS." - (let ((ov (make-overlay (1- pos) pos))) - (overlay-put ov 'all-the-icons-dired-overlay t) - (overlay-put ov 'after-string string))) - -(defun all-the-icons-dired--overlays-in (beg end) - "Get all all-the-icons-dired overlays between BEG to END." - (cl-remove-if-not - (lambda (ov) - (overlay-get ov 'all-the-icons-dired-overlay)) - (overlays-in beg end))) - -(defun all-the-icons-dired--overlays-at (pos) - "Get all-the-icons-dired overlays at POS." - (apply #'all-the-icons-dired--overlays-in `(,pos ,pos))) - -(defun all-the-icons-dired--remove-all-overlays () - "Remove all `all-the-icons-dired' overlays." - (save-restriction - (widen) - (mapc #'delete-overlay - (all-the-icons-dired--overlays-in (point-min) (point-max))))) - -(defun all-the-icons-dired--refresh () - "Display the icons of files in a dired buffer." - (all-the-icons-dired--remove-all-overlays) - (save-excursion - (goto-char (point-min)) - (while (not (eobp)) - (when (dired-move-to-filename nil) - (let ((case-fold-search t)) - (when-let* ((file (dired-get-filename 'relative 'noerror)) - (icon (if (file-directory-p file) - (all-the-icons-icon-for-dir file - :face 'all-the-icons-dired-dir-face - :v-adjust all-the-icons-dired-v-adjust) - (apply 'all-the-icons-icon-for-file file - (append - `(:v-adjust ,all-the-icons-dired-v-adjust) - (when all-the-icons-dired-monochrome - `(:face ,(face-at-point)))))))) - (if (member file '("." "..")) - (all-the-icons-dired--add-overlay (dired-move-to-filename) " \t") - (all-the-icons-dired--add-overlay (dired-move-to-filename) (concat icon "\t")))))) - (forward-line 1)))) - -(defun all-the-icons-dired--refresh-advice (fn &rest args) - "Advice function for FN with ARGS." - (prog1 (apply fn args) - (when all-the-icons-dired-mode - (all-the-icons-dired--refresh)))) - -(defvar all-the-icons-dired-advice-alist - '((dired-aux dired-do-redisplay all-the-icons-dired--refresh-advice) - (dired-aux dired-create-directory all-the-icons-dired--refresh-advice) - (dired-aux dired-do-create-files all-the-icons-dired--refresh-advice) - (dired-aux dired-do-kill-lines all-the-icons-dired--refresh-advice) - (dired-aux dired-do-rename all-the-icons-dired--refresh-advice) - (dired-aux dired-insert-subdir all-the-icons-dired--refresh-advice) - (dired-aux dired-kill-subdir all-the-icons-dired--refresh-advice) - (dired wdired-abort-changes all-the-icons-dired--refresh-advice) - (dired dired-internal-do-deletions all-the-icons-dired--refresh-advice) - (dired-narrow dired-narrow--internal all-the-icons-dired--refresh-advice) - (dired-subtree dired-subtree-insert all-the-icons-dired--refresh-advice) - (dired-subtree dired-subtree-remove all-the-icons-dired--refresh-advice) - (dired dired-readin all-the-icons-dired--refresh-advice) - (dired dired-revert all-the-icons-dired--refresh-advice) - (find-dired find-dired-sentinel all-the-icons-dired--refresh-advice)) - "A list of file, adviced function, and advice function.") +(defun all-the-icons-dired--icon (file) + "Return the icon for FILE." + (if (file-directory-p file) + (all-the-icons-icon-for-dir file + :face 'all-the-icons-dired-dir-face + :v-adjust all-the-icons-dired-v-adjust) + (apply 'all-the-icons-icon-for-file file + (append + `(:v-adjust ,all-the-icons-dired-v-adjust) + (when all-the-icons-dired-monochrome + `(:face ,(face-at-point))))))) + +(defun all-the-icons-dired--put-icon (pos) "Propertize POS with icon." + (let* ((file (dired-get-filename 'relative 'noerror)) + (icon (all-the-icons-dired--icon file))) + (put-text-property (1- pos) pos 'display + (if (member file '("." "..")) + " " + (concat " " icon " "))))) + +(defun all-the-icons-dired--propertize (&optional beg end &rest _) + "Add icons using text properties from BEG to END. +They defualt to `(point-min)' and `(point-max)'." + (let ((beg (or beg (point-min))) + (end (or end (point-max)))) + (with-silent-modifications + (ignore-errors + (save-excursion + (goto-char beg) + (while (< (point) end) + (when-let ((pos (dired-move-to-filename))) + (all-the-icons-dired--put-icon pos)) + (forward-line 1))))))) (defun all-the-icons-dired--setup () "Setup `all-the-icons-dired'." - (setq-local tab-width 1) - (pcase-dolist (`(,file ,sym ,fn) all-the-icons-dired-advice-alist) - (with-eval-after-load file - (advice-add sym :around fn))) - (all-the-icons-dired--refresh)) + (add-hook 'dired-after-readin-hook #'all-the-icons-dired--propertize) + (advice-add 'dired-insert-set-properties :before #'all-the-icons-dired--propertize)) (defun all-the-icons-dired--teardown () "Functions used as advice when redisplaying buffer." - (kill-local-variable 'tab-width) - (pcase-dolist (`(,file ,sym ,fn) all-the-icons-dired-advice-alist) - (with-eval-after-load file - (advice-remove sym fn))) - (all-the-icons-dired--remove-all-overlays)) + (remove-hook 'dired-after-readin-hook #'all-the-icons-dired--propertize) + (advice-remove 'dired-insert-set-properties #'all-the-icons-dired--propertize)) ;;;###autoload (define-minor-mode all-the-icons-dired-mode From 0dfb59f460a47be4f5a9fdaf459a9fdce46cd0ce Mon Sep 17 00:00:00 2001 From: Rahguzar Date: Mon, 20 Jun 2022 20:57:38 +0200 Subject: [PATCH 24/32] Only add icons after `dired-subdir-alist` is set --- all-the-icons-dired.el | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/all-the-icons-dired.el b/all-the-icons-dired.el index 2c11e01..bdc0006 100644 --- a/all-the-icons-dired.el +++ b/all-the-icons-dired.el @@ -81,8 +81,8 @@ They defualt to `(point-min)' and `(point-max)'." (let ((beg (or beg (point-min))) (end (or end (point-max)))) - (with-silent-modifications - (ignore-errors + (when dired-subdir-alist + (with-silent-modifications (save-excursion (goto-char beg) (while (< (point) end) From 37578ab288a6a79a45ed820530c1a7102cb79c51 Mon Sep 17 00:00:00 2001 From: Jimmy Yuen Ho Wong Date: Mon, 20 Jun 2022 20:38:36 +0100 Subject: [PATCH 25/32] Fix docstring --- all-the-icons-dired.el | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/all-the-icons-dired.el b/all-the-icons-dired.el index bdc0006..d904f70 100644 --- a/all-the-icons-dired.el +++ b/all-the-icons-dired.el @@ -68,7 +68,8 @@ (when all-the-icons-dired-monochrome `(:face ,(face-at-point))))))) -(defun all-the-icons-dired--put-icon (pos) "Propertize POS with icon." +(defun all-the-icons-dired--put-icon (pos) + "Propertize POS with icon." (let* ((file (dired-get-filename 'relative 'noerror)) (icon (all-the-icons-dired--icon file))) (put-text-property (1- pos) pos 'display From 385fcbce693a5250f5b7a320a0a0e5805998909e Mon Sep 17 00:00:00 2001 From: Jimmy Yuen Ho Wong Date: Sun, 4 Sep 2022 01:16:08 +0100 Subject: [PATCH 26/32] Experimental SVG icon support --- all-the-icons-dired.el | 16 ++++++++++------ 1 file changed, 10 insertions(+), 6 deletions(-) diff --git a/all-the-icons-dired.el b/all-the-icons-dired.el index d904f70..693873d 100644 --- a/all-the-icons-dired.el +++ b/all-the-icons-dired.el @@ -70,12 +70,16 @@ (defun all-the-icons-dired--put-icon (pos) "Propertize POS with icon." - (let* ((file (dired-get-filename 'relative 'noerror)) - (icon (all-the-icons-dired--icon file))) - (put-text-property (1- pos) pos 'display - (if (member file '("." "..")) - " " - (concat " " icon " "))))) + (let* ((file (dired-get-filename 'relative 'noerror)) + (icon (all-the-icons-dired--icon file)) + (image (get-text-property 0 'display icon))) + (if (or (not (eq (car image) 'image)) (member file '("." ".."))) + (put-text-property (1- pos) pos 'display + (if (member file '("." "..")) + " " + (concat " " icon " "))) + (setf (image-property image :margin) (cons (/ (window-text-width nil t) (window-text-width)) 0)) + (put-text-property (1- pos) pos 'display image)))) (defun all-the-icons-dired--propertize (&optional beg end &rest _) "Add icons using text properties from BEG to END. From 8adb5fa6bc1a9995bdf9dc9306276a2cf2468b71 Mon Sep 17 00:00:00 2001 From: Jimmy Yuen Ho Wong Date: Thu, 29 Sep 2022 09:08:50 +0100 Subject: [PATCH 27/32] use font lock to set icons --- all-the-icons-dired.el | 41 +++++++++++++++++++++++------------------ 1 file changed, 23 insertions(+), 18 deletions(-) diff --git a/all-the-icons-dired.el b/all-the-icons-dired.el index 693873d..d3e9c0f 100644 --- a/all-the-icons-dired.el +++ b/all-the-icons-dired.el @@ -81,29 +81,34 @@ (setf (image-property image :margin) (cons (/ (window-text-width nil t) (window-text-width)) 0)) (put-text-property (1- pos) pos 'display image)))) -(defun all-the-icons-dired--propertize (&optional beg end &rest _) +(defun all-the-icons-dired--fontify-region (start end &optional loudly) "Add icons using text properties from BEG to END. -They defualt to `(point-min)' and `(point-max)'." - (let ((beg (or beg (point-min))) - (end (or end (point-max)))) - (when dired-subdir-alist - (with-silent-modifications - (save-excursion - (goto-char beg) - (while (< (point) end) - (when-let ((pos (dired-move-to-filename))) - (all-the-icons-dired--put-icon pos)) - (forward-line 1))))))) + +BEG, END and the optional argument LOUDLY is passed to +`font-lock-default-fontify-region'." + (let ((extended-region (font-lock-default-fontify-region start end loudly))) + (when (and (consp extended-region) + (eq (car extended-region) 'jit-lock-bounds)) + (setq start (cadr extended-region)) + (setq end (cddr extended-region))) + (with-silent-modifications + (save-excursion + (goto-char start) + (while (< (point) end) + (when-let ((pos (dired-move-to-filename))) + (all-the-icons-dired--put-icon pos)) + (forward-line 1)))) + extended-region)) (defun all-the-icons-dired--setup () - "Setup `all-the-icons-dired'." - (add-hook 'dired-after-readin-hook #'all-the-icons-dired--propertize) - (advice-add 'dired-insert-set-properties :before #'all-the-icons-dired--propertize)) + "Set up `all-the-icons-dired'." + (add-function :override (local 'font-lock-fontify-region-function) #'all-the-icons-dired--fontify-region) + (setq-local font-lock-extra-managed-props (cons 'display font-lock-extra-managed-props))) (defun all-the-icons-dired--teardown () - "Functions used as advice when redisplaying buffer." - (remove-hook 'dired-after-readin-hook #'all-the-icons-dired--propertize) - (advice-remove 'dired-insert-set-properties #'all-the-icons-dired--propertize)) + "Tear down `all-the-icons-dired'." + (remove-function (local 'font-lock-fontify-region-function) #'all-the-icons-dired--fontify-region) + (setq-local font-lock-extra-managed-props (remove 'display font-lock-extra-managed-props))) ;;;###autoload (define-minor-mode all-the-icons-dired-mode From 78096c26f9c502ec045384c06778f73c4e870d61 Mon Sep 17 00:00:00 2001 From: Jimmy Yuen Ho Wong Date: Thu, 29 Sep 2022 11:18:06 +0100 Subject: [PATCH 28/32] Refontify after setup and teardown --- all-the-icons-dired.el | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) diff --git a/all-the-icons-dired.el b/all-the-icons-dired.el index d3e9c0f..527daae 100644 --- a/all-the-icons-dired.el +++ b/all-the-icons-dired.el @@ -103,12 +103,21 @@ BEG, END and the optional argument LOUDLY is passed to (defun all-the-icons-dired--setup () "Set up `all-the-icons-dired'." (add-function :override (local 'font-lock-fontify-region-function) #'all-the-icons-dired--fontify-region) - (setq-local font-lock-extra-managed-props (cons 'display font-lock-extra-managed-props))) + (setq-local font-lock-extra-managed-props (cons 'display font-lock-extra-managed-props)) + (cond (jit-lock-mode + (jit-lock-refontify)) + (font-lock-mode + (font-lock-fontify-region (point-min) (point-max))))) (defun all-the-icons-dired--teardown () "Tear down `all-the-icons-dired'." + (font-lock-unfontify-buffer) (remove-function (local 'font-lock-fontify-region-function) #'all-the-icons-dired--fontify-region) - (setq-local font-lock-extra-managed-props (remove 'display font-lock-extra-managed-props))) + (setq-local font-lock-extra-managed-props (remove 'display font-lock-extra-managed-props)) + (cond (jit-lock-mode + (jit-lock-refontify)) + (font-lock-mode + (font-lock-fontify-region (point-min) (point-max))))) ;;;###autoload (define-minor-mode all-the-icons-dired-mode From ef84300d976df897d9496c15348686f836b8711c Mon Sep 17 00:00:00 2001 From: Jimmy Yuen Ho Wong Date: Thu, 29 Sep 2022 12:29:04 +0100 Subject: [PATCH 29/32] fix docstrings --- all-the-icons-dired.el | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/all-the-icons-dired.el b/all-the-icons-dired.el index 527daae..3c4a101 100644 --- a/all-the-icons-dired.el +++ b/all-the-icons-dired.el @@ -41,11 +41,11 @@ (defface all-the-icons-dired-dir-face '((((background dark)) :foreground "white") (((background light)) :foreground "black")) - "Face for the directory icon" + "Face for the directory icon." :group 'all-the-icons-faces) (defcustom all-the-icons-dired-v-adjust 0.01 - "The default vertical adjustment of the icon in the dired buffer." + "The default vertical adjustment of the icon in the Dired buffer." :group 'all-the-icons :type 'number) @@ -82,9 +82,9 @@ (put-text-property (1- pos) pos 'display image)))) (defun all-the-icons-dired--fontify-region (start end &optional loudly) - "Add icons using text properties from BEG to END. + "Add icons using text properties from START to END. -BEG, END and the optional argument LOUDLY is passed to +START, END and the optional argument LOUDLY is passed to `font-lock-default-fontify-region'." (let ((extended-region (font-lock-default-fontify-region start end loudly))) (when (and (consp extended-region) @@ -121,7 +121,7 @@ BEG, END and the optional argument LOUDLY is passed to ;;;###autoload (define-minor-mode all-the-icons-dired-mode - "Display all-the-icons icon for each file in a dired buffer." + "Display all-the-icons icon for each file in a Dired buffer." :lighter " all-the-icons-dired-mode" (when (derived-mode-p 'dired-mode) (if all-the-icons-dired-mode From bcaed35bb3ad7fc46007f16e0d670beb82bb613e Mon Sep 17 00:00:00 2001 From: Jimmy Yuen Ho Wong Date: Thu, 29 Sep 2022 12:35:07 +0100 Subject: [PATCH 30/32] add requires --- all-the-icons-dired.el | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/all-the-icons-dired.el b/all-the-icons-dired.el index 3c4a101..d683d67 100644 --- a/all-the-icons-dired.el +++ b/all-the-icons-dired.el @@ -7,7 +7,7 @@ ;; Maintainer: Jimmy Yuen Ho Wong ;; Version: 2.0 ;; Keywords: files icons dired -;; Package-Requires: ((emacs "24.4") (all-the-icons "2.2.0")) +;; Package-Requires: ((emacs "26.1") (all-the-icons "2.2.0")) ;; URL: https://github.com/wyuenho/all-the-icons-dired ;; This program is free software; you can redistribute it and/or modify @@ -37,6 +37,10 @@ (require 'dired) (require 'all-the-icons) (require 'subr-x) +(require 'image) +(require 'jit-lock) +(require 'font-core) +(require 'font-lock) (defface all-the-icons-dired-dir-face '((((background dark)) :foreground "white") From 4564bec6bd3fd02dd870e6d2cfed37fe38bbc93a Mon Sep 17 00:00:00 2001 From: Jimmy Yuen Ho Wong Date: Thu, 29 Sep 2022 12:35:22 +0100 Subject: [PATCH 31/32] add cask file --- Cask | 4 ++++ 1 file changed, 4 insertions(+) create mode 100644 Cask diff --git a/Cask b/Cask new file mode 100644 index 0000000..8af4c76 --- /dev/null +++ b/Cask @@ -0,0 +1,4 @@ +(source gnu) +(source melpa) + +(package-file "all-the-icons-dired.el") From 4b8ed877de7e643c9cad5f1fa7653cd86a7247de Mon Sep 17 00:00:00 2001 From: Aurelien Rouene Date: Tue, 3 Jan 2023 11:48:00 +0100 Subject: [PATCH 32/32] Add a customize variable for lighter add the possiblity to customize or remove the lighter --- all-the-icons-dired.el | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/all-the-icons-dired.el b/all-the-icons-dired.el index 0eea72a..1cc7537 100644 --- a/all-the-icons-dired.el +++ b/all-the-icons-dired.el @@ -42,6 +42,11 @@ "Face for the directory icon" :group 'all-the-icons-faces) +(defcustom all-the-icons-dired-lighter " all-the-icons-dired-mode" + "Lighter of all-the-icons-dired-mode" + :group 'all-the-icons + :type 'string) + (defcustom all-the-icons-dired-v-adjust 0.01 "The default vertical adjustment of the icon in the dired buffer." :group 'all-the-icons @@ -124,7 +129,7 @@ ;;;###autoload (define-minor-mode all-the-icons-dired-mode "Display all-the-icons icon for each files in a dired buffer." - :lighter " all-the-icons-dired-mode" + :lighter all-the-icons-dired-lighter (when (and (derived-mode-p 'dired-mode) (display-graphic-p)) (if all-the-icons-dired-mode (all-the-icons-dired--setup)