Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Refactor: use all-the-icons-icon-for-dir #198

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 3 commits into from
Dec 10, 2019
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
18 changes: 2 additions & 16 deletions dashboard-widgets.el
Original file line number Diff line number Diff line change
Expand Up @@ -21,9 +21,8 @@
;;; Code:

;; Compiler pacifier
(declare-function all-the-icons-dir-is-submodule "ext:all-the-icons.el")
(declare-function all-the-icons-icon-for-dir "ext:all-the-icons.el")
(declare-function all-the-icons-icon-for-file "ext:all-the-icons.el")
(declare-function all-the-icons-match-to-alist "ext:all-the-icons.el")
(declare-function bookmark-get-filename "ext:bookmark.el")
(declare-function bookmark-all-names "ext:bookmark.el")
(declare-function calendar-date-compare "ext:calendar.el")
Expand Down Expand Up @@ -498,20 +497,7 @@ WIDGET-PARAMS are passed to the \"widget-create\" function."
(let* ((path (car (last (split-string ,@rest " - "))))
(icon (if (and (not (file-remote-p path))
(file-directory-p path))
(cond
((and (fboundp 'tramp-tramp-file-p)
(tramp-tramp-file-p default-directory))
(all-the-icons-octicon "file-directory" :height 1.0 :v-adjust 0.01))
((file-symlink-p path)
(all-the-icons-octicon "file-symlink-directory"
:height 1.0 :v-adjust 0.01))
((all-the-icons-dir-is-submodule path)
(all-the-icons-octicon "file-submodule" :height 1.0 :v-adjust 0.01))
((file-exists-p (format "%s/.git" path))
(all-the-icons-octicon "repo" :height 1.1 :v-adjust 0.01))
(t (let ((matcher (all-the-icons-match-to-alist
path all-the-icons-dir-icon-alist)))
(apply (car matcher) (list (cadr matcher) :v-adjust 0.01)))))
(all-the-icons-icon-for-dir path nil "")
(cond
((string-equal ,section-name "Agenda for today:")
(all-the-icons-octicon "primitive-dot" :height 1.0 :v-adjust 0.01))
Expand Down