Skip to content
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

Allow section headings to be customized #316

Merged
merged 4 commits into from
Jul 18, 2021
Merged
Changes from 2 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
14 changes: 14 additions & 0 deletions dashboard-widgets.el
Original file line number Diff line number Diff line change
Expand Up @@ -262,6 +262,18 @@ value is nil, that item's shortcut is disbaled. See
:type '(repeat (alist :key-type symbol :value-type string))
:group 'dashboard)

(defcustom dashboard-item-names nil
"Association list of item heading names.
When an item is nil or not present, the default name is used.
Will be of the form `(default-name . new-name)'.
Possible values for default-name are:
\"Recent Files:\" \"Bookmarks:\" \"Agenda for today:\",
\"Agenda for the coming week:\" \"Registers:\" \"Projects:\"."
:type '(alist :key-type string :value-type string)
:options '("Recent Files:" "Bookmarks:" "Agenda for today:"
"Agenda for the coming week:" "Registers:" "Projects:")
:group 'dashboard)

(defcustom dashboard-items-default-length 20
"Length used for startup lists with otherwise unspecified bounds.
Set to nil for unbounded."
Expand Down Expand Up @@ -438,6 +450,8 @@ If MESSAGEBUF is not nil then MSG is also written in message buffer."
(insert " "))

(insert (propertize heading 'face 'dashboard-heading))
(overlay-put (make-overlay (- (point) (length heading)) (point))
'display (or (cdr (assoc heading dashboard-item-names)) heading))
jcs090218 marked this conversation as resolved.
Show resolved Hide resolved
(when shortcut (insert (format " (%s)" shortcut))))

(defun dashboard-center-line (string)
Expand Down