Skip to content

Commit 0a46ce0

Browse files
author
Jason Duncan
committed
Working on satisfying package-lint.
1 parent 3af8491 commit 0a46ce0

File tree

2 files changed

+12
-14
lines changed

2 files changed

+12
-14
lines changed

README.org

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -6,25 +6,23 @@ If magit is installed, a link to the project in magit will be provided as well.
66
** Installation / Usage
77

88
*** use-package
9-
109
#+begin_src emacs-lisp
1110
(use-package dashboard
1211
:config
1312
(use-package dashboard-project-status
1413
:config
1514
(add-to-list 'dashboard-item-generators
16-
`(project-status . ,(dashboard-insert-project-status *your directory*)))
15+
`(project-status . ,(dashboard-project-status *your directory*)))
1716
(add-to-list 'dashboard-items '(project-status) t))
1817
(dashboard-setup-startup-hook))
1918
#+end_src
2019

2120
*** Without use-package
22-
2321
#+begin_src emacs-lisp
2422
;; some time before calling `dashboard-setup-startup-hook':
2523
(reqiure 'dashboard-project-status)
2624
(add-to-list 'dashboard-item-generators
27-
`(project-status . ,(dashboard-insert-project-status *your directory*)))
25+
`(project-status . ,(dashboard-project-status *your directory*)))
2826
(add-to-list 'dashboard-items '(project-status) t)
2927
#+end_src
3028

dashboard-project-status.el

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
;; Author: Jason Duncan <[email protected]>
66
;; Version: 0.0.1
77
;; URL: https://github.com/functionreturnfurnction/dashboard-project-status
8-
;; Package-Requires: ((git "0.1.1") (dashboard "1.2.5"))
8+
;; Package-Requires: ((emacs "24") (git "0.1.1") (dashboard "1.2.5"))
99

1010
;; This program is free software: you can redistribute it and/or modify
1111
;; it under the terms of the GNU General Public License as published by
@@ -31,19 +31,19 @@
3131
(require 'git)
3232
(require 'dashboard)
3333

34-
(defun git-local-is-behind? ()
34+
(defun dashboard-project-status-git-local-is-behind? ()
3535
"Return non-nil if current `git-repo' is behind its remote."
3636
(numberp
3737
(string-match-p
3838
(regexp-quote "Your branch is behind")
3939
(git-run "status" "-uno"))))
4040

41-
(defun git-unstaged-files ()
41+
(defun dashboard-project-status-git-unstaged-files ()
4242
"Return list of unstaged files."
4343
(git--lines
4444
(git-run "diff" "--name-only")))
4545

46-
(defun dashboard-insert-project-status-heading ()
46+
(defun dashboard-project-status-insert-heading ()
4747
"Insert a heading with project path and whether or not it is behind."
4848
(dashboard-insert-heading "Project ")
4949
(if (functionp 'magit-status)
@@ -58,15 +58,15 @@
5858
(dashboard-insert-heading git-repo))
5959
(dashboard-insert-heading
6060
(concat
61-
(if (git-local-is-behind?)
61+
(if (dashboard-project-status-git-local-is-behind?)
6262
" is behind the remote. (use \"git-pull\" to update)"
6363
" is up-to-date.")
6464
hard-newline)))
6565

66-
(defun dashboard-insert-project-status-body ()
66+
(defun dashboard-project-status-insert-body ()
6767
"Insert lists of untracked, unstaged, and staged files."
6868
(dolist (section `(("Untracked Files" . ,(git-untracked-files))
69-
("Unstaged Files" . ,(git-unstaged-files))
69+
("Unstaged Files" . ,(dashboard-project-status-git-unstaged-files))
7070
("Staged Files" . ,(git-staged-files))))
7171
(dashboard-insert-recentf-list
7272
(car section)
@@ -77,14 +77,14 @@
7777
(concat (file-name-as-directory git-repo) cur))
7878
ret))))))))
7979

80-
(defun dashboard-insert-project-status (project-dir &optional update)
80+
(defun dashboard-project-status (project-dir &optional update)
8181
"Return a function which will insert git status for PROJECT-DIR.
8282
If UPDATE is non-nil, update the remote first with 'git remote update'."
8383
`(lambda (list-size)
8484
(let ((git-repo ,project-dir))
8585
(when ,update (git-run "remote" "update"))
86-
(dashboard-insert-project-status-heading)
87-
(dashboard-insert-project-status-body))))
86+
(dashboard-project-status-insert-heading)
87+
(dashboard-project-status-insert-body))))
8888

8989
(provide 'dashboard-project-status)
9090
;;; dashboard-project-status.el ends here

0 commit comments

Comments
 (0)