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

Skip to content

Create a custom variable for dashboard-footer #186

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 2 commits into from
Feb 14, 2020
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
34 changes: 27 additions & 7 deletions dashboard-widgets.el
Original file line number Diff line number Diff line change
Expand Up @@ -91,6 +91,21 @@ to the specified width, with aspect ratio preserved."
:type 'boolean
:group 'dashboard)

(defcustom dashboard-footer-messages
'("The one true editor, Emacs!"
"Who the hell uses VIM anyway? Go Evil!"
"Free as free speech, free as free Beer"
"Richard Stallman is proud of you"
"Happy coding!"
"Vi Vi Vi, the editor of the beast"
"Welcome to the church of Emacs"
"While any text editor can save your files,\
only Emacs can save your soul"
"I showed you my source code,pls respond")
"A list of messages, one of which dashboard chooses to display."
:type 'list
:group 'dashboard)

(defcustom dashboard-show-shortcuts t
"Whether to show shortcut keys for each section."
:type 'boolean
Expand Down Expand Up @@ -547,15 +562,20 @@ WIDGET-PARAMS are passed to the \"widget-create\" function."
,list)))

;; Footer
(defun dashboard-random-footer ()
"Return a random footer from `dashboard-footer-messages'."
(nth (random (length dashboard-footer-messages)) dashboard-footer-messages))

(defun dashboard-insert-footer ()
"Insert footer of dashboard."
(when dashboard-set-footer
(insert "\n")
(dashboard-center-line dashboard-footer)
(insert dashboard-footer-icon)
(insert " ")
(insert (propertize dashboard-footer 'face 'dashboard-footer))
(insert "\n")))
(let ((footer (and dashboard-set-footer (dashboard-random-footer))))
(when footer
(insert "\n")
(dashboard-center-line footer)
(insert dashboard-footer-icon)
(insert " ")
(insert (propertize footer 'face 'dashboard-footer))
(insert "\n"))))

;;
;; Recentf
Expand Down