From 958756996a75e993f9e0313945e62ed540772582 Mon Sep 17 00:00:00 2001 From: Vincent Zhang Date: Fri, 10 May 2019 14:06:37 +0800 Subject: [PATCH] Add an icon for helm buffers. --- README.md | 4 ++-- doom-modeline-core.el | 5 +++++ doom-modeline-segments.el | 5 +++-- 3 files changed, 10 insertions(+), 4 deletions(-) diff --git a/README.md b/README.md index 751af68..dc42501 100644 --- a/README.md +++ b/README.md @@ -96,10 +96,10 @@ The `doom-modeline` was designed for minimalism, and offers: ![package](https://user-images.githubusercontent.com/140797/57503916-e769d380-7324-11e9-906d-44c79f7408a3.png "Package") -![info](https://user-images.githubusercontent.com/140797/57504082-9d352200-7325-11e9-94e4-9f89e1f63190.png +![info](https://user-images.githubusercontent.com/140797/57506248-d96c8080-732d-11e9-8167-644c8fc4e0db.png "Info") -![helm](https://user-images.githubusercontent.com/140797/57504021-5515ff80-7325-11e9-92b4-5c0213fa1ba3.png +![helm](https://user-images.githubusercontent.com/140797/57506112-6531dd00-732d-11e9-8a5e-22166f42dd4c.png "Helm") ## Install diff --git a/doom-modeline-core.el b/doom-modeline-core.el index 9a3c9c3..cb27c2f 100644 --- a/doom-modeline-core.el +++ b/doom-modeline-core.el @@ -491,6 +491,11 @@ Given ~/Projects/FOSS/emacs/lisp/comint.el (when doom-modeline-icon (apply #'all-the-icons-alltheicon args))) +(defun doom-modeline-icon-fileicon (&rest args) + "Display fileicon via ARGS." + (when doom-modeline-icon + (apply #'all-the-icons-fileicon args))) + (defun doom-modeline-icon-for-mode (&rest args) "Display icon for major mode via ARGS." (when doom-modeline-icon diff --git a/doom-modeline-segments.el b/doom-modeline-segments.el index 8a3f420..6a3fe7f 100644 --- a/doom-modeline-segments.el +++ b/doom-modeline-segments.el @@ -201,7 +201,7 @@ buffer where knowing the current project directory is important." :face face :v-adjust -0.05 :height 1.25) - (if (display-graphic-p) " ") + (if doom-modeline-icon " ") (propertize (abbreviate-file-name default-directory) 'face face)))) ;; @@ -2136,6 +2136,8 @@ The cdr can also be a function that returns a name to use.") (when (bound-and-true-p helm-alive-p) (concat " " + (doom-modeline-icon-fileicon "elisp" :height 1.0 :v-adjust -0.1 :face 'all-the-icons-dpurple) + (if doom-modeline-icon " ") (propertize (let ((custom (cdr (assoc (buffer-name) doom-modeline--helm-buffer-ids))) (case-fold-search t) @@ -2187,7 +2189,6 @@ The cdr can also be a function that returns a name to use.") (eq 1 (cdr (assq 'follow doom-modeline--helm-current-source)))) "HF")) - (provide 'doom-modeline-segments) ;;; doom-modeline-segments.el ends here