From 6480e0797b41c8ce1de4f37ba8016d177c22ab04 Mon Sep 17 00:00:00 2001 From: JenChieh Date: Wed, 26 Jul 2023 13:18:38 -0700 Subject: [PATCH 01/90] Bump for next snapshot --- dashboard-widgets.el | 2 +- dashboard.el | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/dashboard-widgets.el b/dashboard-widgets.el index 2e2f8bc..c54459f 100644 --- a/dashboard-widgets.el +++ b/dashboard-widgets.el @@ -12,7 +12,7 @@ ;;; License: GPLv3 ;; ;; Created: October 05, 2016 -;; Package-Version: 1.8.0 +;; Package-Version: 1.9.0-SNAPSHOT ;; Keywords: startup, screen, tools, dashboard ;; Package-Requires: ((emacs "26.1")) ;;; Commentary: diff --git a/dashboard.el b/dashboard.el index 5518a82..70096fe 100644 --- a/dashboard.el +++ b/dashboard.el @@ -12,7 +12,7 @@ ;;; License: GPLv3 ;; ;; Created: October 05, 2016 -;; Package-Version: 1.8.0 +;; Package-Version: 1.9.0-SNAPSHOT ;; Keywords: startup, screen, tools, dashboard ;; Package-Requires: ((emacs "26.1")) ;;; Commentary: From da8688d1317c8f6109d7de662b7dc901e3309477 Mon Sep 17 00:00:00 2001 From: JenChieh Date: Sun, 30 Jul 2023 19:42:15 -0700 Subject: [PATCH 02/90] test: Emacs 29.1 --- .github/workflows/activate.yml | 1 + .github/workflows/test.yml | 1 + 2 files changed, 2 insertions(+) diff --git a/.github/workflows/activate.yml b/.github/workflows/activate.yml index c8bfe28..c482d0c 100644 --- a/.github/workflows/activate.yml +++ b/.github/workflows/activate.yml @@ -23,6 +23,7 @@ jobs: - 26.3 - 27.2 - 28.2 + - 29.1 experimental: [false] include: - os: ubuntu-latest diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 81af0e6..eb31e46 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -23,6 +23,7 @@ jobs: - 26.3 - 27.2 - 28.2 + - 29.1 experimental: [false] include: - os: ubuntu-latest From 0cae7b872552c73da2ff61de6623b8c3196f1937 Mon Sep 17 00:00:00 2001 From: JenChieh Date: Thu, 10 Aug 2023 15:15:43 -0700 Subject: [PATCH 03/90] ci(dependabot): Maintain github-actions --- .github/dependabot.yml | 6 ++++++ 1 file changed, 6 insertions(+) create mode 100644 .github/dependabot.yml diff --git a/.github/dependabot.yml b/.github/dependabot.yml new file mode 100644 index 0000000..253bcb7 --- /dev/null +++ b/.github/dependabot.yml @@ -0,0 +1,6 @@ +version: 2 +updates: + - package-ecosystem: github-actions + directory: / + schedule: + interval: daily From ddc949ccb8aeee5b98f5c5e2b95b45bbbc36e4f2 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Wed, 6 Sep 2023 00:08:02 -0700 Subject: [PATCH 04/90] chore(deps): bump actions/checkout from 3 to 4 (#473) Bumps [actions/checkout](https://github.com/actions/checkout) from 3 to 4. - [Release notes](https://github.com/actions/checkout/releases) - [Changelog](https://github.com/actions/checkout/blob/main/CHANGELOG.md) - [Commits](https://github.com/actions/checkout/compare/v3...v4) --- updated-dependencies: - dependency-name: actions/checkout dependency-type: direct:production update-type: version-update:semver-major ... Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- .github/workflows/activate.yml | 2 +- .github/workflows/test.yml | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/activate.yml b/.github/workflows/activate.yml index c482d0c..ff86657 100644 --- a/.github/workflows/activate.yml +++ b/.github/workflows/activate.yml @@ -37,7 +37,7 @@ jobs: experimental: true steps: - - uses: actions/checkout@v3 + - uses: actions/checkout@v4 - uses: jcs090218/setup-emacs@master with: diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index eb31e46..e14fd79 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -37,7 +37,7 @@ jobs: experimental: true steps: - - uses: actions/checkout@v3 + - uses: actions/checkout@v4 - uses: jcs090218/setup-emacs@master with: From 87bb28397d7af6ed6601bdd26478a5fa4ee2b7db Mon Sep 17 00:00:00 2001 From: Nicholas Vollmer <44036031+progfolio@users.noreply.github.com> Date: Thu, 14 Sep 2023 05:41:00 -0400 Subject: [PATCH 05/90] dashboard-setup-startup-hook: add named functions to hooks (#475) dashboard-initialize: Replaces lambda added to emacs-startup-hook. See: #474 --- dashboard.el | 29 +++++++++++++---------------- 1 file changed, 13 insertions(+), 16 deletions(-) diff --git a/dashboard.el b/dashboard.el index 70096fe..6b33b03 100644 --- a/dashboard.el +++ b/dashboard.el @@ -462,24 +462,21 @@ Optional argument ARGS adviced function arguments." (with-selected-window space-win (dashboard-insert-startupify-lists))))) +(defun dashboard-initialize () + "Switch to dashboard and run `dashboard-after-initialize-hook'." + (switch-to-buffer dashboard-buffer-name) + (goto-char (point-min)) + (redisplay) + (run-hooks 'dashboard-after-initialize-hook)) + ;;;###autoload (defun dashboard-setup-startup-hook () - "Setup post initialization hooks. -If a command line argument is provided, assume a filename and skip displaying -Dashboard." - (when (< (length command-line-args) 2) - (add-hook 'window-setup-hook (lambda () - ;; 100 means `dashboard-resize-on-hook' will run last - (add-hook 'window-size-change-functions 'dashboard-resize-on-hook 100) - (dashboard-resize-on-hook))) - (add-hook 'after-init-hook (lambda () - ;; Display useful lists of items - (dashboard-insert-startupify-lists))) - (add-hook 'emacs-startup-hook (lambda () - (switch-to-buffer dashboard-buffer-name) - (goto-char (point-min)) - (redisplay) - (run-hooks 'dashboard-after-initialize-hook))))) + "Setup post initialization hooks unless a command line argument is provided." + (when (< (length command-line-args) 2) ;; Assume no file name passed + (add-hook 'window-size-change-functions #'dashboard-resize-on-hook 100) + (add-hook 'window-setup-hook #'dashboard-resize-on-hook) + (add-hook 'after-init-hook #'dashboard-insert-startupify-lists) + (add-hook 'emacs-startup-hook #'dashboard-initialize))) (provide 'dashboard) ;;; dashboard.el ends here From 346a7517c08e0657657917e6fff6cbf33cc531ae Mon Sep 17 00:00:00 2001 From: Nicholas Vollmer <44036031+progfolio@users.noreply.github.com> Date: Thu, 14 Sep 2023 06:43:04 -0400 Subject: [PATCH 06/90] docs: Add Elpaca configuration (#476) --- README.org | 18 ++++++++++++++++-- 1 file changed, 16 insertions(+), 2 deletions(-) diff --git a/README.org b/README.org index 1c179a6..0be95ae 100644 --- a/README.org +++ b/README.org @@ -42,12 +42,26 @@ You can set up the dashboard to open automatically at startup using =dashboard-s #+BEGIN_SRC elisp (require 'dashboard) (dashboard-setup-startup-hook) -;; Or if you use use-package +#+END_SRC + +Or with use-package: +#+BEGIN_SRC elisp +;; use-package with package.el: (use-package dashboard :ensure t :config (dashboard-setup-startup-hook)) - #+END_SRC +#+END_SRC + +#+BEGIN_SRC elisp +;; use-package with Elpaca: +(use-package dashboard + :elpaca t + :config + (add-hook 'elpaca-after-init-hook #'dashboard-insert-startupify-lists) + (add-hook 'elpaca-after-init-hook #'dashboard-initialize) + (dashboard-setup-startup-hook)) +#+END_SRC Alternatively, if you don't want the dashboard to open by default, you can use the interactive function =dashboard-open= to open it when you do want it. From 900375830951a6e492d2599d80e66075028e509b Mon Sep 17 00:00:00 2001 From: Jen-Chieh Shen Date: Tue, 10 Oct 2023 16:30:23 -0700 Subject: [PATCH 07/90] fix: Make remove entry optional (#480) * fix: Make remove entry optional * fix: package lint warnings * revert version string * changelog --- CHANGELOG.md | 2 +- Eask | 2 +- dashboard-widgets.el | 28 ++++++++++++++++++++-------- 3 files changed, 22 insertions(+), 10 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index dc00223..64bff60 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -8,7 +8,7 @@ Check [Keep a Changelog](http://keepachangelog.com/) for recommendations on how ## 1.9.0 (Unreleased) > Released N/A -- N/A +- fix: Make remove entry optional (#480) ## 1.8.0 > Released Jul 26, 2023 diff --git a/Eask b/Eask index ebac3d1..f75244d 100644 --- a/Eask +++ b/Eask @@ -1,5 +1,5 @@ (package "dashboard" - "1.8.0snapshot" + "1.9.0snapshot" "A startup screen extracted from Spacemacs") (website-url "https://github.com/emacs-dashboard/emacs-dashboard") diff --git a/dashboard-widgets.el b/dashboard-widgets.el index c54459f..f3b9ff6 100644 --- a/dashboard-widgets.el +++ b/dashboard-widgets.el @@ -42,7 +42,6 @@ (declare-function projectile-cleanup-known-projects "ext:projectile.el") (declare-function projectile-load-known-projects "ext:projectile.el") (declare-function projectile-mode "ext:projectile.el") -(declare-function projectile-relevant-known-projects "ext:projectile.el") ;;; project.el in Emacs 26 does not contain this function (declare-function project-known-project-roots "ext:project.el" nil t) (declare-function project-forget-zombie-projects "ext:project.el" nil t) @@ -269,9 +268,8 @@ Example: (defcustom dashboard-display-icons-p #'display-graphic-p "Predicate to determine whether dashboard should show icons. -Can be nil to not show icons and any truthy value to show them. When set -to a function the result of the function will be interpreted as the -predicate value." +Can be nil to not show icons and any truthy value to show them. When set to a +function the result of the function will be interpreted as the predicate value." :type '(choice (function :tag "Predicate function") (boolean :tag "Predicate value")) :group 'dashboard) @@ -316,7 +314,7 @@ ARGS should be a plist containing `:height', `:v-adjust', or `:face' properties. ('nerd-icons (apply #'nerd-icons-icon-for-file file args))))) (defun dashboard-octicon (name &rest args) - "Get the formatted octicon. + "Get the formatted octicon by NAME. ARGS should be a plist containing `:height', `:v-adjust', or `:face' properties." (dashboard-replace-displayable (pcase dashboard-icon-type @@ -385,6 +383,11 @@ installed." (const :tag "Use project.el" project-el)) :group 'dashboard) +(defcustom dashboard-remove-missing-entry nil + "If non-nil, try to remove missing entries." + :type 'boolean + :group 'dashboard) + (defcustom dashboard-items '((recents . 5) (bookmarks . 5) @@ -543,6 +546,9 @@ Set to nil for unbounded." search-label &optional no-next-line) "Insert a shortcut SHORTCUT-CHAR for a given SEARCH-LABEL. + +SHORTCUT-ID is the section identifier. + Optionally, provide NO-NEXT-LINE to move the cursor forward a line." (let* (;; Ensure punctuation and upper case in search string is not ;; used to construct the `defun' @@ -820,6 +826,7 @@ Argument IMAGE-PATH path to the image." (defmacro dashboard-insert-section (section-name list list-size shortcut-id shortcut-char action &rest widget-params) "Add a section with SECTION-NAME and LIST of LIST-SIZE items to the dashboard. +SHORTCUT-ID is the section identifier. SHORTCUT-CHAR is the keyboard shortcut used to access the section. ACTION is theaction taken when the user activates the widget button. WIDGET-PARAMS are passed to the \"widget-create\" function." @@ -1067,7 +1074,9 @@ to widget creation." (defun dashboard-insert-recents (list-size) "Add the list of LIST-SIZE items from recently edited files." (setq dashboard--recentf-cache-item-format nil) - (dashboard-mute-apply (recentf-mode 1) (recentf-cleanup)) + (dashboard-mute-apply + (recentf-mode 1) + (when dashboard-remove-missing-entry (recentf-cleanup))) (dashboard-insert-section "Recent Files:" (dashboard-shorten-paths recentf-list 'dashboard-recentf-alist 'recents) @@ -1198,11 +1207,14 @@ Return function that returns a list of projects." (cl-case dashboard-projects-backend (`projectile (require 'projectile) - (dashboard-mute-apply (projectile-cleanup-known-projects)) + (when dashboard-remove-missing-entry + (dashboard-mute-apply (projectile-cleanup-known-projects))) (projectile-load-known-projects)) (`project-el (require 'project) - (dashboard-mute-apply (dashboard-funcall-fboundp #'project-forget-zombie-projects)) + (when dashboard-remove-missing-entry + (dashboard-mute-apply + (dashboard-funcall-fboundp #'project-forget-zombie-projects))) (project-known-project-roots)) (t (display-warning '(dashboard) From f034bd5eb9a4c1d9eccd5e8c0fa17541793b9a16 Mon Sep 17 00:00:00 2001 From: Jen-Chieh Date: Wed, 11 Oct 2023 14:55:10 -0700 Subject: [PATCH 08/90] fix: Ignore errors when trying to remove missing entires --- dashboard-widgets.el | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/dashboard-widgets.el b/dashboard-widgets.el index f3b9ff6..f36905d 100644 --- a/dashboard-widgets.el +++ b/dashboard-widgets.el @@ -1076,7 +1076,8 @@ to widget creation." (setq dashboard--recentf-cache-item-format nil) (dashboard-mute-apply (recentf-mode 1) - (when dashboard-remove-missing-entry (recentf-cleanup))) + (when dashboard-remove-missing-entry + (ignore-errors (recentf-cleanup)))) (dashboard-insert-section "Recent Files:" (dashboard-shorten-paths recentf-list 'dashboard-recentf-alist 'recents) @@ -1208,13 +1209,15 @@ Return function that returns a list of projects." (`projectile (require 'projectile) (when dashboard-remove-missing-entry - (dashboard-mute-apply (projectile-cleanup-known-projects))) + (dashboard-mute-apply + (ignore-errors (projectile-cleanup-known-projects)))) (projectile-load-known-projects)) (`project-el (require 'project) (when dashboard-remove-missing-entry (dashboard-mute-apply - (dashboard-funcall-fboundp #'project-forget-zombie-projects))) + (ignore-errors + (dashboard-funcall-fboundp #'project-forget-zombie-projects)))) (project-known-project-roots)) (t (display-warning '(dashboard) From 427cd8e161232904745dc7870a36ad55ebf65753 Mon Sep 17 00:00:00 2001 From: JenChieh Date: Thu, 12 Oct 2023 12:43:58 -0700 Subject: [PATCH 09/90] fix: Remove external newline in terminal mode --- dashboard-widgets.el | 13 ++----------- 1 file changed, 2 insertions(+), 11 deletions(-) diff --git a/dashboard-widgets.el b/dashboard-widgets.el index f36905d..3a8058b 100644 --- a/dashboard-widgets.el +++ b/dashboard-widgets.el @@ -1,20 +1,11 @@ ;;; dashboard-widgets.el --- A startup screen extracted from Spacemacs -*- lexical-binding: t -*- ;; Copyright (c) 2016-2023 emacs-dashboard maintainers -;; -;; Author : Rakan Al-Hneiti -;; Maintainer : Jesús Martínez -;; Shen, Jen-Chieh -;; URL : https://github.com/emacs-dashboard/emacs-dashboard -;; + ;; This file is not part of GNU Emacs. ;; ;;; License: GPLv3 ;; -;; Created: October 05, 2016 -;; Package-Version: 1.9.0-SNAPSHOT -;; Keywords: startup, screen, tools, dashboard -;; Package-Requires: ((emacs "26.1")) ;;; Commentary: ;; An extensible Emacs dashboard, with sections for @@ -716,7 +707,7 @@ Argument IMAGE-PATH path to the image." buffer-read-only text-width image-spec) - (insert "\n") + (when (display-graphic-p) (insert "\n")) ;; If specified, insert a text banner. (when-let (txt (plist-get banner :text)) (if (eq dashboard-startup-banner 'ascii) From cf7fa279851386abc0ad8992fd1a82a371ca7c3e Mon Sep 17 00:00:00 2001 From: Ricardo Arredondo <839303+ricardoricho@users.noreply.github.com> Date: Mon, 30 Oct 2023 21:35:53 -0600 Subject: [PATCH 10/90] Add dashboard icon face. (#483) --- dashboard-widgets.el | 33 +++++++++++++++------------------ 1 file changed, 15 insertions(+), 18 deletions(-) diff --git a/dashboard-widgets.el b/dashboard-widgets.el index 3a8058b..5ca5a83 100644 --- a/dashboard-widgets.el +++ b/dashboard-widgets.el @@ -251,12 +251,6 @@ Example: :type '(function string) :group 'dashboard) -(defcustom dashboard-footer - (nth (random (1- (1+ (length dashboard-footer-messages)))) dashboard-footer-messages) - "A footer with some short message." - :type 'string - :group 'dashboard) - (defcustom dashboard-display-icons-p #'display-graphic-p "Predicate to determine whether dashboard should show icons. Can be nil to not show icons and any truthy value to show them. When set to a @@ -319,13 +313,13 @@ ARGS should be a plist containing `:height', `:v-adjust', or `:face' properties. (all-the-icons-fileicon "emacs" :height 1.1 :v-adjust -0.05 - :face 'font-lock-keyword-face)) + :face 'dashboard-footer-icon-face)) ('nerd-icons (nerd-icons-sucicon "nf-custom-emacs" :height 1.1 :v-adjust -0.05 - :face 'font-lock-keyword-face))) - (propertize ">" 'face 'dashboard-footer)) + :face 'dashboard-footer-icon-face))) + (propertize ">" 'face 'dashboard-footer-icon-face)) "Footer's icon." :type 'string :group 'dashboard) @@ -474,9 +468,14 @@ Set to nil for unbounded." "Face used for no items." :group 'dashboard) -(defface dashboard-footer +(defface dashboard-footer-face '((t (:inherit font-lock-doc-face))) - "Face used for widget headings." + "Face used for footer text." + :group 'dashboard) + +(defface dashboard-footer-icon-face + '((t (:inherit dashboard-footer-face))) + "Face used for icon in footer." :group 'dashboard) (define-obsolete-face-alias @@ -879,15 +878,13 @@ to widget creation." (defun dashboard-insert-footer () "Insert footer of dashboard." - (when-let ((footer (and dashboard-set-footer (dashboard-random-footer)))) + (when-let ((footer (and dashboard-set-footer (dashboard-random-footer))) + (footer-icon (dashboard-replace-displayable dashboard-footer-icon))) (insert "\n") (dashboard-insert-center - (dashboard-replace-displayable dashboard-footer-icon) - (if (and (stringp dashboard-footer-icon) - (not (string-empty-p dashboard-footer-icon))) - " " - "") - (propertize footer 'face 'dashboard-footer) + (if (string-empty-p footer-icon) footer-icon + (concat (propertize footer-icon 'face 'dashboard-footer-icon-face) " ")) + (propertize footer 'face 'dashboard-footer-face) "\n"))) ;; From 22786237e16cfeae33f07ae9c5eeaf061408579a Mon Sep 17 00:00:00 2001 From: JenChieh Date: Mon, 30 Oct 2023 20:59:12 -0700 Subject: [PATCH 11/90] fix(widget): Don't propertize footer-icon --- dashboard-widgets.el | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/dashboard-widgets.el b/dashboard-widgets.el index 5ca5a83..d83d790 100644 --- a/dashboard-widgets.el +++ b/dashboard-widgets.el @@ -883,7 +883,7 @@ to widget creation." (insert "\n") (dashboard-insert-center (if (string-empty-p footer-icon) footer-icon - (concat (propertize footer-icon 'face 'dashboard-footer-icon-face) " ")) + (concat footer-icon " ")) (propertize footer 'face 'dashboard-footer-face) "\n"))) From 9c8b0cce865e34340c6d435253f6a3aed3b3ace5 Mon Sep 17 00:00:00 2001 From: Jen-Chieh Shen Date: Mon, 30 Oct 2023 21:00:59 -0700 Subject: [PATCH 12/90] docs: changelog (#484) --- CHANGELOG.md | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 64bff60..5ea77b9 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -8,7 +8,8 @@ Check [Keep a Changelog](http://keepachangelog.com/) for recommendations on how ## 1.9.0 (Unreleased) > Released N/A -- fix: Make remove entry optional (#480) +* fix: Make remove entry optional (#480) +* Add dashboard icon face (#483) ## 1.8.0 > Released Jul 26, 2023 From 54b7767b79fb7b9966c48a31a9d32f372ef9ec3d Mon Sep 17 00:00:00 2001 From: meritamen Date: Fri, 1 Dec 2023 17:22:05 +0800 Subject: [PATCH 13/90] feat: added support for xbms (#486) --- README.org | 2 +- dashboard-widgets.el | 8 ++++++++ 2 files changed, 9 insertions(+), 1 deletion(-) diff --git a/README.org b/README.org index 0be95ae..397a8dd 100644 --- a/README.org +++ b/README.org @@ -99,7 +99,7 @@ To update the banner or banner title ;; - 'official which displays the official emacs logo ;; - 'logo which displays an alternative emacs logo ;; - 1, 2 or 3 which displays one of the text banners -;; - "path/to/your/image.gif", "path/to/your/image.png" or "path/to/your/text.txt" which displays whatever gif/image/text you would prefer +;; - "path/to/your/image.gif", "path/to/your/image.png", "path/to/your/text.txt" or "path/to/your/image.xbm" which displays whatever gif/image/text/xbm you would prefer ;; - a cons of '("path/to/your/image.png" . "path/to/your/text.txt") ;; Content is not centered by default. To center, set diff --git a/dashboard-widgets.el b/dashboard-widgets.el index d83d790..b4cdb90 100644 --- a/dashboard-widgets.el +++ b/dashboard-widgets.el @@ -697,6 +697,12 @@ String -> bool. Argument IMAGE-PATH path to the image." (eq 'gif (image-type image-path))) +(defun dashboard--type-is-xbm-p (image-path) + "Return if image is a xbm. +String -> bool. +Argument IMAGE-PATH path to the image." + (eq 'xbm (image-type image-path))) + (defun dashboard-insert-banner () "Insert the banner at the top of the dashboard." (goto-char (point-max)) @@ -730,6 +736,8 @@ Argument IMAGE-PATH path to the image." (setq image-spec (cond ((dashboard--type-is-gif-p img) (create-image img)) + ((dashboard--type-is-xbm-p img) + (create-image img)) ((image-type-available-p 'imagemagick) (apply 'create-image img 'imagemagick nil size-props)) (t From e9867036ebc100768023eabc21dd5bf4619029c2 Mon Sep 17 00:00:00 2001 From: JenChieh Date: Mon, 1 Jan 2024 00:41:33 -0800 Subject: [PATCH 14/90] chore: Update copyright year --- dashboard-widgets.el | 2 +- dashboard.el | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/dashboard-widgets.el b/dashboard-widgets.el index b4cdb90..ef9b0c9 100644 --- a/dashboard-widgets.el +++ b/dashboard-widgets.el @@ -1,6 +1,6 @@ ;;; dashboard-widgets.el --- A startup screen extracted from Spacemacs -*- lexical-binding: t -*- -;; Copyright (c) 2016-2023 emacs-dashboard maintainers +;; Copyright (c) 2016-2024 emacs-dashboard maintainers ;; This file is not part of GNU Emacs. ;; diff --git a/dashboard.el b/dashboard.el index 6b33b03..df7c736 100644 --- a/dashboard.el +++ b/dashboard.el @@ -1,6 +1,6 @@ ;;; dashboard.el --- A startup screen extracted from Spacemacs -*- lexical-binding: t -*- -;; Copyright (c) 2016-2023 emacs-dashboard maintainers +;; Copyright (c) 2016-2024 emacs-dashboard maintainers ;; ;; Author : Rakan Al-Hneiti ;; Maintainer : Jesús Martínez From c894da620bc19d35c8cb67d3fd5b39e9af34de9d Mon Sep 17 00:00:00 2001 From: JenChieh Date: Fri, 19 Jan 2024 17:57:14 -0800 Subject: [PATCH 15/90] chore: Test 29.2 --- .github/workflows/activate.yml | 2 +- .github/workflows/test.yml | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/activate.yml b/.github/workflows/activate.yml index ff86657..193c632 100644 --- a/.github/workflows/activate.yml +++ b/.github/workflows/activate.yml @@ -23,7 +23,7 @@ jobs: - 26.3 - 27.2 - 28.2 - - 29.1 + - 29.2 experimental: [false] include: - os: ubuntu-latest diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index e14fd79..a8dd866 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -23,7 +23,7 @@ jobs: - 26.3 - 27.2 - 28.2 - - 29.1 + - 29.2 experimental: [false] include: - os: ubuntu-latest From c1cd43661ff24c6aea018ce77fc8ccf11e2a561a Mon Sep 17 00:00:00 2001 From: Christian Vanderwall <51159750+cvdub@users.noreply.github.com> Date: Mon, 29 Jan 2024 19:41:27 -0800 Subject: [PATCH 16/90] Add customization option to hide the cursor on the dashboard (#492) * Add customization option to hide the cursor on the dashboard * Fix warning: reference to free variable for dashboard-hide-cursor --- dashboard.el | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/dashboard.el b/dashboard.el index df7c736..5aa4fcc 100644 --- a/dashboard.el +++ b/dashboard.el @@ -80,6 +80,11 @@ :group 'dashboard :type 'hook) +(defcustom dashboard-hide-cursor nil + "Whether to hide the cursor in the dashboard." + :type 'boolean + :group 'dashboard) + (define-derived-mode dashboard-mode special-mode "Dashboard" "Dashboard major mode for startup screen." :group 'dashboard @@ -91,6 +96,8 @@ (when (featurep 'display-line-numbers) (display-line-numbers-mode -1)) (when (featurep 'page-break-lines) (page-break-lines-mode 1)) (setq-local revert-buffer-function #'dashboard-refresh-buffer) + (when dashboard-hide-cursor + (setq-local cursor-type nil)) (setq inhibit-startup-screen t buffer-read-only t truncate-lines t)) From a004e0f5859caef0874cc1b02eb8c19b434fedc1 Mon Sep 17 00:00:00 2001 From: Christian Vanderwall <51159750+cvdub@users.noreply.github.com> Date: Thu, 1 Feb 2024 15:34:56 -0800 Subject: [PATCH 17/90] Add option to vertically center dashboard (#493) * Add option to vertically center dashboard * Calculate padding for vertical centering in pixels instead of lines Thank you JenChieh (@jcs090218) for this snippet. --- dashboard.el | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/dashboard.el b/dashboard.el index 5aa4fcc..701d8d7 100644 --- a/dashboard.el +++ b/dashboard.el @@ -107,6 +107,11 @@ :type 'boolean :group 'dashboard) +(defcustom dashboard-vertically-center-content nil + "Whether to vertically center content within the window." + :type 'boolean + :group 'dashboard) + (defconst dashboard-buffer-name "*dashboard*" "Dashboard's buffer name.") @@ -445,6 +450,14 @@ Optional argument ARGS adviced function arguments." (delete-char -1) (insert dashboard-page-separator)) (dashboard-insert-footer) + (when dashboard-vertically-center-content + (goto-char (point-min)) + (when-let* ((content-height (cdr (window-absolute-pixel-position (point-max)))) + (vertical-padding (floor (/ (- (window-pixel-height) content-height) 2))) + ((> vertical-padding 0)) + (vertical-lines (/ vertical-padding + (line-pixel-height)))) + (insert (make-string vertical-lines ?\n)))) (goto-char (point-min)) (dashboard-mode))) (when recentf-is-on From 72440d0b56a1715772d9b78b09b8f7e823fdadc5 Mon Sep 17 00:00:00 2001 From: JenChieh Date: Thu, 1 Feb 2024 15:40:44 -0800 Subject: [PATCH 18/90] fix: Ensure it's integer when vertical centering --- dashboard.el | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/dashboard.el b/dashboard.el index 701d8d7..991f1cb 100644 --- a/dashboard.el +++ b/dashboard.el @@ -455,15 +455,13 @@ Optional argument ARGS adviced function arguments." (when-let* ((content-height (cdr (window-absolute-pixel-position (point-max)))) (vertical-padding (floor (/ (- (window-pixel-height) content-height) 2))) ((> vertical-padding 0)) - (vertical-lines (/ vertical-padding - (line-pixel-height)))) + (vertical-lines (floor (/ vertical-padding (line-pixel-height))))) (insert (make-string vertical-lines ?\n)))) (goto-char (point-min)) (dashboard-mode))) (when recentf-is-on (setq recentf-list origial-recentf-list)))) - ;;;###autoload (defun dashboard-open (&rest _) "Open (or refresh) the *dashboard* buffer." From e1c2897937c90e1126b58b8ae196cc5d937b74f3 Mon Sep 17 00:00:00 2001 From: JenChieh Date: Thu, 1 Feb 2024 15:42:55 -0800 Subject: [PATCH 19/90] chore: changelog --- CHANGELOG.md | 2 ++ 1 file changed, 2 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 5ea77b9..1bcb350 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -10,6 +10,8 @@ Check [Keep a Changelog](http://keepachangelog.com/) for recommendations on how * fix: Make remove entry optional (#480) * Add dashboard icon face (#483) +* Add customization option to hide the cursor on the dashboard (#492) +* Add option to vertically center dashboard (#318 and #493) ## 1.8.0 > Released Jul 26, 2023 From 00f9344e0d31b805b47c6319a37f42b485b16bf0 Mon Sep 17 00:00:00 2001 From: Jen-Chieh Date: Fri, 2 Feb 2024 15:50:58 -0800 Subject: [PATCH 20/90] fix: vertical centering shouldn't include first line --- dashboard.el | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/dashboard.el b/dashboard.el index 991f1cb..2cb392a 100644 --- a/dashboard.el +++ b/dashboard.el @@ -455,7 +455,8 @@ Optional argument ARGS adviced function arguments." (when-let* ((content-height (cdr (window-absolute-pixel-position (point-max)))) (vertical-padding (floor (/ (- (window-pixel-height) content-height) 2))) ((> vertical-padding 0)) - (vertical-lines (floor (/ vertical-padding (line-pixel-height))))) + (vertical-lines (1- (floor (/ vertical-padding (line-pixel-height))))) + ((> vertical-lines 0))) (insert (make-string vertical-lines ?\n)))) (goto-char (point-min)) (dashboard-mode))) From f51bdc9e88c473e4eff40bb923c52b4f2256311e Mon Sep 17 00:00:00 2001 From: dwuggh Date: Tue, 13 Feb 2024 16:54:56 +0800 Subject: [PATCH 21/90] add `dashboard-image-extra-props' option. (#495) --- dashboard-widgets.el | 17 +++++++++++++---- 1 file changed, 13 insertions(+), 4 deletions(-) diff --git a/dashboard-widgets.el b/dashboard-widgets.el index ef9b0c9..0a12c5b 100644 --- a/dashboard-widgets.el +++ b/dashboard-widgets.el @@ -93,6 +93,14 @@ preserved." :type 'integer :group 'dashboard) +(defcustom dashboard-image-extra-props nil + "Additional image attributes to assign to the image. +This could be useful for displaying images with transparency, +for example, by setting the `:mask' property to `heuristic'. +See `create-image' and Info node `(elisp)Image Descriptors'." + :type 'plist + :group 'dashboard) + (defcustom dashboard-set-heading-icons nil "When non nil, heading sections will have icons." :type 'boolean @@ -728,23 +736,24 @@ Argument IMAGE-PATH path to the image." ;; If specified, insert an image banner. When displayed in a graphical frame, this will ;; replace the text banner. (when-let (img (plist-get banner :image)) - (let ((size-props + (let ((img-props (append (when (> dashboard-image-banner-max-width 0) (list :max-width dashboard-image-banner-max-width)) (when (> dashboard-image-banner-max-height 0) - (list :max-height dashboard-image-banner-max-height))))) + (list :max-height dashboard-image-banner-max-height)) + dashboard-image-extra-props))) (setq image-spec (cond ((dashboard--type-is-gif-p img) (create-image img)) ((dashboard--type-is-xbm-p img) (create-image img)) ((image-type-available-p 'imagemagick) - (apply 'create-image img 'imagemagick nil size-props)) + (apply 'create-image img 'imagemagick nil img-props)) (t (apply 'create-image img nil nil (when (and (fboundp 'image-transforms-p) (memq 'scale (funcall 'image-transforms-p))) - size-props)))))) + img-props)))))) (add-text-properties start (point) `(display ,image-spec)) (when (dashboard--type-is-gif-p img) (image-animate image-spec 0 t))) ;; Finally, center the banner (if any). From 428b25474d2c6e2243f6758200976167f0654c3c Mon Sep 17 00:00:00 2001 From: JenChieh Date: Wed, 21 Feb 2024 16:27:50 -0800 Subject: [PATCH 22/90] docs(README.md): Minor improvements --- README.org | 26 +++++++++++++------------- 1 file changed, 13 insertions(+), 13 deletions(-) diff --git a/README.org b/README.org index 397a8dd..12d0a9d 100644 --- a/README.org +++ b/README.org @@ -24,12 +24,12 @@ An extensible emacs startup screen showing you what's most important. [[./etc/screenshot.png]] * Dependencies -You will need the following packages which are all available on Melpa: +You will need the following packages which are all available on MELPA: -1. (optional) page-break-lines - [[https://github.com/purcell/page-break-lines]] -2. (optional) projectile - [[https://github.com/bbatsov/projectile]] -3. (optional) all-the-icons - [[https://github.com/domtronn/all-the-icons.el]] -4. (optional) nerd-icons - [[https://github.com/rainstormstudio/nerd-icons.el]] +1. [[https://github.com/purcell/page-break-lines][page-break-lines]] (optional) +2. [[https://github.com/bbatsov/projectile][projectile]] (optional) +3. [[https://github.com/domtronn/all-the-icons.el][all-the-icons]] (optional) +4. [[https://github.com/rainstormstudio/nerd-icons.el][nerd-icons]] (optional) * Usage @@ -111,10 +111,10 @@ To update the banner or banner title To customize which widgets are displayed, you can use the following snippet #+BEGIN_SRC elisp -(setq dashboard-items '((recents . 5) +(setq dashboard-items '((recents . 5) (bookmarks . 5) - (projects . 5) - (agenda . 5) + (projects . 5) + (agenda . 5) (registers . 5))) #+END_SRC This will add the recent files, bookmarks, projects, org-agenda and registers widgets to your dashboard each displaying 5 items. @@ -149,13 +149,13 @@ To modify the widget heading name: To use ~all-the-icons~ package: #+BEGIN_SRC emacs-lisp - (setq dashboard-icon-type 'all-the-icons) ;; use `all-the-icons' package + (setq dashboard-icon-type 'all-the-icons) ; use `all-the-icons' package #+END_SRC To use ~nerd-icons~ package: #+BEGIN_SRC emacs-lisp - (setq dashboard-display-icons-p t) ;; display icons on both GUI and terminal - (setq dashboard-icon-type 'nerd-icons) ;; use `nerd-icons' package + (setq dashboard-display-icons-p t) ; display icons on both GUI and terminal + (setq dashboard-icon-type 'nerd-icons) ; use `nerd-icons' package #+END_SRC To add icons to the widget headings and their items: @@ -166,13 +166,13 @@ To add icons to the widget headings and their items: To modify heading icons with another icon from all-the-icons octicons: #+BEGIN_SRC elisp - (dashboard-modify-heading-icons '((recents . "file-text") + (dashboard-modify-heading-icons '((recents . "file-text") (bookmarks . "book"))) #+END_SRC To modify heading icons with another icon from nerd-icons octicons: #+BEGIN_SRC emacs-lisp - (dashboard-modify-heading-icons '((recents . "nf-oct-file_text") + (dashboard-modify-heading-icons '((recents . "nf-oct-file_text") (bookmarks . "nf-oct-book"))) #+END_SRC From 68012dbade12a92b678abe6abbe2a306d9cda829 Mon Sep 17 00:00:00 2001 From: JenChieh Date: Wed, 21 Feb 2024 16:58:41 -0800 Subject: [PATCH 23/90] docs: Add missing custom variables --- README.org | 66 +++++++++++++++++++++++++++++++++--------------------- 1 file changed, 41 insertions(+), 25 deletions(-) diff --git a/README.org b/README.org index 12d0a9d..4d87215 100644 --- a/README.org +++ b/README.org @@ -90,23 +90,25 @@ Dashboard in frames created with =emacsclient -c= as follows: To update the banner or banner title #+BEGIN_SRC elisp -;; Set the title -(setq dashboard-banner-logo-title "Welcome to Emacs Dashboard") -;; Set the banner -(setq dashboard-startup-banner [VALUE]) -;; Value can be -;; - nil to display no banner -;; - 'official which displays the official emacs logo -;; - 'logo which displays an alternative emacs logo -;; - 1, 2 or 3 which displays one of the text banners -;; - "path/to/your/image.gif", "path/to/your/image.png", "path/to/your/text.txt" or "path/to/your/image.xbm" which displays whatever gif/image/text/xbm you would prefer -;; - a cons of '("path/to/your/image.png" . "path/to/your/text.txt") - -;; Content is not centered by default. To center, set -(setq dashboard-center-content t) - -;; To disable shortcut "jump" indicators for each section, set -(setq dashboard-show-shortcuts nil) + ;; Set the title + (setq dashboard-banner-logo-title "Welcome to Emacs Dashboard") + ;; Set the banner + (setq dashboard-startup-banner [VALUE]) + ;; Value can be + ;; - nil to display no banner + ;; - 'official which displays the official emacs logo + ;; - 'logo which displays an alternative emacs logo + ;; - 1, 2 or 3 which displays one of the text banners + ;; - "path/to/your/image.gif", "path/to/your/image.png", "path/to/your/text.txt" or "path/to/your/image.xbm" which displays whatever gif/image/text/xbm you would prefer + ;; - a cons of '("path/to/your/image.png" . "path/to/your/text.txt") + + ;; Content is not centered by default. To center, set + (setq dashboard-center-content t) + ;; vertically center content + (setq dashboard-vertically-center-content t) + + ;; To disable shortcut "jump" indicators for each section, set + (setq dashboard-show-shortcuts nil) #+END_SRC To customize which widgets are displayed, you can use the following snippet @@ -119,6 +121,27 @@ To customize which widgets are displayed, you can use the following snippet #+END_SRC This will add the recent files, bookmarks, projects, org-agenda and registers widgets to your dashboard each displaying 5 items. +To customize item shortcuts: +#+BEGIN_SRC elisp +(setq dashboard-item-shortcuts '((recents . "r") + (bookmarks . "m") + (projects . "p") + (agenda . "a") + (registers . "e"))) +#+END_SRC + +To modify the widget heading name: +#+BEGIN_SRC elisp + (setq dashboard-item-names '(("Recent Files:" . "Recently opened files:") + ("Agenda for today:" . "Today's agenda:") + ("Agenda for the coming week:" . "Agenda:")) +#+END_SRC + +The default length for each item. +#+BEGIN_SRC elisp +(setq dashboard-items-default-length 20) +#+END_SRC + To add your own custom widget is pretty easy, define your widget's callback function and add it to `dashboard-items` as such: #+BEGIN_SRC elisp (defun dashboard-insert-custom (list-size) @@ -140,13 +163,6 @@ To add an icon to a custom widget, insert it with `dashboard-insert-heading` in (insert " Custom text")) #+END_SRC -To modify the widget heading name: -#+BEGIN_SRC elisp - (setq dashboard-item-names '(("Recent Files:" . "Recently opened files:") - ("Agenda for today:" . "Today's agenda:") - ("Agenda for the coming week:" . "Agenda:")) -#+END_SRC - To use ~all-the-icons~ package: #+BEGIN_SRC emacs-lisp (setq dashboard-icon-type 'all-the-icons) ; use `all-the-icons' package @@ -176,7 +192,7 @@ To modify heading icons with another icon from nerd-icons octicons: (bookmarks . "nf-oct-book"))) #+END_SRC -To show navigator below the banner: +To show navigators below the banner: #+BEGIN_SRC emacs-lisp (setq dashboard-set-navigator t) #+END_SRC From ed1a6a452e26e2042faec2e073f1441d73a69447 Mon Sep 17 00:00:00 2001 From: JenChieh Date: Wed, 21 Feb 2024 16:59:35 -0800 Subject: [PATCH 24/90] style: Minor imrovements --- dashboard-widgets.el | 65 ++++++++++++++++++++++++-------------------- dashboard.el | 56 +++++++++++++++++++++----------------- 2 files changed, 67 insertions(+), 54 deletions(-) diff --git a/dashboard-widgets.el b/dashboard-widgets.el index 0a12c5b..99c9553 100644 --- a/dashboard-widgets.el +++ b/dashboard-widgets.el @@ -17,6 +17,9 @@ (require 'image) (require 'subr-x) +;; +;;; Externals + ;; Compiler pacifier (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") @@ -68,6 +71,13 @@ (declare-function string-pixel-width "subr-x.el") ; TODO: remove this after 29.1 (declare-function shr-string-pixel-width "shr.el") ; TODO: remove this after 29.1 +(defvar recentf-list nil) + +(defvar dashboard-buffer-name) + +;; +;;; Customization + (defcustom dashboard-page-separator "\n\n" "Separator to use between the different pages." :type 'string @@ -439,13 +449,9 @@ Set to nil for unbounded." :type 'string :group 'dashboard) -(defvar recentf-list nil) - -(defvar dashboard-buffer-name) - -;; -;; Faces ;; +;;; Faces + (defface dashboard-text-banner '((t (:inherit font-lock-keyword-face))) "Face used for text banners." @@ -494,8 +500,8 @@ Set to nil for unbounded." 'dashboard-heading-face 'dashboard-heading "1.2.6") ;; -;; Util -;; +;;; Util + (defmacro dashboard-mute-apply (&rest body) "Execute BODY without message." (declare (indent 0) (debug t)) @@ -523,8 +529,8 @@ Set to nil for unbounded." (if (zerop (% len width)) 0 1)))) ; add one if exceeed ;; -;; Generic widget helpers -;; +;;; Widget helpers + (defun dashboard-subseq (seq end) "Return the subsequence of SEQ from 0 to END." (let ((len (length seq))) (butlast seq (- len (min len end))))) @@ -641,8 +647,7 @@ If MESSAGEBUF is not nil then MSG is also written in message buffer." (dashboard-center-text start (point)))) ;; -;; BANNER -;; +;;; Banner (defun dashboard-get-banner-path (index) "Return the full path to banner with index INDEX." @@ -783,8 +788,8 @@ Argument IMAGE-PATH path to the image." (dashboard-insert-init-info)) ;; -;; INIT INFO -;; +;;; Initialize info + (defun dashboard-insert-init-info () "Insert init info when `dashboard-set-init-info' is t." (when dashboard-set-init-info @@ -851,8 +856,8 @@ WIDGET-PARAMS are passed to the \"widget-create\" function." (insert (propertize "\n --- No items ---" 'face 'dashboard-no-items-face))))) ;; -;; Section list -;; +;;; Section list + (defmacro dashboard-insert-section-list (section-name list action &rest rest) "Insert into SECTION-NAME a LIST of items, expanding ACTION and passing REST to widget creation." @@ -888,7 +893,9 @@ to widget creation." :format "%[%t%]"))) ,list))) -;; Footer +;; +;;; Footer + (defun dashboard-random-footer () "Return a random footer from `dashboard-footer-messages'." (nth (random (length dashboard-footer-messages)) dashboard-footer-messages)) @@ -905,8 +912,8 @@ to widget creation." "\n"))) ;; -;; Truncate -;; +;;; Truncate + (defcustom dashboard-shorten-by-window-width nil "Shorten path by window edges." :type 'boolean @@ -1055,8 +1062,8 @@ to widget creation." align-length)) ;; -;; Recentf -;; +;;; Recentf + (defcustom dashboard-recentf-show-base nil "Show the base file name infront of it's path." :type '(choice @@ -1106,8 +1113,8 @@ to widget creation." (t (format dashboard-recentf-item-format filename path)))))) ;; -;; Bookmarks -;; +;;; Bookmarks + (defcustom dashboard-bookmarks-show-base t "Show the base file name infront of it's path." :type '(choice @@ -1150,8 +1157,8 @@ to widget creation." el))) ;; -;; Projects -;; +;;; Projects + (defcustom dashboard-projects-switch-function nil "Custom function to switch to projects from dashboard. @@ -1247,8 +1254,8 @@ over custom backends." :error))))) ;; -;; Org Agenda -;; +;;; Org Agenda + (defcustom dashboard-week-agenda t "Show agenda weekly if its not nil." :type 'boolean @@ -1502,8 +1509,8 @@ to compare." (format "%s" el))) ;; -;; Registers -;; +;;; Registers + (defun dashboard-insert-registers (list-size) "Add the list of LIST-SIZE items of registers." (require 'register) diff --git a/dashboard.el b/dashboard.el index 2cb392a..c9ca551 100644 --- a/dashboard.el +++ b/dashboard.el @@ -27,6 +27,9 @@ (require 'dashboard-widgets) +;; +;;; Externals + (declare-function bookmark-get-filename "ext:bookmark.el") (declare-function bookmark-all-names "ext:bookmark.el") (declare-function dashboard-ls--dirs "ext:dashboard-ls.el") @@ -38,6 +41,9 @@ (declare-function dashboard-refresh-buffer "dashboard.el") +;; +;;; Customization + (defgroup dashboard nil "Extensible startup screen." :group 'applications) @@ -45,17 +51,17 @@ ;; Custom splash screen (defvar dashboard-mode-map (let ((map (make-sparse-keymap))) - (define-key map (kbd "C-p") 'dashboard-previous-line) - (define-key map (kbd "C-n") 'dashboard-next-line) - (define-key map (kbd "") 'dashboard-previous-line) - (define-key map (kbd "") 'dashboard-next-line) - (define-key map (kbd "k") 'dashboard-previous-line) - (define-key map (kbd "j") 'dashboard-next-line) - (define-key map [tab] 'widget-forward) - (define-key map (kbd "C-i") 'widget-forward) - (define-key map [backtab] 'widget-backward) - (define-key map (kbd "RET") 'dashboard-return) - (define-key map [mouse-1] 'dashboard-mouse-1) + (define-key map (kbd "C-p") #'dashboard-previous-line) + (define-key map (kbd "C-n") #'dashboard-next-line) + (define-key map (kbd "") #'dashboard-previous-line) + (define-key map (kbd "") #'dashboard-next-line) + (define-key map (kbd "k") #'dashboard-previous-line) + (define-key map (kbd "j") #'dashboard-next-line) + (define-key map [tab] #'widget-forward) + (define-key map (kbd "C-i") #'widget-forward) + (define-key map [backtab] #'widget-backward) + (define-key map (kbd "RET") #'dashboard-return) + (define-key map [mouse-1] #'dashboard-mouse-1) (define-key map (kbd "}") #'dashboard-next-section) (define-key map (kbd "{") #'dashboard-previous-section) @@ -122,8 +128,8 @@ "List of section starting positions.") ;; -;; Util -;; +;;; Util + (defun dashboard--goto-line (line) "Goto LINE." (goto-char (point-min)) (forward-line (1- line))) @@ -138,8 +144,8 @@ (move-to-column column))) ;; -;; Core -;; +;;; Core + (defun dashboard--current-section () "Return section symbol in dashboard." (save-excursion @@ -157,8 +163,8 @@ (user-error "Failed searching dashboard section")))) ;; -;; Navigation -;; +;;; Navigation + (defun dashboard-previous-section () "Navigate back to previous section." (interactive) @@ -244,8 +250,8 @@ Optional prefix ARG says how many lines to move; default is one line." (beginning-of-line-text)) ;; -;; ffap -;; +;;; ffap + (defun dashboard--goto-section (section) "Move to SECTION declares in variable `dashboard-item-shortcuts'." (let ((fnc (intern (format "dashboard-jump-to-%s" section)))) @@ -302,8 +308,8 @@ Optional argument ARGS adviced function arguments." (advice-add 'ffap-guesser :around #'dashboard--ffap-guesser--adv) ;; -;; Removal -;; +;;; Removal + (defun dashboard-remove-item-under () "Remove a item from the current item section." (interactive) @@ -349,8 +355,8 @@ Optional argument ARGS adviced function arguments." (interactive)) ; TODO: .. ;; -;; Confirmation -;; +;;; Confirmation + (defun dashboard-return () "Hit return key in dashboard buffer." (interactive) @@ -380,8 +386,8 @@ Optional argument ARGS adviced function arguments." (setq track-mouse old-track-mouse)))) ;; -;; Insertion -;; +;;; Insertion + (defmacro dashboard--with-buffer (&rest body) "Execute BODY in dashboard buffer." (declare (indent 0)) From b6c268f0aa565263825be287359c4fcab6ee208e Mon Sep 17 00:00:00 2001 From: Satya Prakash Dahal <51309409+SATYADAHAL@users.noreply.github.com> Date: Thu, 7 Mar 2024 14:36:02 +0545 Subject: [PATCH 25/90] Fixed: Adding anmiation to webp image. (#502) * Fixed: Adding anmiation to webp image. * Checking for images if the contain multiple frames * 1. Making the comment style consistent. 2. Just return the value without if condition. 3. Remove extra line and fix indentation. * 1. Make function check type of image instead of multiple frames. 2. Prevents creation of image every time function is called. * Update: Remove functions no longer needed. * Making consistent by adding proper spaces --- dashboard-widgets.el | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/dashboard-widgets.el b/dashboard-widgets.el index 99c9553..d1038d5 100644 --- a/dashboard-widgets.el +++ b/dashboard-widgets.el @@ -704,11 +704,11 @@ If MESSAGEBUF is not nil then MSG is also written in message buffer." (_ (message "unsupported banner config %s" dashboard-startup-banner)))) -(defun dashboard--type-is-gif-p (image-path) - "Return if image is a gif. +(defun dashboard--image-animated-p (image-path) + "Return if image is a gif or webp. String -> bool. Argument IMAGE-PATH path to the image." - (eq 'gif (image-type image-path))) + (memq (image-type image-path) '(gif webp))) (defun dashboard--type-is-xbm-p (image-path) "Return if image is a xbm. @@ -748,7 +748,7 @@ Argument IMAGE-PATH path to the image." (list :max-height dashboard-image-banner-max-height)) dashboard-image-extra-props))) (setq image-spec - (cond ((dashboard--type-is-gif-p img) + (cond ((dashboard--image-animated-p img) (create-image img)) ((dashboard--type-is-xbm-p img) (create-image img)) @@ -760,7 +760,9 @@ Argument IMAGE-PATH path to the image." (memq 'scale (funcall 'image-transforms-p))) img-props)))))) (add-text-properties start (point) `(display ,image-spec)) - (when (dashboard--type-is-gif-p img) (image-animate image-spec 0 t))) + (when (image-multi-frame-p image-spec) (image-animate image-spec 0 t))) + + ;; Finally, center the banner (if any). (when-let* ((text-align-spec `(space . (:align-to (- center ,(/ text-width 2))))) (image-align-spec `(space . (:align-to (- center (0.5 . ,image-spec))))) From 41511eaaf87b5350898a22d5f9d6d993d135d6a5 Mon Sep 17 00:00:00 2001 From: Jen-Chieh Shen Date: Thu, 7 Mar 2024 00:52:04 -0800 Subject: [PATCH 26/90] chore: Update changelog (#503) --- CHANGELOG.md | 1 + 1 file changed, 1 insertion(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 1bcb350..cbd3c3b 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -12,6 +12,7 @@ Check [Keep a Changelog](http://keepachangelog.com/) for recommendations on how * Add dashboard icon face (#483) * Add customization option to hide the cursor on the dashboard (#492) * Add option to vertically center dashboard (#318 and #493) +* fix: Adding anmiation to webp image (#502) ## 1.8.0 > Released Jul 26, 2023 From c2d7d5f973d6d5d0dae507f208e4dabfea547561 Mon Sep 17 00:00:00 2001 From: JenChieh Date: Thu, 7 Mar 2024 00:54:17 -0800 Subject: [PATCH 27/90] style: Remove extra newlines --- dashboard-widgets.el | 1 - 1 file changed, 1 deletion(-) diff --git a/dashboard-widgets.el b/dashboard-widgets.el index d1038d5..5c3db05 100644 --- a/dashboard-widgets.el +++ b/dashboard-widgets.el @@ -762,7 +762,6 @@ Argument IMAGE-PATH path to the image." (add-text-properties start (point) `(display ,image-spec)) (when (image-multi-frame-p image-spec) (image-animate image-spec 0 t))) - ;; Finally, center the banner (if any). (when-let* ((text-align-spec `(space . (:align-to (- center ,(/ text-width 2))))) (image-align-spec `(space . (:align-to (- center (0.5 . ,image-spec))))) From fbf54b12d8aa6b9853d32ee9b635004ad6bc0e41 Mon Sep 17 00:00:00 2001 From: JenChieh Date: Fri, 8 Mar 2024 00:56:14 -0800 Subject: [PATCH 28/90] fix: Unsupported multiple-frame --- dashboard-widgets.el | 17 +++++++++-------- 1 file changed, 9 insertions(+), 8 deletions(-) diff --git a/dashboard-widgets.el b/dashboard-widgets.el index 5c3db05..279613a 100644 --- a/dashboard-widgets.el +++ b/dashboard-widgets.el @@ -719,15 +719,16 @@ Argument IMAGE-PATH path to the image." (defun dashboard-insert-banner () "Insert the banner at the top of the dashboard." (goto-char (point-max)) - (when-let (banner (dashboard-choose-banner)) + (when-let ((banner (dashboard-choose-banner))) (insert "\n") (let ((start (point)) buffer-read-only text-width - image-spec) - (when (display-graphic-p) (insert "\n")) + image-spec + (graphic-mode (display-graphic-p))) + (when graphic-mode (insert "\n")) ;; If specified, insert a text banner. - (when-let (txt (plist-get banner :text)) + (when-let ((txt (plist-get banner :text))) (if (eq dashboard-startup-banner 'ascii) (save-excursion (insert txt)) (insert-file-contents txt)) @@ -735,12 +736,12 @@ Argument IMAGE-PATH path to the image." (setq text-width 0) (while (not (eobp)) (let ((line-length (- (line-end-position) (line-beginning-position)))) - (if (< text-width line-length) - (setq text-width line-length))) + (when (< text-width line-length) + (setq text-width line-length))) (forward-line 1))) ;; If specified, insert an image banner. When displayed in a graphical frame, this will ;; replace the text banner. - (when-let (img (plist-get banner :image)) + (when-let ((img (plist-get banner :image))) (let ((img-props (append (when (> dashboard-image-banner-max-width 0) (list :max-width dashboard-image-banner-max-width)) @@ -760,7 +761,7 @@ Argument IMAGE-PATH path to the image." (memq 'scale (funcall 'image-transforms-p))) img-props)))))) (add-text-properties start (point) `(display ,image-spec)) - (when (image-multi-frame-p image-spec) (image-animate image-spec 0 t))) + (when (ignore-errors (image-multi-frame-p image-spec)) (image-animate image-spec 0 t))) ;; Finally, center the banner (if any). (when-let* ((text-align-spec `(space . (:align-to (- center ,(/ text-width 2))))) From 844fcc3d27bebc9a070e4c067ecee200b8a87847 Mon Sep 17 00:00:00 2001 From: DevelopmentCool2449 <163072436+DevelopmentCool2449@users.noreply.github.com> Date: Thu, 14 Mar 2024 15:17:09 -0600 Subject: [PATCH 29/90] Support for insert startupify list in order, support for solaire mode and more. (#506) * Support for insert startupify list in order and support for solaire mode. This allow to dashboard insert startupify list in order, this adds more customization to dashboard. Also i've added support for solaire mode. * Update dashboard.el * Update dashboard-widgets.el * Update dashboard.el * Update dashboard-widgets.el * Update dashboard-widgets.el * Update dashboard-widgets.el * Update dashboard.el * Update dashboard.el * Update dashboard-widgets.el * Update dashboard.el * Update dashboard.el * Update dashboard-widgets.el * Deleted unnecessary solaire support from dashboard.el * Fix unused n from dashboard-insert-newline in dashboard-widgets.el * Fix missing paren in dashboard.el * Delete whitespace and fix extra paren in dashboard.el * Delete some Whitespaces in dashboard.el * Separate dashboard-banner-logo-title from dashboard-insert-banner dashboard.el * Make dashboard-banner-logo-title a separate variable dashboard.el * Add missing newline to dashboard-startupify-list dashboard.el * Documents changes in README.org * Fix whitespace in dashboard-widgets.el * Revert newline in dashboard-insert-init-info and set dashboard-projects-backend to 'project-el dashboard-widgets.el --- README.org | 49 ++++++++++++++++++++----- dashboard-widgets.el | 38 ++++++++++++------- dashboard.el | 87 +++++++++++++++++++++++++++----------------- 3 files changed, 119 insertions(+), 55 deletions(-) diff --git a/README.org b/README.org index 4d87215..ed2bb9a 100644 --- a/README.org +++ b/README.org @@ -94,13 +94,17 @@ To update the banner or banner title (setq dashboard-banner-logo-title "Welcome to Emacs Dashboard") ;; Set the banner (setq dashboard-startup-banner [VALUE]) - ;; Value can be - ;; - nil to display no banner - ;; - 'official which displays the official emacs logo - ;; - 'logo which displays an alternative emacs logo - ;; - 1, 2 or 3 which displays one of the text banners - ;; - "path/to/your/image.gif", "path/to/your/image.png", "path/to/your/text.txt" or "path/to/your/image.xbm" which displays whatever gif/image/text/xbm you would prefer - ;; - a cons of '("path/to/your/image.png" . "path/to/your/text.txt") + ;; Value can be: + ;; - nil to display no banner. + ;; - 'official which displays the official emacs logo. + ;; - 'logo which displays an alternative emacs logo. + ;; - an integer which displays one of the text banners + ;; (see dashboard-banners-directory files). + ;; - a string that specifies a path for a custom banner + ;; currently supported types are gif/image/text/xbm. + ;; - a cons of 2 strings which specifies the path of an image to use + ;; and other path of a text file to use if image isn't supported. + ;; ("path/to/image/file/image.png" . "path/to/text/file/text.txt"). ;; Content is not centered by default. To center, set (setq dashboard-center-content t) @@ -111,7 +115,7 @@ To update the banner or banner title (setq dashboard-show-shortcuts nil) #+END_SRC -To customize which widgets are displayed, you can use the following snippet +To customize which items are displayed, you can use the following snippet #+BEGIN_SRC elisp (setq dashboard-items '((recents . 5) (bookmarks . 5) @@ -121,6 +125,23 @@ To customize which widgets are displayed, you can use the following snippet #+END_SRC This will add the recent files, bookmarks, projects, org-agenda and registers widgets to your dashboard each displaying 5 items. +To customize which widgets to display in order (example: Banner, footer message ...): +#+begin_src emacs-lisp + (setq dashboard-startupify-list '(dashboard-insert-banner + dashboard-insert-banner-title + dashboard-insert-init-info + dashboard-insert-newline + dashboard-insert-footer + dashboard-insert-items + dashboard-insert-navigator + dashboard-insert-newline)) +#+end_src + +To customize string format in shortcuts: +#+begin_src emacs-lisp + (setq dashboard-heading-shorcut-format " [%s]") +#+end_src + To customize item shortcuts: #+BEGIN_SRC elisp (setq dashboard-item-shortcuts '((recents . "r") @@ -134,7 +155,7 @@ To modify the widget heading name: #+BEGIN_SRC elisp (setq dashboard-item-names '(("Recent Files:" . "Recently opened files:") ("Agenda for today:" . "Today's agenda:") - ("Agenda for the coming week:" . "Agenda:")) + ("Agenda for the coming week:" . "Agenda:"))) #+END_SRC The default length for each item. @@ -241,6 +262,16 @@ To customize it and customize its icon; :face 'font-lock-keyword-face)) #+END_SRC +To use it with [[https://github.com/hlissner/emacs-solaire-mode][solaire-mode]]: +#+begin_src emacs-lisp +(add-hook 'dashboard-after-initialize-hook #'solaire-mode) +#+end_src + +Or for use-package users +#+begin_src emacs-lisp +:hook (dashboard-after-initialize . solaire-mode) +#+end_src + To use it with [[https://github.com/ericdanan/counsel-projectile][counsel-projectile]] or [[https://github.com/bbatsov/persp-projectile][persp-projectile]] #+begin_src elisp diff --git a/dashboard-widgets.el b/dashboard-widgets.el index 279613a..dcfe65c 100644 --- a/dashboard-widgets.el +++ b/dashboard-widgets.el @@ -80,7 +80,11 @@ (defcustom dashboard-page-separator "\n\n" "Separator to use between the different pages." - :type 'string + :type '(choice + (const :tag "Default" "\n\n") + (const :tag "Use Page indicator (requires page-break-lines)" + "\n\f\n") + (string :tag "Use Custom String")) :group 'dashboard) (defcustom dashboard-image-banner-max-height 0 @@ -342,6 +346,11 @@ ARGS should be a plist containing `:height', `:v-adjust', or `:face' properties. :type 'string :group 'dashboard) +(defcustom dashboard-heading-shorcut-format " (%s)" + "String for display key used in headings." + :type 'string + :group 'dashboard) + (defcustom dashboard-startup-banner 'official "Specify the startup banner. Default value is `official', it displays the Emacs logo. `logo' displays Emacs @@ -370,10 +379,10 @@ nil then no banner is displayed." Will be of the form `(list-type . list-function)'. Possible values for list-type are: `recents', `bookmarks', `projects', `agenda' ,`registers'." - :type '(repeat (alist :key-type symbol :value-type function)) + :type '(alist :key-type symbol :value-type function) :group 'dashboard) -(defcustom dashboard-projects-backend 'projectile +(defcustom dashboard-projects-backend 'project-el "The package that supplies the list of recent projects. With the value `projectile', the projects widget uses the package projectile (available in MELPA). With the value `project-el', @@ -587,6 +596,11 @@ If MESSAGEBUF is not nil then MSG is also written in message buffer." "Insert a page break line in dashboard buffer." (dashboard-append dashboard-page-separator)) +(defun dashboard-insert-newline (&optional n) + "Insert N times of newlines." + (dotimes (_ (or n 1)) + (insert "\n"))) + (defun dashboard-insert-heading (heading &optional shortcut icon) "Insert a widget HEADING in dashboard buffer, adding SHORTCUT, ICON if provided." (when (and (dashboard-display-icons-p) dashboard-set-heading-icons) @@ -625,7 +639,7 @@ If MESSAGEBUF is not nil then MSG is also written in message buffer." (let ((ov (make-overlay (- (point) (length heading)) (point) nil t))) (overlay-put ov 'display (or (cdr (assoc heading dashboard-item-names)) heading)) (overlay-put ov 'face 'dashboard-heading)) - (when shortcut (insert (format " (%s)" shortcut)))) + (when shortcut (insert (format dashboard-heading-shorcut-format shortcut)))) (defun dashboard-center-text (start end) "Center the text between START and END." @@ -781,17 +795,17 @@ Argument IMAGE-PATH path to the image." (t nil))) (prefix (propertize " " 'display prop))) (add-text-properties start (point) `(line-prefix ,prefix wrap-prefix ,prefix))) - (insert "\n\n") - (add-text-properties start (point) '(cursor-intangible t inhibit-isearch t)))) + (insert "\n") + (add-text-properties start (point) '(cursor-intangible t inhibit-isearch t))))) + +(defun dashboard-insert-banner-title () + "Insert `dashboard-banner-logo-title' if it's non-nil." (when dashboard-banner-logo-title (dashboard-insert-center (propertize dashboard-banner-logo-title 'face 'dashboard-banner-logo-title)) - (insert "\n\n")) - (dashboard-insert-navigator) - (dashboard-insert-init-info)) + (insert "\n"))) ;; ;;; Initialize info - (defun dashboard-insert-init-info () "Insert init info when `dashboard-set-init-info' is t." (when dashboard-set-init-info @@ -834,8 +848,7 @@ Argument IMAGE-PATH path to the image." :format "%[%t%]") (insert " "))) (dashboard-center-text (line-beginning-position) (line-end-position)) - (insert "\n")) - (insert "\n"))) + (insert "\n")))) (defmacro dashboard-insert-section (section-name list list-size shortcut-id shortcut-char action &rest widget-params) "Add a section with SECTION-NAME and LIST of LIST-SIZE items to the dashboard. @@ -906,7 +919,6 @@ to widget creation." "Insert footer of dashboard." (when-let ((footer (and dashboard-set-footer (dashboard-random-footer))) (footer-icon (dashboard-replace-displayable dashboard-footer-icon))) - (insert "\n") (dashboard-insert-center (if (string-empty-p footer-icon) footer-icon (concat footer-icon " ")) diff --git a/dashboard.el b/dashboard.el index c9ca551..e0a2d05 100644 --- a/dashboard.el +++ b/dashboard.el @@ -118,6 +118,21 @@ :type 'boolean :group 'dashboard) +(defcustom dashboard-startupify-list + '(dashboard-insert-banner + dashboard-insert-newline + dashboard-insert-banner-title + dashboard-insert-newline + dashboard-insert-navigator + dashboard-insert-newline + dashboard-insert-init-info + dashboard-insert-items + dashboard-insert-newline + dashboard-insert-footer) + "List of dashboard widgets (in order) to insert in dashboard buffer." + :type '(repeat function) + :group 'dashboard) + (defconst dashboard-buffer-name "*dashboard*" "Dashboard's buffer name.") @@ -407,55 +422,61 @@ Optional argument ARGS adviced function arguments." (forward-line 1))) max-line-length)) +(defun dashboard-insert-items () + "Function to insert dashboard items. +See `dashboard-item-generators' for all items available." + (let ((recentf-is-on (recentf-enabled-p)) + (origial-recentf-list recentf-list) + (max-line-length 0)) + (mapc (lambda (els) + (let* ((el (or (car-safe els) els)) + (list-size + (or (cdr-safe els) + dashboard-items-default-length)) + (item-generator + (cdr-safe (assoc el dashboard-item-generators)))) + + (push (point) dashboard--section-starts) + (funcall item-generator list-size) + (goto-char (point-max)) + + (when recentf-is-on + (setq recentf-list origial-recentf-list)) + (setq max-line-length + (max max-line-length (dashboard-maximum-section-length))))) + dashboard-items) + + (when dashboard-center-content + (dashboard-center-text + (if dashboard--section-starts + (car (last dashboard--section-starts)) + (point)) + (point-max))) + (dashboard-insert-page-break))) + (defun dashboard-insert-startupify-lists () "Insert the list of widgets into the buffer." (interactive) (let ((inhibit-redisplay t) (recentf-is-on (recentf-enabled-p)) (origial-recentf-list recentf-list) - (dashboard-num-recents (or (cdr (assoc 'recents dashboard-items)) 0)) - (max-line-length 0)) + (dashboard-num-recents (or (cdr (assoc 'recents dashboard-items)) 0))) (when recentf-is-on (setq recentf-list (dashboard-subseq recentf-list dashboard-num-recents))) (dashboard--with-buffer (when (or dashboard-force-refresh (not (eq major-mode 'dashboard-mode))) (erase-buffer) - (dashboard-insert-banner) - (insert "\n") (setq dashboard--section-starts nil) - (mapc (lambda (els) - (let* ((el (or (car-safe els) els)) - (list-size - (or (cdr-safe els) - dashboard-items-default-length)) - (item-generator - (cdr-safe (assoc el dashboard-item-generators)))) - (push (point) dashboard--section-starts) - (funcall item-generator list-size) - (goto-char (point-max)) - ;; add a newline so the next section-name doesn't get include - ;; on the same line. - (insert "\n") - (when recentf-is-on - (setq recentf-list origial-recentf-list)) - (setq max-line-length - (max max-line-length (dashboard-maximum-section-length))))) - dashboard-items) - (when dashboard-center-content - (dashboard-center-text - (if dashboard--section-starts - (car (last dashboard--section-starts)) - (point)) - (point-max))) + + (mapc (lambda (fn) + (funcall fn)) + dashboard-startupify-list) + (save-excursion (dolist (start dashboard--section-starts) (goto-char start) - (delete-char -1) ; delete the newline we added previously (insert dashboard-page-separator))) - (progn - (delete-char -1) - (insert dashboard-page-separator)) - (dashboard-insert-footer) + (when dashboard-vertically-center-content (goto-char (point-min)) (when-let* ((content-height (cdr (window-absolute-pixel-position (point-max)))) From 784ed7ac82b851243eb53d1a17d279a9fa7fb1f0 Mon Sep 17 00:00:00 2001 From: JenChieh Date: Thu, 14 Mar 2024 14:19:17 -0700 Subject: [PATCH 30/90] chore: Update changelog --- CHANGELOG.md | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index cbd3c3b..c1195f1 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -12,7 +12,8 @@ Check [Keep a Changelog](http://keepachangelog.com/) for recommendations on how * Add dashboard icon face (#483) * Add customization option to hide the cursor on the dashboard (#492) * Add option to vertically center dashboard (#318 and #493) -* fix: Adding anmiation to webp image (#502) +* fix: Adding animation to webp image (#502) +* feat: Support for insert startupify list in order (#506) ## 1.8.0 > Released Jul 26, 2023 From a63d772f042727a911152f3cd628750c4fd6bf07 Mon Sep 17 00:00:00 2001 From: JenChieh Date: Fri, 15 Mar 2024 19:53:38 -0700 Subject: [PATCH 31/90] fix: Centering text should be the last --- dashboard-widgets.el | 2 +- dashboard.el | 14 ++++++++------ 2 files changed, 9 insertions(+), 7 deletions(-) diff --git a/dashboard-widgets.el b/dashboard-widgets.el index dcfe65c..e3b1035 100644 --- a/dashboard-widgets.el +++ b/dashboard-widgets.el @@ -651,7 +651,7 @@ If MESSAGEBUF is not nil then MSG is also written in message buffer." (line-length (dashboard-str-len line-str))) (setq width (max width line-length))) (forward-line 1)) - (let ((prefix (propertize " " 'display `(space . (:align-to (- center ,(/ width 2))))))) + (let ((prefix (propertize " " 'display `(space . (:align-to (- center ,(/ (float width) 2))))))) (add-text-properties start end `(line-prefix ,prefix indent-prefix ,prefix)))))) (defun dashboard-insert-center (&rest strings) diff --git a/dashboard.el b/dashboard.el index e0a2d05..f189b15 100644 --- a/dashboard.el +++ b/dashboard.el @@ -446,12 +446,6 @@ See `dashboard-item-generators' for all items available." (max max-line-length (dashboard-maximum-section-length))))) dashboard-items) - (when dashboard-center-content - (dashboard-center-text - (if dashboard--section-starts - (car (last dashboard--section-starts)) - (point)) - (point-max))) (dashboard-insert-page-break))) (defun dashboard-insert-startupify-lists () @@ -485,6 +479,14 @@ See `dashboard-item-generators' for all items available." (vertical-lines (1- (floor (/ vertical-padding (line-pixel-height))))) ((> vertical-lines 0))) (insert (make-string vertical-lines ?\n)))) + + (when dashboard-center-content + (dashboard-center-text + (if dashboard--section-starts + (car (last dashboard--section-starts)) + (point)) + (point-max))) + (goto-char (point-min)) (dashboard-mode))) (when recentf-is-on From c7ae464c5dd54615fcb7806bd5a22aa9f8e1ce00 Mon Sep 17 00:00:00 2001 From: JenChieh Date: Sat, 16 Mar 2024 05:01:32 -0700 Subject: [PATCH 32/90] fix: Incorrect page separators --- README.org | 209 ++++++++++++++++++++++--------------------- dashboard-widgets.el | 17 ++-- dashboard.el | 111 ++++++++++++----------- 3 files changed, 179 insertions(+), 158 deletions(-) diff --git a/README.org b/README.org index ed2bb9a..30e5a15 100644 --- a/README.org +++ b/README.org @@ -11,13 +11,13 @@ An extensible emacs startup screen showing you what's most important. * Features - 1. Displays an awesome Emacs banner! - 2. Recent files - 3. Bookmarks list - 4. Recent projects list (Depends on `projectile` or `project.el` package) - 5. Org mode agenda - 6. Register list - 7. Supports both [[https://github.com/domtronn/all-the-icons.el][all-the-icons]] and [[https://github.com/rainstormstudio/nerd-icons.el][nerd-icons]] +1. Displays an awesome Emacs banner! +2. Recent files +3. Bookmarks list +4. Recent projects list (Depends on `projectile` or `project.el` package) +5. Org mode agenda +6. Register list +7. Supports both [[https://github.com/domtronn/all-the-icons.el][all-the-icons]] and [[https://github.com/rainstormstudio/nerd-icons.el][nerd-icons]] * Screenshot @@ -34,33 +34,33 @@ You will need the following packages which are all available on MELPA: * Usage #+BEGIN_SRC shell -M-x package-install RET dashboard + M-x package-install RET dashboard #+END_SRC ** Open the Dashboard You can set up the dashboard to open automatically at startup using =dashboard-setup-startup-hook=: - #+BEGIN_SRC elisp -(require 'dashboard) -(dashboard-setup-startup-hook) +#+BEGIN_SRC elisp + (require 'dashboard) + (dashboard-setup-startup-hook) #+END_SRC Or with use-package: #+BEGIN_SRC elisp -;; use-package with package.el: -(use-package dashboard - :ensure t - :config - (dashboard-setup-startup-hook)) + ;; use-package with package.el: + (use-package dashboard + :ensure t + :config + (dashboard-setup-startup-hook)) #+END_SRC #+BEGIN_SRC elisp -;; use-package with Elpaca: -(use-package dashboard - :elpaca t - :config - (add-hook 'elpaca-after-init-hook #'dashboard-insert-startupify-lists) - (add-hook 'elpaca-after-init-hook #'dashboard-initialize) - (dashboard-setup-startup-hook)) + ;; use-package with Elpaca: + (use-package dashboard + :elpaca t + :config + (add-hook 'elpaca-after-init-hook #'dashboard-insert-startupify-lists) + (add-hook 'elpaca-after-init-hook #'dashboard-initialize) + (dashboard-setup-startup-hook)) #+END_SRC Alternatively, if you don't want the dashboard to open by default, you can use the interactive function =dashboard-open= to open it when you do want it. @@ -82,7 +82,7 @@ In addition to the above, configure =initial-buffer-choice= to show Dashboard in frames created with =emacsclient -c= as follows: #+BEGIN_SRC elisp -(setq initial-buffer-choice (lambda () (get-buffer-create "*dashboard*"))) + (setq initial-buffer-choice (lambda () (get-buffer-create "*dashboard*"))) #+END_SRC * Configuration @@ -117,24 +117,31 @@ To update the banner or banner title To customize which items are displayed, you can use the following snippet #+BEGIN_SRC elisp -(setq dashboard-items '((recents . 5) - (bookmarks . 5) - (projects . 5) - (agenda . 5) - (registers . 5))) - #+END_SRC + (setq dashboard-items '((recents . 5) + (bookmarks . 5) + (projects . 5) + (agenda . 5) + (registers . 5))) +#+END_SRC This will add the recent files, bookmarks, projects, org-agenda and registers widgets to your dashboard each displaying 5 items. To customize which widgets to display in order (example: Banner, footer message ...): #+begin_src emacs-lisp (setq dashboard-startupify-list '(dashboard-insert-banner + dashboard-insert-newline dashboard-insert-banner-title - dashboard-insert-init-info dashboard-insert-newline - dashboard-insert-footer - dashboard-insert-items dashboard-insert-navigator - dashboard-insert-newline)) + dashboard-insert-newline + dashboard-insert-init-info + dashboard-insert-items + dashboard-insert-newline + dashboard-insert-footer)) +#+end_src + +To enable cycle navigation between each section: +#+begin_src emacs-lisp + (setq dashboard-navigation-cycle t) #+end_src To customize string format in shortcuts: @@ -144,11 +151,11 @@ To customize string format in shortcuts: To customize item shortcuts: #+BEGIN_SRC elisp -(setq dashboard-item-shortcuts '((recents . "r") - (bookmarks . "m") - (projects . "p") - (agenda . "a") - (registers . "e"))) + (setq dashboard-item-shortcuts '((recents . "r") + (bookmarks . "m") + (projects . "p") + (agenda . "a") + (registers . "e"))) #+END_SRC To modify the widget heading name: @@ -160,29 +167,29 @@ To modify the widget heading name: The default length for each item. #+BEGIN_SRC elisp -(setq dashboard-items-default-length 20) + (setq dashboard-items-default-length 20) #+END_SRC To add your own custom widget is pretty easy, define your widget's callback function and add it to `dashboard-items` as such: #+BEGIN_SRC elisp -(defun dashboard-insert-custom (list-size) - (insert "Custom text")) -(add-to-list 'dashboard-item-generators '(custom . dashboard-insert-custom)) -(add-to-list 'dashboard-items '(custom) t) - #+END_SRC + (defun dashboard-insert-custom (list-size) + (insert "Custom text")) + (add-to-list 'dashboard-item-generators '(custom . dashboard-insert-custom)) + (add-to-list 'dashboard-items '(custom) t) +#+END_SRC To add an icon to a custom widget, insert it with `dashboard-insert-heading` in your custom function. In this example, there is an icon but no shortcut. #+BEGIN_SRC elisp -(defun dashboard-insert-custom (list-size) - (dashboard-insert-heading "News:" - nil - (all-the-icons-faicon "newspaper-o" - :height 1.2 - :v-adjust 0.0 - :face 'dashboard-heading)) - (insert "\n") - (insert " Custom text")) - #+END_SRC + (defun dashboard-insert-custom (list-size) + (dashboard-insert-heading "News:" + nil + (all-the-icons-faicon "newspaper-o" + :height 1.2 + :v-adjust 0.0 + :face 'dashboard-heading)) + (insert "\n") + (insert " Custom text")) +#+END_SRC To use ~all-the-icons~ package: #+BEGIN_SRC emacs-lisp @@ -215,86 +222,86 @@ To modify heading icons with another icon from nerd-icons octicons: To show navigators below the banner: #+BEGIN_SRC emacs-lisp -(setq dashboard-set-navigator t) + (setq dashboard-set-navigator t) #+END_SRC To customize the buttons of the navigator like this: #+BEGIN_SRC emacs-lisp -;; Format: "(icon title help action face prefix suffix)" -(setq dashboard-navigator-buttons - `(;; line1 - ((,(all-the-icons-octicon "mark-github" :height 1.1 :v-adjust 0.0) - "Homepage" - "Browse homepage" - (lambda (&rest _) (browse-url "homepage"))) - ("★" "Star" "Show stars" (lambda (&rest _) (show-stars)) warning) - ("?" "" "?/h" #'show-help nil "<" ">")) - ;; line 2 - ((,(all-the-icons-faicon "linkedin" :height 1.1 :v-adjust 0.0) - "Linkedin" - "" - (lambda (&rest _) (browse-url "homepage"))) - ("⚑" nil "Show flags" (lambda (&rest _) (message "flag")) error)))) + ;; Format: "(icon title help action face prefix suffix)" + (setq dashboard-navigator-buttons + `(;; line1 + ((,(all-the-icons-octicon "mark-github" :height 1.1 :v-adjust 0.0) + "Homepage" + "Browse homepage" + (lambda (&rest _) (browse-url "homepage"))) + ("★" "Star" "Show stars" (lambda (&rest _) (show-stars)) warning) + ("?" "" "?/h" #'show-help nil "<" ">")) + ;; line 2 + ((,(all-the-icons-faicon "linkedin" :height 1.1 :v-adjust 0.0) + "Linkedin" + "" + (lambda (&rest _) (browse-url "homepage"))) + ("⚑" nil "Show flags" (lambda (&rest _) (message "flag")) error)))) #+END_SRC To show info about the packages loaded and the init time: #+BEGIN_SRC elisp -(setq dashboard-set-init-info t) + (setq dashboard-set-init-info t) #+END_SRC Also, the message can be customized like this: #+BEGIN_SRC elisp -(setq dashboard-init-info "This is an init message!") + (setq dashboard-init-info "This is an init message!") #+END_SRC A randomly selected footnote will be displayed. To disable it: #+BEGIN_SRC elisp -(setq dashboard-set-footer nil) + (setq dashboard-set-footer nil) #+END_SRC To customize it and customize its icon; #+BEGIN_SRC elisp -(setq dashboard-footer-messages '("Dashboard is pretty cool!")) -(setq dashboard-footer-icon (all-the-icons-octicon "dashboard" - :height 1.1 - :v-adjust -0.05 - :face 'font-lock-keyword-face)) + (setq dashboard-footer-messages '("Dashboard is pretty cool!")) + (setq dashboard-footer-icon (all-the-icons-octicon "dashboard" + :height 1.1 + :v-adjust -0.05 + :face 'font-lock-keyword-face)) #+END_SRC To use it with [[https://github.com/hlissner/emacs-solaire-mode][solaire-mode]]: #+begin_src emacs-lisp -(add-hook 'dashboard-after-initialize-hook #'solaire-mode) + (add-hook 'dashboard-after-initialize-hook #'solaire-mode) #+end_src Or for use-package users #+begin_src emacs-lisp -:hook (dashboard-after-initialize . solaire-mode) + :hook (dashboard-after-initialize . solaire-mode) #+end_src To use it with [[https://github.com/ericdanan/counsel-projectile][counsel-projectile]] or [[https://github.com/bbatsov/persp-projectile][persp-projectile]] #+begin_src elisp -(setq dashboard-projects-switch-function 'counsel-projectile-switch-project-by-name) + (setq dashboard-projects-switch-function 'counsel-projectile-switch-project-by-name) #+end_src Or #+begin_src elisp -(setq dashboard-projects-switch-function 'projectile-persp-switch-project) + (setq dashboard-projects-switch-function 'projectile-persp-switch-project) #+end_src ** Org mode’s agenda - To display today’s agenda items on the dashboard, add ~agenda~ to ~dashboard-items~: +To display today’s agenda items on the dashboard, add ~agenda~ to ~dashboard-items~: #+BEGIN_SRC elisp -(add-to-list 'dashboard-items '(agenda) t) + (add-to-list 'dashboard-items '(agenda) t) #+END_SRC To show agenda for the upcoming seven days set the variable ~dashboard-week-agenda~ to ~t~. #+BEGIN_SRC elisp -(setq dashboard-week-agenda t) + (setq dashboard-week-agenda t) #+END_SRC By default org-agenda entries are filter by time, only showing those @@ -302,7 +309,7 @@ task with ~DEADLINE~, ~SCHEDULE-TIME~ or ~TIMESTAMP~ . To show all agenda entrie (except ~DONE~) #+begin_src elisp -(setq dashboard-filter-agenda-entry 'dashboard-no-filter-agenda) + (setq dashboard-filter-agenda-entry 'dashboard-no-filter-agenda) #+end_src To have an extra filter, ~MATCH~ parameter is exposed as @@ -352,13 +359,13 @@ or to ~nil~. It is possible to customize Dashboard's appearance using the following faces: - ~dashboard-banner-logo-title~ :: - Highlights the banner title. + Highlights the banner title. - ~dashboard-text-banner~ :: - Highlights text banners. + Highlights text banners. - ~dashboard-heading~ :: - Highlights widget headings. + Highlights widget headings. - ~dashboard-items-face~ :: - Highlights widget items. + Highlights widget items. * Shortcuts @@ -381,11 +388,11 @@ You can use any of the following shortcuts inside Dashboard |----------------------------+------------------| * Wish List - 1. [X] Center content - 2. [X] More banner options - 3. [X] Customizing the list of widgets to display - 4. [X] Integrate Org-mode's agenda - 5. [ ] Listing Perspectives +1. [X] Center content +2. [X] More banner options +3. [X] Customizing the list of widgets to display +4. [X] Integrate Org-mode's agenda +5. [ ] Listing Perspectives * Contributions @@ -402,15 +409,15 @@ develop your changes and then install this as "development version". This is accomplished with the following steps: #+BEGIN_SRC shell -# In emacs: -M-x package-delete dashboard- RET + # In emacs: + M-x package-delete dashboard- RET #+END_SRC #+BEGIN_SRC shell -make package -make install + make package + make install #+END_SRC ** Prerequisites - * [[https://github.com/emacs-eask/cli][Eask]] +* [[https://github.com/emacs-eask/cli][Eask]] diff --git a/dashboard-widgets.el b/dashboard-widgets.el index e3b1035..a5f6e87 100644 --- a/dashboard-widgets.el +++ b/dashboard-widgets.el @@ -78,10 +78,10 @@ ;; ;;; Customization -(defcustom dashboard-page-separator "\n\n" +(defcustom dashboard-page-separator "\n" "Separator to use between the different pages." :type '(choice - (const :tag "Default" "\n\n") + (const :tag "Default" "\n") (const :tag "Use Page indicator (requires page-break-lines)" "\n\f\n") (string :tag "Use Custom String")) @@ -641,8 +641,8 @@ If MESSAGEBUF is not nil then MSG is also written in message buffer." (overlay-put ov 'face 'dashboard-heading)) (when shortcut (insert (format dashboard-heading-shorcut-format shortcut)))) -(defun dashboard-center-text (start end) - "Center the text between START and END." +(defun dashboard--find-max-width (start end) + "Return the max width within the region START and END." (save-excursion (goto-char start) (let ((width 0)) @@ -651,8 +651,13 @@ If MESSAGEBUF is not nil then MSG is also written in message buffer." (line-length (dashboard-str-len line-str))) (setq width (max width line-length))) (forward-line 1)) - (let ((prefix (propertize " " 'display `(space . (:align-to (- center ,(/ (float width) 2))))))) - (add-text-properties start end `(line-prefix ,prefix indent-prefix ,prefix)))))) + width))) + +(defun dashboard-center-text (start end) + "Center the text between START and END." + (let* ((width (dashboard--find-max-width start end)) + (prefix (propertize " " 'display `(space . (:align-to (- center ,(/ (float width) 2))))))) + (add-text-properties start end `(line-prefix ,prefix indent-prefix ,prefix)))) (defun dashboard-insert-center (&rest strings) "Insert STRINGS in the center of the buffer." diff --git a/dashboard.el b/dashboard.el index f189b15..ff592b7 100644 --- a/dashboard.el +++ b/dashboard.el @@ -133,6 +133,11 @@ :type '(repeat function) :group 'dashboard) +(defcustom dashboard-navigation-cycle nil + "Non-nil cycle the section navigation." + :type 'boolean + :group 'dashboard) + (defconst dashboard-buffer-name "*dashboard*" "Dashboard's buffer name.") @@ -161,11 +166,16 @@ ;; ;;; Core +(defun dashboard--separator () + "Return separator used to search." + (concat "\n" dashboard-page-separator)) + (defun dashboard--current-section () "Return section symbol in dashboard." (save-excursion - (if (and (search-backward dashboard-page-separator nil t) - (search-forward dashboard-page-separator nil t)) + (if-let* ((sep (dashboard--separator)) + ((and (search-backward sep nil t) + (search-forward sep nil t)))) (let ((ln (thing-at-point 'line))) (cond ((string-match-p "Recent Files:" ln) 'recents) ((string-match-p "Bookmarks:" ln) 'bookmarks) @@ -181,36 +191,48 @@ ;;; Navigation (defun dashboard-previous-section () - "Navigate back to previous section." + "Navigate forward to next section." (interactive) - (let ((current-position (point)) current-section-start previous-section-start) - (dolist (elt dashboard--section-starts) - (when (and current-section-start (not previous-section-start)) - (setq previous-section-start elt)) - (when (and (not current-section-start) (< elt current-position)) - (setq current-section-start elt))) - (goto-char (if (eq current-position current-section-start) - previous-section-start - current-section-start)))) + (let* ((items-len (1- (length dashboard-items))) + (first-item (car (nth 0 dashboard-items))) + (current (or (ignore-errors (dashboard--current-section)) + first-item)) + (items (mapcar #'car dashboard-items)) + (find (cl-position current items :test #'equal)) + (prev-index (1- find)) + (prev (cond (dashboard-navigation-cycle + (if (< prev-index 0) (nth items-len items) + (nth prev-index items))) + (t + (if (< prev-index 0) (nth 0 items) + (nth prev-index items)))))) + (dashboard--goto-section prev))) (defun dashboard-next-section () "Navigate forward to next section." (interactive) - (let ((current-position (point)) next-section-start - (section-starts (reverse dashboard--section-starts))) - (dolist (elt section-starts) - (when (and (not next-section-start) - (> elt current-position)) - (setq next-section-start elt))) - (when next-section-start - (goto-char next-section-start)))) + (let* ((items-len (1- (length dashboard-items))) + (last-item (car (nth items-len dashboard-items))) + (current (or (ignore-errors (dashboard--current-section)) + last-item)) + (items (mapcar #'car dashboard-items)) + (find (cl-position current items :test #'equal)) + (next-index (1+ find)) + (next (cond (dashboard-navigation-cycle + (or (nth next-index items) + (nth 0 items))) + (t + (if (< items-len next-index) + (nth (min items-len next-index) items) + (nth next-index items)))))) + (dashboard--goto-section next))) (defun dashboard--section-lines () "Return a list of integer represent the starting line number of each section." (let (pb-lst) (save-excursion (goto-char (point-min)) - (while (search-forward dashboard-page-separator nil t) + (while (search-forward (dashboard--separator) nil t) (when (ignore-errors (dashboard--current-section)) (push (line-number-at-pos) pb-lst)))) (setq pb-lst (reverse pb-lst)) @@ -410,24 +432,11 @@ Optional argument ARGS adviced function arguments." (let ((inhibit-read-only t)) ,@body) (current-buffer))) -(defun dashboard-maximum-section-length () - "For the just-inserted section, calculate the length of the longest line." - (let ((max-line-length 0)) - (save-excursion - (dashboard-previous-section) - (while (not (eobp)) - (setq max-line-length - (max max-line-length - (- (line-end-position) (line-beginning-position)))) - (forward-line 1))) - max-line-length)) - (defun dashboard-insert-items () "Function to insert dashboard items. See `dashboard-item-generators' for all items available." (let ((recentf-is-on (recentf-enabled-p)) - (origial-recentf-list recentf-list) - (max-line-length 0)) + (origial-recentf-list recentf-list)) (mapc (lambda (els) (let* ((el (or (car-safe els) els)) (list-size @@ -436,17 +445,29 @@ See `dashboard-item-generators' for all items available." (item-generator (cdr-safe (assoc el dashboard-item-generators)))) + (insert "\n") (push (point) dashboard--section-starts) (funcall item-generator list-size) (goto-char (point-max)) (when recentf-is-on - (setq recentf-list origial-recentf-list)) - (setq max-line-length - (max max-line-length (dashboard-maximum-section-length))))) + (setq recentf-list origial-recentf-list)))) dashboard-items) - (dashboard-insert-page-break))) + (when dashboard-center-content + (dashboard-center-text + (if dashboard--section-starts + (car (last dashboard--section-starts)) + (point)) + (point-max))) + + (save-excursion + (dolist (start dashboard--section-starts) + (goto-char start) + (insert dashboard-page-separator))) + + (insert "\n") + (insert dashboard-page-separator))) (defun dashboard-insert-startupify-lists () "Insert the list of widgets into the buffer." @@ -466,11 +487,6 @@ See `dashboard-item-generators' for all items available." (funcall fn)) dashboard-startupify-list) - (save-excursion - (dolist (start dashboard--section-starts) - (goto-char start) - (insert dashboard-page-separator))) - (when dashboard-vertically-center-content (goto-char (point-min)) (when-let* ((content-height (cdr (window-absolute-pixel-position (point-max)))) @@ -480,13 +496,6 @@ See `dashboard-item-generators' for all items available." ((> vertical-lines 0))) (insert (make-string vertical-lines ?\n)))) - (when dashboard-center-content - (dashboard-center-text - (if dashboard--section-starts - (car (last dashboard--section-starts)) - (point)) - (point-max))) - (goto-char (point-min)) (dashboard-mode))) (when recentf-is-on From 10e596da1e963bed6d66d02e6c4e4b90a5cf3356 Mon Sep 17 00:00:00 2001 From: DevelopmentCool2449 <163072436+DevelopmentCool2449@users.noreply.github.com> Date: Sat, 16 Mar 2024 17:53:25 -0600 Subject: [PATCH 33/90] Deprecate unnecessary user options. (#509) * Deprecate some dashboard user options. Those variables are unnecessary and can be replaced by dashboard-startupify-list, this patch do this job. * Update dashboard.el * Update README.org * Update README.org --- README.org | 18 +----------------- dashboard-widgets.el | 39 +++++++++++++++------------------------ dashboard.el | 17 ++++++++++++++--- 3 files changed, 30 insertions(+), 44 deletions(-) diff --git a/README.org b/README.org index 30e5a15..f8f9416 100644 --- a/README.org +++ b/README.org @@ -95,7 +95,6 @@ To update the banner or banner title ;; Set the banner (setq dashboard-startup-banner [VALUE]) ;; Value can be: - ;; - nil to display no banner. ;; - 'official which displays the official emacs logo. ;; - 'logo which displays an alternative emacs logo. ;; - an integer which displays one of the text banners @@ -138,6 +137,7 @@ To customize which widgets to display in order (example: Banner, footer message dashboard-insert-newline dashboard-insert-footer)) #+end_src +See dashboard-startupify-list for all the widgets avalaibles. To enable cycle navigation between each section: #+begin_src emacs-lisp @@ -220,11 +220,6 @@ To modify heading icons with another icon from nerd-icons octicons: (bookmarks . "nf-oct-book"))) #+END_SRC -To show navigators below the banner: -#+BEGIN_SRC emacs-lisp - (setq dashboard-set-navigator t) -#+END_SRC - To customize the buttons of the navigator like this: #+BEGIN_SRC emacs-lisp ;; Format: "(icon title help action face prefix suffix)" @@ -244,23 +239,12 @@ To customize the buttons of the navigator like this: ("⚑" nil "Show flags" (lambda (&rest _) (message "flag")) error)))) #+END_SRC -To show info about the packages loaded and the init time: -#+BEGIN_SRC elisp - (setq dashboard-set-init-info t) -#+END_SRC - Also, the message can be customized like this: #+BEGIN_SRC elisp (setq dashboard-init-info "This is an init message!") #+END_SRC -A randomly selected footnote will be displayed. To disable it: -#+BEGIN_SRC elisp - (setq dashboard-set-footer nil) -#+END_SRC - To customize it and customize its icon; - #+BEGIN_SRC elisp (setq dashboard-footer-messages '("Dashboard is pretty cool!")) (setq dashboard-footer-icon (all-the-icons-octicon "dashboard" diff --git a/dashboard-widgets.el b/dashboard-widgets.el index a5f6e87..5af9ea3 100644 --- a/dashboard-widgets.el +++ b/dashboard-widgets.el @@ -71,6 +71,15 @@ (declare-function string-pixel-width "subr-x.el") ; TODO: remove this after 29.1 (declare-function shr-string-pixel-width "shr.el") ; TODO: remove this after 29.1 +(make-obsolete-variable 'dashboard-set-navigator + 'dashboard-startupify-list "1.9.0") + +(make-obsolete-variable 'dashboard-set-init-info + 'dashboard-startupify-list "1.9.0") + +(make-obsolete-variable 'dashboard-set-footer + 'dashboard-startupify-list "1.9.0") + (defvar recentf-list nil) (defvar dashboard-buffer-name) @@ -125,21 +134,6 @@ See `create-image' and Info node `(elisp)Image Descriptors'." :type 'boolean :group 'dashboard) -(defcustom dashboard-set-navigator nil - "When non nil, a navigator will be displayed under the banner." - :type 'boolean - :group 'dashboard) - -(defcustom dashboard-set-init-info t - "When non nil, init info will be displayed under the banner." - :type 'boolean - :group 'dashboard) - -(defcustom dashboard-set-footer t - "When non nil, a footer will be displayed at the bottom." - :type 'boolean - :group 'dashboard) - (defcustom dashboard-footer-messages '("The one true editor, Emacs!" "Who the hell uses VIM anyway? Go Evil!" @@ -358,8 +352,7 @@ alternative logo. If set to `ascii', the value of `dashboard-banner-ascii' will be used as the banner. An integer value is the index of text banner. A string value must be a path to a .PNG or .TXT file. If the value is nil then no banner is displayed." - :type '(choice (const :tag "no banner" nil) - (const :tag "offical" official) + :type '(choice (const :tag "offical" official) (const :tag "logo" logo) (const :tag "ascii" ascii) (integer :tag "index of a text banner") @@ -682,7 +675,6 @@ If MESSAGEBUF is not nil then MSG is also written in message buffer." (defun dashboard-choose-banner () "Return a plist specifying the chosen banner based on `dashboard-startup-banner'." (pcase dashboard-startup-banner - ('nil nil) ('official (append (when (image-type-available-p 'png) (list :image dashboard-banner-official-png)) @@ -812,16 +804,15 @@ Argument IMAGE-PATH path to the image." ;; ;;; Initialize info (defun dashboard-insert-init-info () - "Insert init info when `dashboard-set-init-info' is t." - (when dashboard-set-init-info - (let ((init-info (if (functionp dashboard-init-info) + "Insert init info." + (let ((init-info (if (functionp dashboard-init-info) (funcall dashboard-init-info) dashboard-init-info))) - (dashboard-insert-center (propertize init-info 'face 'font-lock-comment-face))))) + (dashboard-insert-center (propertize init-info 'face 'font-lock-comment-face)))) (defun dashboard-insert-navigator () "Insert Navigator of the dashboard." - (when (and dashboard-set-navigator dashboard-navigator-buttons) + (when dashboard-navigator-buttons (dolist (line dashboard-navigator-buttons) (dolist (btn line) (let* ((icon (car btn)) @@ -922,7 +913,7 @@ to widget creation." (defun dashboard-insert-footer () "Insert footer of dashboard." - (when-let ((footer (and dashboard-set-footer (dashboard-random-footer))) + (when-let ((footer (dashboard-random-footer)) (footer-icon (dashboard-replace-displayable dashboard-footer-icon))) (dashboard-insert-center (if (string-empty-p footer-icon) footer-icon diff --git a/dashboard.el b/dashboard.el index ff592b7..42df1af 100644 --- a/dashboard.el +++ b/dashboard.el @@ -123,13 +123,24 @@ dashboard-insert-newline dashboard-insert-banner-title dashboard-insert-newline - dashboard-insert-navigator - dashboard-insert-newline dashboard-insert-init-info dashboard-insert-items dashboard-insert-newline dashboard-insert-footer) - "List of dashboard widgets (in order) to insert in dashboard buffer." + "List of dashboard widgets (in order) to insert in dashboard buffer. +Avalaible functions: + `dashboard-insert-newline' + `dashboard-insert-page-break' + `dashboard-insert-banner' + `dashboard-insert-banner-title' + `dashboard-insert-navigator' + `dashboard-insert-init-info' + `dashboard-insert-items' + `dashboard-insert-footer' + +You can also add your custom function or a lambda to the list. +example: + (lambda () (delete-char -1))" :type '(repeat function) :group 'dashboard) From 14c281a8e9513cfc36e03cd299a9298101a0443e Mon Sep 17 00:00:00 2001 From: DevelopmentCool2449 <163072436+DevelopmentCool2449@users.noreply.github.com> Date: Mon, 18 Mar 2024 12:56:44 -0600 Subject: [PATCH 34/90] Support for random banners. (#510) * Support for random banners dashboard-widgets.el * Update README.org * Update dashboard-widgets.el * Update dashboard-widgets.el * Update dashboard-widgets.el * Update dashboard-widgets.el * Update dashboard-widgets.el * Update dashboard-widgets.el --- README.org | 20 ++++++------ dashboard-widgets.el | 72 +++++++++++++++++++++++++++----------------- 2 files changed, 56 insertions(+), 36 deletions(-) diff --git a/README.org b/README.org index f8f9416..05e4b66 100644 --- a/README.org +++ b/README.org @@ -95,15 +95,17 @@ To update the banner or banner title ;; Set the banner (setq dashboard-startup-banner [VALUE]) ;; Value can be: - ;; - 'official which displays the official emacs logo. - ;; - 'logo which displays an alternative emacs logo. - ;; - an integer which displays one of the text banners - ;; (see dashboard-banners-directory files). - ;; - a string that specifies a path for a custom banner - ;; currently supported types are gif/image/text/xbm. - ;; - a cons of 2 strings which specifies the path of an image to use - ;; and other path of a text file to use if image isn't supported. - ;; ("path/to/image/file/image.png" . "path/to/text/file/text.txt"). + ;; - 'official which displays the official emacs logo. + ;; - 'logo which displays an alternative emacs logo. + ;; - an integer which displays one of the text banners + ;; (see dashboard-banners-directory files). + ;; - a string that specifies a path for a custom banner + ;; currently supported types are gif/image/text/xbm. + ;; - a cons of 2 strings which specifies the path of an image to use + ;; and other path of a text file to use if image isn't supported. + ;; ("path/to/image/file/image.png" . "path/to/text/file/text.txt"). + ;; - a list that can display an random banner, + ;; supported values are: string (filepath), 'official, 'logo and integers. ;; Content is not centered by default. To center, set (setq dashboard-center-content t) diff --git a/dashboard-widgets.el b/dashboard-widgets.el index 5af9ea3..2fc9c3e 100644 --- a/dashboard-widgets.el +++ b/dashboard-widgets.el @@ -346,20 +346,31 @@ ARGS should be a plist containing `:height', `:v-adjust', or `:face' properties. :group 'dashboard) (defcustom dashboard-startup-banner 'official - "Specify the startup banner. -Default value is `official', it displays the Emacs logo. `logo' displays Emacs -alternative logo. If set to `ascii', the value of `dashboard-banner-ascii' -will be used as the banner. An integer value is the index of text banner. -A string value must be a path to a .PNG or .TXT file. If the value is -nil then no banner is displayed." - :type '(choice (const :tag "offical" official) + "Specify the banner type to use. +Value can be + - \\='official displays the official Emacs logo. + - \\='logo displays an alternative Emacs logo. + - an integer which displays one of the text banners. + - a string that specifies the path of an custom banner + supported files types are gif/image/text/xbm. + - a cons of 2 strings which specifies the path of an image to use + and other path of a text file to use if image isn't supported. + - a list that can display an random banner, supported values are: + string (filepath), \\='official, \\='logo and integers." + :type '(choice (const :tag "official" official) (const :tag "logo" logo) (const :tag "ascii" ascii) (integer :tag "index of a text banner") - (string :tag "a path to an image or text banner") - (cons :tag "an image and text banner" + (string :tag "path to an image or text banner") + (cons :tag "image and text banner" (string :tag "image banner path") - (string :tag "text banner path"))) + (string :tag "text banner path")) + (repeat :tag "random banners" + (choice (string :tag "a path to an image or text banner") + (const :tag "official" official) + (const :tag "logo" logo) + (const :tag "ascii" ascii) + (integer :tag "index of a text banner")))) :group 'dashboard) (defcustom dashboard-item-generators @@ -672,9 +683,9 @@ If MESSAGEBUF is not nil then MSG is also written in message buffer." ;; - That function will only look at filenames, this one will inspect the file data itself. (and (file-exists-p img) (ignore-errors (image-type-available-p (image-type img))))) -(defun dashboard-choose-banner () - "Return a plist specifying the chosen banner based on `dashboard-startup-banner'." - (pcase dashboard-startup-banner +(defun dashboard-choose-banner (banner) + "Return a plist specifying the chosen banner based on BANNER." + (pcase banner ('official (append (when (image-type-available-p 'png) (list :image dashboard-banner-official-png)) @@ -686,24 +697,27 @@ If MESSAGEBUF is not nil then MSG is also written in message buffer." ('ascii (append (list :text dashboard-banner-ascii))) ((pred integerp) - (list :text (dashboard-get-banner-path dashboard-startup-banner))) + (list :text (dashboard-get-banner-path banner))) ((pred stringp) - (pcase dashboard-startup-banner + (pcase banner ((pred (lambda (f) (not (file-exists-p f)))) - (message "could not find banner %s, use default instead" dashboard-startup-banner) + (message "could not find banner %s, use default instead" banner) (list :text (dashboard-get-banner-path 1))) ((pred (string-suffix-p ".txt")) - (list :text (if (file-exists-p dashboard-startup-banner) - dashboard-startup-banner - (message "could not find banner %s, use default instead" dashboard-startup-banner) + (list :text (if (file-exists-p banner) + banner + (message "could not find banner %s, use default instead" banner) (dashboard-get-banner-path 1)))) ((pred dashboard--image-supported-p) - (list :image dashboard-startup-banner + (list :image banner :text (dashboard-get-banner-path 1))) (_ - (message "unsupported file type %s" (file-name-nondirectory dashboard-startup-banner)) + (message "unsupported file type %s" (file-name-nondirectory banner)) (list :text (dashboard-get-banner-path 1))))) - (`(,img . ,txt) + ((and + (pred listp) + (pred (lambda (c) (not (proper-list-p c)))) + `(,img . ,txt)) (list :image (if (dashboard--image-supported-p img) img (message "could not find banner %s, use default instead" img) @@ -712,8 +726,12 @@ If MESSAGEBUF is not nil then MSG is also written in message buffer." txt (message "could not find banner %s, use default instead" txt) (dashboard-get-banner-path 1)))) + ((pred proper-list-p) + (let* ((max (length banner)) + (choose (nth (random max) banner))) + (dashboard-choose-banner choose))) (_ - (message "unsupported banner config %s" dashboard-startup-banner)))) + (message "unsupported banner config %s" banner)))) (defun dashboard--image-animated-p (image-path) "Return if image is a gif or webp. @@ -730,7 +748,7 @@ Argument IMAGE-PATH path to the image." (defun dashboard-insert-banner () "Insert the banner at the top of the dashboard." (goto-char (point-max)) - (when-let ((banner (dashboard-choose-banner))) + (when-let ((banner (dashboard-choose-banner dashboard-startup-banner))) (insert "\n") (let ((start (point)) buffer-read-only @@ -740,9 +758,9 @@ Argument IMAGE-PATH path to the image." (when graphic-mode (insert "\n")) ;; If specified, insert a text banner. (when-let ((txt (plist-get banner :text))) - (if (eq dashboard-startup-banner 'ascii) - (save-excursion (insert txt)) - (insert-file-contents txt)) + (if (file-exists-p txt) + (insert-file-contents txt) + (save-excursion (insert txt))) (put-text-property (point) (point-max) 'face 'dashboard-text-banner) (setq text-width 0) (while (not (eobp)) From 61f44c83f93b1c0fe54d075f48aef2628c416be2 Mon Sep 17 00:00:00 2001 From: JenChieh Date: Mon, 18 Mar 2024 11:59:01 -0700 Subject: [PATCH 35/90] chore: Changelog --- CHANGELOG.md | 1 + 1 file changed, 1 insertion(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index c1195f1..2104d5e 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -14,6 +14,7 @@ Check [Keep a Changelog](http://keepachangelog.com/) for recommendations on how * Add option to vertically center dashboard (#318 and #493) * fix: Adding animation to webp image (#502) * feat: Support for insert startupify list in order (#506) +* Support for random banners (#510) ## 1.8.0 > Released Jul 26, 2023 From 03adb1199259b4b9fc797b2d993c89294c416350 Mon Sep 17 00:00:00 2001 From: DevelopmentCool2449 <163072436+DevelopmentCool2449@users.noreply.github.com> Date: Mon, 18 Mar 2024 18:41:47 -0600 Subject: [PATCH 36/90] Add new hook for dashboard. (#512) * New hook dashboard.el * Update README.org * Update dashboard.el * Update dashboard.el * Update README.org * Update dashboard.el --- README.org | 4 ++-- dashboard.el | 6 ++++++ 2 files changed, 8 insertions(+), 2 deletions(-) diff --git a/README.org b/README.org index 05e4b66..0125926 100644 --- a/README.org +++ b/README.org @@ -257,12 +257,12 @@ To customize it and customize its icon; To use it with [[https://github.com/hlissner/emacs-solaire-mode][solaire-mode]]: #+begin_src emacs-lisp - (add-hook 'dashboard-after-initialize-hook #'solaire-mode) + (add-hook 'dashboard-before-initialize-hook #'solaire-mode) #+end_src Or for use-package users #+begin_src emacs-lisp - :hook (dashboard-after-initialize . solaire-mode) + :hook (dashboard-before-initialize . solaire-mode) #+end_src To use it with [[https://github.com/ericdanan/counsel-projectile][counsel-projectile]] or [[https://github.com/bbatsov/persp-projectile][persp-projectile]] diff --git a/dashboard.el b/dashboard.el index 42df1af..28332c3 100644 --- a/dashboard.el +++ b/dashboard.el @@ -81,6 +81,11 @@ map) "Keymap for dashboard mode.") +(defcustom dashboard-before-initialize-hook nil + "Hook that is run before dashboard buffer is initialized." + :group 'dashboard + :type 'hook) + (defcustom dashboard-after-initialize-hook nil "Hook that is run after dashboard buffer is initialized." :group 'dashboard @@ -491,6 +496,7 @@ See `dashboard-item-generators' for all items available." (setq recentf-list (dashboard-subseq recentf-list dashboard-num-recents))) (dashboard--with-buffer (when (or dashboard-force-refresh (not (eq major-mode 'dashboard-mode))) + (run-hooks 'dashboard-before-initialize-hook) (erase-buffer) (setq dashboard--section-starts nil) From e34ce1b4730fb88a33a571b9065114b7a77645f0 Mon Sep 17 00:00:00 2001 From: JenChieh Date: Tue, 19 Mar 2024 02:15:40 -0700 Subject: [PATCH 37/90] fix: compile warnings from org-time-less-p --- dashboard-widgets.el | 19 +++++++++---------- 1 file changed, 9 insertions(+), 10 deletions(-) diff --git a/dashboard-widgets.el b/dashboard-widgets.el index 2fc9c3e..2664a17 100644 --- a/dashboard-widgets.el +++ b/dashboard-widgets.el @@ -59,7 +59,6 @@ (declare-function org-time-string-to-time "ext:org.el") (declare-function org-today "ext:org.el") (declare-function recentf-cleanup "ext:recentf.el") -(defalias 'org-time-less-p 'time-less-p) (defvar org-level-faces) (defvar org-agenda-new-buffers) (defvar org-agenda-prefix-format) @@ -824,9 +823,9 @@ Argument IMAGE-PATH path to the image." (defun dashboard-insert-init-info () "Insert init info." (let ((init-info (if (functionp dashboard-init-info) - (funcall dashboard-init-info) - dashboard-init-info))) - (dashboard-insert-center (propertize init-info 'face 'font-lock-comment-face)))) + (funcall dashboard-init-info) + dashboard-init-info))) + (dashboard-insert-center (propertize init-info 'face 'font-lock-comment-face)))) (defun dashboard-insert-navigator () "Insert Navigator of the dashboard." @@ -1414,12 +1413,12 @@ point." (unless (and (not (org-entry-is-done-p)) (not (org-in-archived-heading-p)) (or (and scheduled-time - (org-time-less-p scheduled-time due-date)) + (time-less-p scheduled-time due-date)) (and deadline-time - (org-time-less-p deadline-time due-date)) + (time-less-p deadline-time due-date)) (and entry-timestamp - (org-time-less-p now entry-timestamp) - (org-time-less-p entry-timestamp due-date)))) + (time-less-p now entry-timestamp) + (time-less-p entry-timestamp due-date)))) (point)))) (defun dashboard-filter-agenda-by-todo () @@ -1492,8 +1491,8 @@ found for the strategy it uses nil predicate." (cl-case strategy (`priority-up '>) (`priority-down '<) - (`time-up 'org-time-less-p) - (`time-down (lambda (a b) (org-time-less-p b a))) + (`time-up 'time-less-p) + (`time-down (lambda (a b) (time-less-p b a))) (`todo-state-up '>) (`todo-state-down '<))) From 8e9dc077d3ddce3ded5b101c530d756fa3275577 Mon Sep 17 00:00:00 2001 From: nibek <48153699+nibek@users.noreply.github.com> Date: Wed, 20 Mar 2024 18:18:11 +0100 Subject: [PATCH 38/90] Fix type of `dashboard-items` and `dashboard-item-shortcuts`. (#514) --- dashboard-widgets.el | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/dashboard-widgets.el b/dashboard-widgets.el index 2664a17..ce27a89 100644 --- a/dashboard-widgets.el +++ b/dashboard-widgets.el @@ -411,7 +411,7 @@ installed." Will be of the form `(list-type . list-size)'. If nil it is disabled. Possible values for list-type are: `recents' `bookmarks' `projects' `agenda' `registers'." - :type '(repeat (alist :key-type symbol :value-type integer)) + :type '(alist :key-type symbol :value-type integer) :group 'dashboard) (defcustom dashboard-item-shortcuts @@ -423,8 +423,8 @@ If nil it is disabled. Possible values for list-type are: "Association list of items and their corresponding shortcuts. Will be of the form `(list-type . keys)' as understood by `(kbd keys)'. If nil, shortcuts are disabled. If an entry's value is nil, that item's -shortcut is disbaled. See `dashboard-items' for possible values of list-type.'" - :type '(repeat (alist :key-type symbol :value-type string)) +shortcut is disabled. See `dashboard-items' for possible values of list-type.'" + :type '(alist :key-type symbol :value-type string) :group 'dashboard) (defcustom dashboard-item-names nil From 5922254b7c6b011823037348b8bf6204fcdcf287 Mon Sep 17 00:00:00 2001 From: JenChieh Date: Thu, 21 Mar 2024 15:09:06 -0700 Subject: [PATCH 39/90] fix: Revert the deprecated variables so it can be reidrect --- dashboard-widgets.el | 30 +++++++++++++++++++++--------- 1 file changed, 21 insertions(+), 9 deletions(-) diff --git a/dashboard-widgets.el b/dashboard-widgets.el index ce27a89..5a0f005 100644 --- a/dashboard-widgets.el +++ b/dashboard-widgets.el @@ -70,15 +70,6 @@ (declare-function string-pixel-width "subr-x.el") ; TODO: remove this after 29.1 (declare-function shr-string-pixel-width "shr.el") ; TODO: remove this after 29.1 -(make-obsolete-variable 'dashboard-set-navigator - 'dashboard-startupify-list "1.9.0") - -(make-obsolete-variable 'dashboard-set-init-info - 'dashboard-startupify-list "1.9.0") - -(make-obsolete-variable 'dashboard-set-footer - 'dashboard-startupify-list "1.9.0") - (defvar recentf-list nil) (defvar dashboard-buffer-name) @@ -133,6 +124,27 @@ See `create-image' and Info node `(elisp)Image Descriptors'." :type 'boolean :group 'dashboard) +(defcustom dashboard-set-navigator nil + "When non nil, a navigator will be displayed under the banner." + :type 'boolean + :group 'dashboard) +(make-obsolete-variable 'dashboard-set-navigator + 'dashboard-startupify-list "1.9.0") + +(defcustom dashboard-set-init-info t + "When non nil, init info will be displayed under the banner." + :type 'boolean + :group 'dashboard) +(make-obsolete-variable 'dashboard-set-init-info + 'dashboard-startupify-list "1.9.0") + +(defcustom dashboard-set-footer t + "When non nil, a footer will be displayed at the bottom." + :type 'boolean + :group 'dashboard) +(make-obsolete-variable 'dashboard-set-footer + 'dashboard-startupify-list "1.9.0") + (defcustom dashboard-footer-messages '("The one true editor, Emacs!" "Who the hell uses VIM anyway? Go Evil!" From 5efddb672a9f71df58255e257a932da27dfe06fe Mon Sep 17 00:00:00 2001 From: JenChieh Date: Thu, 21 Mar 2024 16:36:00 -0700 Subject: [PATCH 40/90] chore: Simplify let in current section --- dashboard.el | 22 +++++++++++----------- 1 file changed, 11 insertions(+), 11 deletions(-) diff --git a/dashboard.el b/dashboard.el index 28332c3..cb1d3d4 100644 --- a/dashboard.el +++ b/dashboard.el @@ -132,7 +132,7 @@ dashboard-insert-items dashboard-insert-newline dashboard-insert-footer) - "List of dashboard widgets (in order) to insert in dashboard buffer. + "List of dashboard widgets (in order) to insert in dashboard buffer. Avalaible functions: `dashboard-insert-newline' `dashboard-insert-page-break' @@ -191,16 +191,16 @@ example: (save-excursion (if-let* ((sep (dashboard--separator)) ((and (search-backward sep nil t) - (search-forward sep nil t)))) - (let ((ln (thing-at-point 'line))) - (cond ((string-match-p "Recent Files:" ln) 'recents) - ((string-match-p "Bookmarks:" ln) 'bookmarks) - ((string-match-p "Projects:" ln) 'projects) - ((string-match-p "Agenda for " ln) 'agenda) - ((string-match-p "Registers:" ln) 'registers) - ((string-match-p "List Directories:" ln) 'ls-directories) - ((string-match-p "List Files:" ln) 'ls-files) - (t (user-error "Unknown section from dashboard")))) + (search-forward sep nil t))) + (ln (thing-at-point 'line t))) + (cond ((string-match-p "Recent Files:" ln) 'recents) + ((string-match-p "Bookmarks:" ln) 'bookmarks) + ((string-match-p "Projects:" ln) 'projects) + ((string-match-p "Agenda for " ln) 'agenda) + ((string-match-p "Registers:" ln) 'registers) + ((string-match-p "List Directories:" ln) 'ls-directories) + ((string-match-p "List Files:" ln) 'ls-files) + (t (user-error "Unknown section from dashboard"))) (user-error "Failed searching dashboard section")))) ;; From 750a92ac6a2495062f19db21dd1fde477d2dabd8 Mon Sep 17 00:00:00 2001 From: DevelopmentCool2449 <163072436+DevelopmentCool2449@users.noreply.github.com> Date: Thu, 21 Mar 2024 21:20:43 -0600 Subject: [PATCH 41/90] Fixes to dashboard banner. (#517) * Fixes * Update dashboard-widgets.el * Update dashboard-widgets.el --- dashboard-widgets.el | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/dashboard-widgets.el b/dashboard-widgets.el index 5a0f005..4abe634 100644 --- a/dashboard-widgets.el +++ b/dashboard-widgets.el @@ -727,7 +727,9 @@ If MESSAGEBUF is not nil then MSG is also written in message buffer." (list :text (dashboard-get-banner-path 1))))) ((and (pred listp) - (pred (lambda (c) (not (proper-list-p c)))) + (pred (lambda (c) + (and (not (proper-list-p c)) + (not (null c))))) `(,img . ,txt)) (list :image (if (dashboard--image-supported-p img) img @@ -737,12 +739,16 @@ If MESSAGEBUF is not nil then MSG is also written in message buffer." txt (message "could not find banner %s, use default instead" txt) (dashboard-get-banner-path 1)))) - ((pred proper-list-p) + ((and + (pred proper-list-p) + (pred (lambda (l) (not (null l))))) + (let* ((max (length banner)) (choose (nth (random max) banner))) (dashboard-choose-banner choose))) (_ - (message "unsupported banner config %s" banner)))) + (user-error "Unsupported banner type: `%s'" banner) + nil))) (defun dashboard--image-animated-p (image-path) "Return if image is a gif or webp. From 7d6f886fd89357300d96e8b866cd88e94c421b95 Mon Sep 17 00:00:00 2001 From: DevelopmentCool2449 <163072436+DevelopmentCool2449@users.noreply.github.com> Date: Thu, 21 Mar 2024 21:38:58 -0600 Subject: [PATCH 42/90] Support for arguments in dashboard-startupify-list and add FAQ (#513) * Update dashboard.el * Update dashboard-widgets.el * Update dashboard-widgets.el * Add how to hide modeline in README.org * Update README.org * Update README.org * Add FAQ.org * Update README.org * Update FAQ.org * Use make-string instead dotimes in insert-newline * Update insert-startupify-lists * Update insert-newline * Update FAQ.org * Fix erros * Fixes * Fixes to insert-startupify * Update dashboard.el --- FAQ.org | 97 ++++++++++++++++++++++++++++++++++++++++++++ README.org | 52 +----------------------- dashboard-widgets.el | 13 ++++-- dashboard.el | 17 ++++++-- 4 files changed, 121 insertions(+), 58 deletions(-) create mode 100644 FAQ.org diff --git a/FAQ.org b/FAQ.org new file mode 100644 index 0000000..0bd98f0 --- /dev/null +++ b/FAQ.org @@ -0,0 +1,97 @@ +* Frequently Asked Questions + +** /How can i hide modeline in dashboard?/ + +You can add this to your config: + #+begin_src emacs-lisp + (add-hook 'dashboard-mode-hook (lambda () (setq-local mode-line-format nil))) + #+end_src + You can also use [[https://github.com/hlissner/emacs-hide-mode-line][hide-mode-line]]: +#+begin_src elisp + (add-hook 'dashboard-mode-hook #'hide-mode-line-mode) + ;; Or for use-package + (use-package hide-mode-line + :hook (dashboard-mode . hide-mode-line-mode) + ...) +#+end_src +For doom-modeline users you may use this: +#+begin_src elisp + (add-to-list 'doom-modeline-mode-alist '(dashboard-mode)) +#+end_src + +** /How can i use [[https://github.com/hlissner/emacs-solaire-mode][solaire-mode]] with dashboard?/ + +Add this to your config: +#+begin_src emacs-lisp + (add-hook 'dashboard-before-initialize-hook #'solaire-mode) + ;; Or if you prefer use-package + (use-package solaire-mode + :hook (dashboard-before-initialize . solaire-mode) + ...) +#+end_src + + +** /How can i add my custom widget?/ + +To add your own custom widget is pretty easy, define your widget's callback function and add it to `dashboard-items` as such: +#+BEGIN_SRC elisp + (defun dashboard-insert-custom (list-size) + (insert "Custom text")) + (add-to-list 'dashboard-item-generators '(custom . dashboard-insert-custom)) + (add-to-list 'dashboard-items '(custom) t) +#+END_SRC + +If you want to add an icon to a custom widget, insert it with `dashboard-insert-heading` in your custom function: +#+BEGIN_SRC elisp + ;; In this example, there is an icon but no shortcut + ;; see `dashboard-insert-heading' for more details. + (defun dashboard-insert-custom (list-size) + (dashboard-insert-heading "News:" + nil + (all-the-icons-faicon "newspaper-o" + :height 1.2 + :v-adjust 0.0 + :face 'dashboard-heading)) + (insert "\n") + (insert " Custom text")) +#+END_SRC + + +** Items length is too high How can i change it +You can change dashboard-items-default-length amount: +#+BEGIN_SRC elisp + (setq dashboard-items-default-length 20) +#+END_SRC + + +** /I don't like banner, init info or even items, How can i delete them from dashboard?/ + +You can delete them from ~dashboard-startupify-list~. +#+begin_src emacs-lisp + (setq dashboard-startupify-list '(dashboard-insert-banner-title + dashboard-insert-navigator + ,(dashboard-insert-newline 2) + dashboard-insert-footer)) +#+end_src + +** /How can i change my init message?/ + +You can customize it like this: +#+BEGIN_SRC elisp + (setq dashboard-init-info "This is an init message!") +#+END_SRC + +** /How can i change footer messages?/ + +You can customize it like this: +#+BEGIN_SRC elisp + (setq dashboard-footer-messages '("Dashboard is pretty cool!")) +#+END_SRC +If you want to change its icon you may use this: +#+BEGIN_SRC elisp + (setq dashboard-footer-icon (all-the-icons-octicon "dashboard" + :height 1.1 + :v-adjust -0.05 + :face 'font-lock-keyword-face)) +#+END_SRC + diff --git a/README.org b/README.org index 0125926..cd525e0 100644 --- a/README.org +++ b/README.org @@ -167,32 +167,6 @@ To modify the widget heading name: ("Agenda for the coming week:" . "Agenda:"))) #+END_SRC -The default length for each item. -#+BEGIN_SRC elisp - (setq dashboard-items-default-length 20) -#+END_SRC - -To add your own custom widget is pretty easy, define your widget's callback function and add it to `dashboard-items` as such: -#+BEGIN_SRC elisp - (defun dashboard-insert-custom (list-size) - (insert "Custom text")) - (add-to-list 'dashboard-item-generators '(custom . dashboard-insert-custom)) - (add-to-list 'dashboard-items '(custom) t) -#+END_SRC - -To add an icon to a custom widget, insert it with `dashboard-insert-heading` in your custom function. In this example, there is an icon but no shortcut. -#+BEGIN_SRC elisp - (defun dashboard-insert-custom (list-size) - (dashboard-insert-heading "News:" - nil - (all-the-icons-faicon "newspaper-o" - :height 1.2 - :v-adjust 0.0 - :face 'dashboard-heading)) - (insert "\n") - (insert " Custom text")) -#+END_SRC - To use ~all-the-icons~ package: #+BEGIN_SRC emacs-lisp (setq dashboard-icon-type 'all-the-icons) ; use `all-the-icons' package @@ -241,30 +215,6 @@ To customize the buttons of the navigator like this: ("⚑" nil "Show flags" (lambda (&rest _) (message "flag")) error)))) #+END_SRC -Also, the message can be customized like this: -#+BEGIN_SRC elisp - (setq dashboard-init-info "This is an init message!") -#+END_SRC - -To customize it and customize its icon; -#+BEGIN_SRC elisp - (setq dashboard-footer-messages '("Dashboard is pretty cool!")) - (setq dashboard-footer-icon (all-the-icons-octicon "dashboard" - :height 1.1 - :v-adjust -0.05 - :face 'font-lock-keyword-face)) -#+END_SRC - -To use it with [[https://github.com/hlissner/emacs-solaire-mode][solaire-mode]]: -#+begin_src emacs-lisp - (add-hook 'dashboard-before-initialize-hook #'solaire-mode) -#+end_src - -Or for use-package users -#+begin_src emacs-lisp - :hook (dashboard-before-initialize . solaire-mode) -#+end_src - To use it with [[https://github.com/ericdanan/counsel-projectile][counsel-projectile]] or [[https://github.com/bbatsov/persp-projectile][persp-projectile]] #+begin_src elisp @@ -340,6 +290,8 @@ receives the tags directly from ~org-get-tags~. By default tags set the variable to ~ignore~: ~(setq dashboard-agenda-tags-format 'ignore)~ or to ~nil~. +** [[./FAQ.org][FAQ]] + ** Faces It is possible to customize Dashboard's appearance using the following faces: diff --git a/dashboard-widgets.el b/dashboard-widgets.el index 4abe634..41181a9 100644 --- a/dashboard-widgets.el +++ b/dashboard-widgets.el @@ -423,7 +423,9 @@ installed." Will be of the form `(list-type . list-size)'. If nil it is disabled. Possible values for list-type are: `recents' `bookmarks' `projects' `agenda' `registers'." - :type '(alist :key-type symbol :value-type integer) + :type '(repeat (choice + symbol + (cons symbol integer))) :group 'dashboard) (defcustom dashboard-item-shortcuts @@ -611,9 +613,12 @@ If MESSAGEBUF is not nil then MSG is also written in message buffer." "Insert a page break line in dashboard buffer." (dashboard-append dashboard-page-separator)) -(defun dashboard-insert-newline (&optional n) - "Insert N times of newlines." - (dotimes (_ (or n 1)) +(defun dashboard-insert-newline (&optional times) + "When called without an argument, insert a newline. +When called with TIMES return a function that insert TIMES number of newlines." + (if times + (lambda () + (insert (make-string times (string-to-char "\n") t))) (insert "\n"))) (defun dashboard-insert-heading (heading &optional shortcut icon) diff --git a/dashboard.el b/dashboard.el index cb1d3d4..15183f4 100644 --- a/dashboard.el +++ b/dashboard.el @@ -143,10 +143,15 @@ Avalaible functions: `dashboard-insert-items' `dashboard-insert-footer' -You can also add your custom function or a lambda to the list. +It must be a function or a cons cell where specify function and +its arg. + +Also you can add your custom function or a lambda to the list. example: (lambda () (delete-char -1))" - :type '(repeat function) + :type '(repeat (choice + function + (cons function sexp))) :group 'dashboard) (defcustom dashboard-navigation-cycle nil @@ -500,8 +505,12 @@ See `dashboard-item-generators' for all items available." (erase-buffer) (setq dashboard--section-starts nil) - (mapc (lambda (fn) - (funcall fn)) + (mapc (lambda (entry) + (if (and (listp entry) + (not (eq (car entry) 'closure)) + (not (eq (car entry) 'lambda))) + (apply (car entry) (cdr entry)) + (funcall entry))) dashboard-startupify-list) (when dashboard-vertically-center-content From 05b4b1a7bc5ec5d0fca5ee6cd6a2099107c47b15 Mon Sep 17 00:00:00 2001 From: JenChieh Date: Thu, 21 Mar 2024 20:40:32 -0700 Subject: [PATCH 43/90] chore: Fix indentation --- dashboard-widgets.el | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/dashboard-widgets.el b/dashboard-widgets.el index 41181a9..b28c099 100644 --- a/dashboard-widgets.el +++ b/dashboard-widgets.el @@ -733,8 +733,8 @@ When called with TIMES return a function that insert TIMES number of newlines." ((and (pred listp) (pred (lambda (c) - (and (not (proper-list-p c)) - (not (null c))))) + (and (not (proper-list-p c)) + (not (null c))))) `(,img . ,txt)) (list :image (if (dashboard--image-supported-p img) img From d15bffc858085c80875843619356727302cf10af Mon Sep 17 00:00:00 2001 From: DevelopmentCool2449 <163072436+DevelopmentCool2449@users.noreply.github.com> Date: Mon, 25 Mar 2024 15:11:55 -0600 Subject: [PATCH 44/90] Make dashboard-buffer-name an user option (#518) --- FAQ.org | 5 +++++ README.org | 2 +- dashboard.el | 6 ++++-- 3 files changed, 10 insertions(+), 3 deletions(-) diff --git a/FAQ.org b/FAQ.org index 0bd98f0..0d6d685 100644 --- a/FAQ.org +++ b/FAQ.org @@ -63,6 +63,11 @@ You can change dashboard-items-default-length amount: (setq dashboard-items-default-length 20) #+END_SRC +** /How can i change dashboard buffer name?/ +You can change it with ~dashboard-buffer-name~ +#+begin_src emacs-lisp + (setq dashboard-buffer-name "*my dashboard*") +#+end_src ** /I don't like banner, init info or even items, How can i delete them from dashboard?/ diff --git a/README.org b/README.org index cd525e0..3f31246 100644 --- a/README.org +++ b/README.org @@ -82,7 +82,7 @@ In addition to the above, configure =initial-buffer-choice= to show Dashboard in frames created with =emacsclient -c= as follows: #+BEGIN_SRC elisp - (setq initial-buffer-choice (lambda () (get-buffer-create "*dashboard*"))) + (setq initial-buffer-choice (lambda () (get-buffer-create dashboard-buffer-name))) #+END_SRC * Configuration diff --git a/dashboard.el b/dashboard.el index 15183f4..7bea68f 100644 --- a/dashboard.el +++ b/dashboard.el @@ -159,8 +159,10 @@ example: :type 'boolean :group 'dashboard) -(defconst dashboard-buffer-name "*dashboard*" - "Dashboard's buffer name.") +(defcustom dashboard-buffer-name "*dashboard*" + "Dashboard's buffer name." + :type 'string + :group 'dashboard) (defvar dashboard-force-refresh nil "If non-nil, force refresh dashboard buffer.") From 6c6c08ac22054c044f0e908cb02def2ba290347b Mon Sep 17 00:00:00 2001 From: DevelopmentCool2449 <163072436+DevelopmentCool2449@users.noreply.github.com> Date: Mon, 25 Mar 2024 21:32:08 -0600 Subject: [PATCH 45/90] Support for random footer icon (#519) * Support for random icon footer * Update FAQ.org --- FAQ.org | 1 + dashboard-widgets.el | 13 ++++++++++--- 2 files changed, 11 insertions(+), 3 deletions(-) diff --git a/FAQ.org b/FAQ.org index 0d6d685..2b00700 100644 --- a/FAQ.org +++ b/FAQ.org @@ -98,5 +98,6 @@ If you want to change its icon you may use this: :height 1.1 :v-adjust -0.05 :face 'font-lock-keyword-face)) +Also it can be a string list for display random footer icons. #+END_SRC diff --git a/dashboard-widgets.el b/dashboard-widgets.el index b28c099..a10dfa7 100644 --- a/dashboard-widgets.el +++ b/dashboard-widgets.el @@ -347,8 +347,10 @@ ARGS should be a plist containing `:height', `:v-adjust', or `:face' properties. :v-adjust -0.05 :face 'dashboard-footer-icon-face))) (propertize ">" 'face 'dashboard-footer-icon-face)) - "Footer's icon." - :type 'string + "Footer's icon. +It can be a string or a string list for display random icons." + :type '(choice string + (repeat string)) :group 'dashboard) (defcustom dashboard-heading-shorcut-format " (%s)" @@ -954,7 +956,12 @@ to widget creation." (defun dashboard-insert-footer () "Insert footer of dashboard." (when-let ((footer (dashboard-random-footer)) - (footer-icon (dashboard-replace-displayable dashboard-footer-icon))) + (footer-icon + (if (listp dashboard-footer-icon) + (dashboard-replace-displayable + (nth (random (length dashboard-footer-icon)) + dashboard-footer-icon)) + (dashboard-replace-displayable dashboard-footer-icon)))) (dashboard-insert-center (if (string-empty-p footer-icon) footer-icon (concat footer-icon " ")) From 68f6273386ed92637dfece8b5d6d9860e1c505d7 Mon Sep 17 00:00:00 2001 From: Jen-Chieh Shen Date: Mon, 25 Mar 2024 20:32:36 -0700 Subject: [PATCH 46/90] Update CHANGELOG.md (#520) --- CHANGELOG.md | 1 + 1 file changed, 1 insertion(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 2104d5e..64d52d1 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -15,6 +15,7 @@ Check [Keep a Changelog](http://keepachangelog.com/) for recommendations on how * fix: Adding animation to webp image (#502) * feat: Support for insert startupify list in order (#506) * Support for random banners (#510) +* Support for random footer icon (#519) ## 1.8.0 > Released Jul 26, 2023 From e012e2aaf20f2a73a7b9f23d9cdb893d696e7549 Mon Sep 17 00:00:00 2001 From: JenChieh Date: Mon, 25 Mar 2024 20:44:56 -0700 Subject: [PATCH 47/90] fix: Byte compile warnings --- dashboard-widgets.el | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/dashboard-widgets.el b/dashboard-widgets.el index a10dfa7..00e4fc2 100644 --- a/dashboard-widgets.el +++ b/dashboard-widgets.el @@ -590,7 +590,8 @@ Optionally, provide NO-NEXT-LINE to move the cursor forward a line." `(progn (eval-when-compile (defvar dashboard-mode-map)) (defun ,sym nil - ,(concat "Jump to " name ". This code is dynamically generated in `dashboard-insert-shortcut'.") + ,(concat "Jump to " name ". +This code is dynamically generated in `dashboard-insert-shortcut'.") (interactive) (unless (search-forward ,search-label (point-max) t) (search-backward ,search-label (point-min) t)) @@ -897,7 +898,10 @@ ACTION is theaction taken when the user activates the widget button. WIDGET-PARAMS are passed to the \"widget-create\" function." `(progn (dashboard-insert-heading ,section-name - (if (and ,list ,shortcut-char dashboard-show-shortcuts) ,shortcut-char)) + (when (and ,list + ,shortcut-char + dashboard-show-shortcuts) + ,shortcut-char)) (if ,list (when (and (dashboard-insert-section-list ,section-name @@ -1370,7 +1374,9 @@ Any custom function would receives the tags from `org-get-tags'" (defun dashboard-agenda-entry-format () "Format agenda entry to show it on dashboard. -Also,it set text properties that latter are used to sort entries and perform different actions." + +Also,it set text properties that latter are used to sort entries and perform +different actions." (let* ((scheduled-time (org-get-scheduled-time (point))) (deadline-time (org-get-deadline-time (point))) (entry-timestamp (dashboard-agenda--entry-timestamp (point))) From d0bada389f319ebfc001aaf55ec659cebda6df8a Mon Sep 17 00:00:00 2001 From: DevelopmentCool2449 <163072436+DevelopmentCool2449@users.noreply.github.com> Date: Tue, 26 Mar 2024 18:29:11 -0600 Subject: [PATCH 48/90] Fix #522 (#523) --- dashboard-widgets.el | 16 ++++++++++------ 1 file changed, 10 insertions(+), 6 deletions(-) diff --git a/dashboard-widgets.el b/dashboard-widgets.el index 00e4fc2..708e90b 100644 --- a/dashboard-widgets.el +++ b/dashboard-widgets.el @@ -957,15 +957,19 @@ to widget creation." "Return a random footer from `dashboard-footer-messages'." (nth (random (length dashboard-footer-messages)) dashboard-footer-messages)) +(defun dashboard-footer-icon () + "Return footer icon or a random icon if `dashboard-footer-messages' is a list." + (if (and (not (null dashboard-footer-icon)) + (listp dashboard-footer-icon)) + (dashboard-replace-displayable + (nth (random (length dashboard-footer-icon)) + dashboard-footer-icon)) + (dashboard-replace-displayable dashboard-footer-icon))) + (defun dashboard-insert-footer () "Insert footer of dashboard." (when-let ((footer (dashboard-random-footer)) - (footer-icon - (if (listp dashboard-footer-icon) - (dashboard-replace-displayable - (nth (random (length dashboard-footer-icon)) - dashboard-footer-icon)) - (dashboard-replace-displayable dashboard-footer-icon)))) + (footer-icon (dashboard-footer-icon))) (dashboard-insert-center (if (string-empty-p footer-icon) footer-icon (concat footer-icon " ")) From e1a55a9e14db61d7a91a10bef64a5b07ab7da115 Mon Sep 17 00:00:00 2001 From: JenChieh Date: Tue, 26 Mar 2024 23:06:27 -0700 Subject: [PATCH 49/90] ci: Bump Emacs 29.x to 3 --- .github/workflows/activate.yml | 2 +- .github/workflows/test.yml | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/activate.yml b/.github/workflows/activate.yml index 193c632..96a48e1 100644 --- a/.github/workflows/activate.yml +++ b/.github/workflows/activate.yml @@ -23,7 +23,7 @@ jobs: - 26.3 - 27.2 - 28.2 - - 29.2 + - 29.3 experimental: [false] include: - os: ubuntu-latest diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index a8dd866..6e80e19 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -23,7 +23,7 @@ jobs: - 26.3 - 27.2 - 28.2 - - 29.2 + - 29.3 experimental: [false] include: - os: ubuntu-latest From db54bb2b427390cb9479ceef4dba859484479dac Mon Sep 17 00:00:00 2001 From: JenChieh Date: Wed, 27 Mar 2024 21:33:50 -0700 Subject: [PATCH 50/90] docs: Move FAQ to docs --- README.org | 4 +- FAQ.org => docs/FAQ.org | 206 ++++++++++++++++++++-------------------- 2 files changed, 106 insertions(+), 104 deletions(-) rename FAQ.org => docs/FAQ.org (97%) diff --git a/README.org b/README.org index 3f31246..fdb8f6d 100644 --- a/README.org +++ b/README.org @@ -290,7 +290,9 @@ receives the tags directly from ~org-get-tags~. By default tags set the variable to ~ignore~: ~(setq dashboard-agenda-tags-format 'ignore)~ or to ~nil~. -** [[./FAQ.org][FAQ]] +** FAQ + +Check out our [[./docs/FAQ.org][Frequently Asked Questions]]. ** Faces diff --git a/FAQ.org b/docs/FAQ.org similarity index 97% rename from FAQ.org rename to docs/FAQ.org index 2b00700..6e74df5 100644 --- a/FAQ.org +++ b/docs/FAQ.org @@ -1,103 +1,103 @@ -* Frequently Asked Questions - -** /How can i hide modeline in dashboard?/ - -You can add this to your config: - #+begin_src emacs-lisp - (add-hook 'dashboard-mode-hook (lambda () (setq-local mode-line-format nil))) - #+end_src - You can also use [[https://github.com/hlissner/emacs-hide-mode-line][hide-mode-line]]: -#+begin_src elisp - (add-hook 'dashboard-mode-hook #'hide-mode-line-mode) - ;; Or for use-package - (use-package hide-mode-line - :hook (dashboard-mode . hide-mode-line-mode) - ...) -#+end_src -For doom-modeline users you may use this: -#+begin_src elisp - (add-to-list 'doom-modeline-mode-alist '(dashboard-mode)) -#+end_src - -** /How can i use [[https://github.com/hlissner/emacs-solaire-mode][solaire-mode]] with dashboard?/ - -Add this to your config: -#+begin_src emacs-lisp - (add-hook 'dashboard-before-initialize-hook #'solaire-mode) - ;; Or if you prefer use-package - (use-package solaire-mode - :hook (dashboard-before-initialize . solaire-mode) - ...) -#+end_src - - -** /How can i add my custom widget?/ - -To add your own custom widget is pretty easy, define your widget's callback function and add it to `dashboard-items` as such: -#+BEGIN_SRC elisp - (defun dashboard-insert-custom (list-size) - (insert "Custom text")) - (add-to-list 'dashboard-item-generators '(custom . dashboard-insert-custom)) - (add-to-list 'dashboard-items '(custom) t) -#+END_SRC - -If you want to add an icon to a custom widget, insert it with `dashboard-insert-heading` in your custom function: -#+BEGIN_SRC elisp - ;; In this example, there is an icon but no shortcut - ;; see `dashboard-insert-heading' for more details. - (defun dashboard-insert-custom (list-size) - (dashboard-insert-heading "News:" - nil - (all-the-icons-faicon "newspaper-o" - :height 1.2 - :v-adjust 0.0 - :face 'dashboard-heading)) - (insert "\n") - (insert " Custom text")) -#+END_SRC - - -** Items length is too high How can i change it -You can change dashboard-items-default-length amount: -#+BEGIN_SRC elisp - (setq dashboard-items-default-length 20) -#+END_SRC - -** /How can i change dashboard buffer name?/ -You can change it with ~dashboard-buffer-name~ -#+begin_src emacs-lisp - (setq dashboard-buffer-name "*my dashboard*") -#+end_src - -** /I don't like banner, init info or even items, How can i delete them from dashboard?/ - -You can delete them from ~dashboard-startupify-list~. -#+begin_src emacs-lisp - (setq dashboard-startupify-list '(dashboard-insert-banner-title - dashboard-insert-navigator - ,(dashboard-insert-newline 2) - dashboard-insert-footer)) -#+end_src - -** /How can i change my init message?/ - -You can customize it like this: -#+BEGIN_SRC elisp - (setq dashboard-init-info "This is an init message!") -#+END_SRC - -** /How can i change footer messages?/ - -You can customize it like this: -#+BEGIN_SRC elisp - (setq dashboard-footer-messages '("Dashboard is pretty cool!")) -#+END_SRC -If you want to change its icon you may use this: -#+BEGIN_SRC elisp - (setq dashboard-footer-icon (all-the-icons-octicon "dashboard" - :height 1.1 - :v-adjust -0.05 - :face 'font-lock-keyword-face)) -Also it can be a string list for display random footer icons. -#+END_SRC - +* Frequently Asked Questions + +** /How can i hide modeline in dashboard?/ + +You can add this to your config: + #+begin_src emacs-lisp + (add-hook 'dashboard-mode-hook (lambda () (setq-local mode-line-format nil))) + #+end_src + You can also use [[https://github.com/hlissner/emacs-hide-mode-line][hide-mode-line]]: +#+begin_src elisp + (add-hook 'dashboard-mode-hook #'hide-mode-line-mode) + ;; Or for use-package + (use-package hide-mode-line + :hook (dashboard-mode . hide-mode-line-mode) + ...) +#+end_src +For doom-modeline users you may use this: +#+begin_src elisp + (add-to-list 'doom-modeline-mode-alist '(dashboard-mode)) +#+end_src + +** /How can i use [[https://github.com/hlissner/emacs-solaire-mode][solaire-mode]] with dashboard?/ + +Add this to your config: +#+begin_src emacs-lisp + (add-hook 'dashboard-before-initialize-hook #'solaire-mode) + ;; Or if you prefer use-package + (use-package solaire-mode + :hook (dashboard-before-initialize . solaire-mode) + ...) +#+end_src + + +** /How can i add my custom widget?/ + +To add your own custom widget is pretty easy, define your widget's callback function and add it to `dashboard-items` as such: +#+BEGIN_SRC elisp + (defun dashboard-insert-custom (list-size) + (insert "Custom text")) + (add-to-list 'dashboard-item-generators '(custom . dashboard-insert-custom)) + (add-to-list 'dashboard-items '(custom) t) +#+END_SRC + +If you want to add an icon to a custom widget, insert it with `dashboard-insert-heading` in your custom function: +#+BEGIN_SRC elisp + ;; In this example, there is an icon but no shortcut + ;; see `dashboard-insert-heading' for more details. + (defun dashboard-insert-custom (list-size) + (dashboard-insert-heading "News:" + nil + (all-the-icons-faicon "newspaper-o" + :height 1.2 + :v-adjust 0.0 + :face 'dashboard-heading)) + (insert "\n") + (insert " Custom text")) +#+END_SRC + + +** Items length is too high How can i change it +You can change dashboard-items-default-length amount: +#+BEGIN_SRC elisp + (setq dashboard-items-default-length 20) +#+END_SRC + +** /How can i change dashboard buffer name?/ +You can change it with ~dashboard-buffer-name~ +#+begin_src emacs-lisp + (setq dashboard-buffer-name "*my dashboard*") +#+end_src + +** /I don't like banner, init info or even items, How can i delete them from dashboard?/ + +You can delete them from ~dashboard-startupify-list~. +#+begin_src emacs-lisp + (setq dashboard-startupify-list '(dashboard-insert-banner-title + dashboard-insert-navigator + ,(dashboard-insert-newline 2) + dashboard-insert-footer)) +#+end_src + +** /How can i change my init message?/ + +You can customize it like this: +#+BEGIN_SRC elisp + (setq dashboard-init-info "This is an init message!") +#+END_SRC + +** /How can i change footer messages?/ + +You can customize it like this: +#+BEGIN_SRC elisp + (setq dashboard-footer-messages '("Dashboard is pretty cool!")) +#+END_SRC +If you want to change its icon you may use this: +#+BEGIN_SRC elisp + (setq dashboard-footer-icon (all-the-icons-octicon "dashboard" + :height 1.1 + :v-adjust -0.05 + :face 'font-lock-keyword-face)) +Also it can be a string list for display random footer icons. +#+END_SRC + From 89b42bff4d60fb00ef3d679e2d2289541e5009f6 Mon Sep 17 00:00:00 2001 From: DevelopmentCool2449 <163072436+DevelopmentCool2449@users.noreply.github.com> Date: Sat, 6 Apr 2024 18:12:59 -0600 Subject: [PATCH 51/90] Fix face in insert-navigator (#524) * Fix https://github.com/emacs-dashboard/emacs-dashboard/issues/471 dashboard-replace-displayable doesn't return nerd-icon string due apparently internal-char-font only return non-nil if it is only displayable with current frame font, this is a problem to some user that doesn't using any nerd patched font as default, also due nerd-font can use any character for its icons it's necessary return string if nerd-icons is avalaible. The same applies to all-the-icons This may close: https://github.com/emacs-dashboard/emacs-dashboard/issues/471 and https://github.com/emacs-dashboard/emacs-dashboard/pull/467 * Fix insert-startupify-list failing with cons cells --- dashboard-widgets.el | 14 ++++++++++++-- dashboard.el | 5 ++--- 2 files changed, 14 insertions(+), 5 deletions(-) diff --git a/dashboard-widgets.el b/dashboard-widgets.el index 708e90b..d212cda 100644 --- a/dashboard-widgets.el +++ b/dashboard-widgets.el @@ -257,7 +257,16 @@ The format is: `icon title help action face prefix suffix`. Example: `((\"☆\" \"Star\" \"Show stars\" (lambda (&rest _) (show-stars)) warning \"[\" \"]\"))" - :type '(repeat (repeat (list string string string function symbol string string))) + :type '(repeat (repeat (list string + string + string + function + (choice face + (repeat :tag "Anonymous face" sexp)) + (choice string + (const nil)) + (choice string + (const nil))))) :group 'dashboard) (defcustom dashboard-init-info @@ -876,7 +885,8 @@ Argument IMAGE-PATH path to the image." (when (and icon title (not (string-equal icon "")) (not (string-equal title ""))) - (propertize " " 'face 'variable-pitch)) + (propertize " " 'face `(:inherit (variable-pitch + ,face)))) (when title (propertize title 'face face))) :help-echo help :action action diff --git a/dashboard.el b/dashboard.el index 7bea68f..1bc7f24 100644 --- a/dashboard.el +++ b/dashboard.el @@ -509,9 +509,8 @@ See `dashboard-item-generators' for all items available." (mapc (lambda (entry) (if (and (listp entry) - (not (eq (car entry) 'closure)) - (not (eq (car entry) 'lambda))) - (apply (car entry) (cdr entry)) + (not (functionp entry))) + (apply (car entry) `(,(cdr entry))) (funcall entry))) dashboard-startupify-list) From 263f9f1760b8303955c03ccc3c509692075af019 Mon Sep 17 00:00:00 2001 From: DevelopmentCool2449 <163072436+DevelopmentCool2449@users.noreply.github.com> Date: Sat, 6 Apr 2024 21:24:12 -0600 Subject: [PATCH 52/90] Add new entry to FAQ.org (#525) * Fix https://github.com/emacs-dashboard/emacs-dashboard/issues/471 dashboard-replace-displayable doesn't return nerd-icon string due apparently internal-char-font only return non-nil if it is only displayable with current frame font, this is a problem to some user that doesn't using any nerd patched font as default, also due nerd-font can use any character for its icons it's necessary return string if nerd-icons is avalaible. The same applies to all-the-icons This may close: https://github.com/emacs-dashboard/emacs-dashboard/issues/471 and https://github.com/emacs-dashboard/emacs-dashboard/pull/467 * Fix insert-startupify-list failing with cons cells * Add new entry to FAQ.org Due Windows port doesn't handle well with icons in dashboard, I think it's good idea add a new entry into FAQ file about How to fix this issue. I've also improve it a little. --- docs/FAQ.org | 31 ++++++++++++++++++++++--------- 1 file changed, 22 insertions(+), 9 deletions(-) diff --git a/docs/FAQ.org b/docs/FAQ.org index 6e74df5..040a445 100644 --- a/docs/FAQ.org +++ b/docs/FAQ.org @@ -1,6 +1,6 @@ -* Frequently Asked Questions +#+title: Frequently Asked Questions -** /How can i hide modeline in dashboard?/ +* /How can i hide modeline in dashboard?/ You can add this to your config: #+begin_src emacs-lisp @@ -19,7 +19,20 @@ For doom-modeline users you may use this: (add-to-list 'doom-modeline-mode-alist '(dashboard-mode)) #+end_src -** /How can i use [[https://github.com/hlissner/emacs-solaire-mode][solaire-mode]] with dashboard?/ +* /Icons doesn't display in Windows GUI, How can i fix it?/ +Emacs Windows port doesn't handle well icons. + +For *nerd-icons* you can use *patched nerd fonts* found in their official +website [[https://www.nerdfonts.com/font-downloads]]. + +Otherwise you can use *UTF-8* coding system, putting this line into +your =early-init.el= +#+begin_src emacs-lisp + (if (eq system-type 'windows-nt) + (prefer-coding-system 'utf-8)) +#+end_src + +* /How can i use [[https://github.com/hlissner/emacs-solaire-mode][solaire-mode]] with dashboard?/ Add this to your config: #+begin_src emacs-lisp @@ -31,7 +44,7 @@ Add this to your config: #+end_src -** /How can i add my custom widget?/ +* /How can i add my custom widget?/ To add your own custom widget is pretty easy, define your widget's callback function and add it to `dashboard-items` as such: #+BEGIN_SRC elisp @@ -57,19 +70,19 @@ If you want to add an icon to a custom widget, insert it with `dashboard-insert- #+END_SRC -** Items length is too high How can i change it +* Items length is too high How can i change it You can change dashboard-items-default-length amount: #+BEGIN_SRC elisp (setq dashboard-items-default-length 20) #+END_SRC -** /How can i change dashboard buffer name?/ +* /How can i change dashboard buffer name?/ You can change it with ~dashboard-buffer-name~ #+begin_src emacs-lisp (setq dashboard-buffer-name "*my dashboard*") #+end_src -** /I don't like banner, init info or even items, How can i delete them from dashboard?/ +* /I don't like banner, init info or even items, How can i delete them from dashboard?/ You can delete them from ~dashboard-startupify-list~. #+begin_src emacs-lisp @@ -79,14 +92,14 @@ You can delete them from ~dashboard-startupify-list~. dashboard-insert-footer)) #+end_src -** /How can i change my init message?/ +* /How can i change my init message?/ You can customize it like this: #+BEGIN_SRC elisp (setq dashboard-init-info "This is an init message!") #+END_SRC -** /How can i change footer messages?/ +* /How can i change footer messages?/ You can customize it like this: #+BEGIN_SRC elisp From adcb049d91cf11c6a2c0c42c4e2290ec963f4ea2 Mon Sep 17 00:00:00 2001 From: Sebastiaan Speck <12570668+sebastiaanspeck@users.noreply.github.com> Date: Fri, 10 May 2024 23:22:57 +0200 Subject: [PATCH 53/90] docs: Fix styling and grammar (#528) --- docs/FAQ.org | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/docs/FAQ.org b/docs/FAQ.org index 040a445..76c4718 100644 --- a/docs/FAQ.org +++ b/docs/FAQ.org @@ -1,6 +1,6 @@ #+title: Frequently Asked Questions -* /How can i hide modeline in dashboard?/ +* /How can I hide modeline in dashboard?/ You can add this to your config: #+begin_src emacs-lisp @@ -19,7 +19,7 @@ For doom-modeline users you may use this: (add-to-list 'doom-modeline-mode-alist '(dashboard-mode)) #+end_src -* /Icons doesn't display in Windows GUI, How can i fix it?/ +* /Icons doesn't display in Windows GUI, How can I fix it?/ Emacs Windows port doesn't handle well icons. For *nerd-icons* you can use *patched nerd fonts* found in their official @@ -32,7 +32,7 @@ your =early-init.el= (prefer-coding-system 'utf-8)) #+end_src -* /How can i use [[https://github.com/hlissner/emacs-solaire-mode][solaire-mode]] with dashboard?/ +* /How can I use [[https://github.com/hlissner/emacs-solaire-mode][solaire-mode]] with dashboard?/ Add this to your config: #+begin_src emacs-lisp @@ -44,7 +44,7 @@ Add this to your config: #+end_src -* /How can i add my custom widget?/ +* /How can I add my custom widget?/ To add your own custom widget is pretty easy, define your widget's callback function and add it to `dashboard-items` as such: #+BEGIN_SRC elisp @@ -70,19 +70,19 @@ If you want to add an icon to a custom widget, insert it with `dashboard-insert- #+END_SRC -* Items length is too high How can i change it +* /Items length is too high, How can I change it?/ You can change dashboard-items-default-length amount: #+BEGIN_SRC elisp (setq dashboard-items-default-length 20) #+END_SRC -* /How can i change dashboard buffer name?/ +* /How can I change dashboard buffer name?/ You can change it with ~dashboard-buffer-name~ #+begin_src emacs-lisp (setq dashboard-buffer-name "*my dashboard*") #+end_src -* /I don't like banner, init info or even items, How can i delete them from dashboard?/ +* /I don't like banner, init info or even items, How can I delete them from dashboard?/ You can delete them from ~dashboard-startupify-list~. #+begin_src emacs-lisp @@ -92,14 +92,14 @@ You can delete them from ~dashboard-startupify-list~. dashboard-insert-footer)) #+end_src -* /How can i change my init message?/ +* /How can I change my init message?/ You can customize it like this: #+BEGIN_SRC elisp (setq dashboard-init-info "This is an init message!") #+END_SRC -* /How can i change footer messages?/ +* /How can I change footer messages?/ You can customize it like this: #+BEGIN_SRC elisp From 541f6334d94bc78fe0588755e641a146bc563c64 Mon Sep 17 00:00:00 2001 From: JenChieh Date: Fri, 10 May 2024 14:24:56 -0700 Subject: [PATCH 54/90] ci: Exclude tests on macos below 28.x --- .github/workflows/activate.yml | 5 +++++ .github/workflows/test.yml | 5 +++++ 2 files changed, 10 insertions(+) diff --git a/.github/workflows/activate.yml b/.github/workflows/activate.yml index 96a48e1..84d51ac 100644 --- a/.github/workflows/activate.yml +++ b/.github/workflows/activate.yml @@ -35,6 +35,11 @@ jobs: - os: windows-latest emacs-version: snapshot experimental: true + exclude: + - os: macos-latest + emacs-version: 26.3 + - os: macos-latest + emacs-version: 27.2 steps: - uses: actions/checkout@v4 diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 6e80e19..139a491 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -35,6 +35,11 @@ jobs: - os: windows-latest emacs-version: snapshot experimental: true + exclude: + - os: macos-latest + emacs-version: 26.3 + - os: macos-latest + emacs-version: 27.2 steps: - uses: actions/checkout@v4 From 3852301f9c6f3104d9cc98389612b5ef3452a7de Mon Sep 17 00:00:00 2001 From: Ad <144847922+skissue@users.noreply.github.com> Date: Wed, 29 May 2024 16:58:37 -0400 Subject: [PATCH 55/90] fix: custom type for dashboard-heading-icons (#532) The previous type is wrong, as it's for a list of alists, rather than a single alist. --- dashboard-widgets.el | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/dashboard-widgets.el b/dashboard-widgets.el index d212cda..68f6d24 100644 --- a/dashboard-widgets.el +++ b/dashboard-widgets.el @@ -193,7 +193,7 @@ The value can be one of: `all-the-icons', `nerd-icons'." Will be of the form `(list-type . icon-name-string)`. If nil it is disabled. Possible values for list-type are: `recents' `bookmarks' `projects' `agenda' `registers'" - :type '(repeat (alist :key-type symbol :value-type string)) + :type '(alist :key-type symbol :value-type string) :group 'dashboard) (defcustom dashboard-heading-icon-height 1.2 From 46ad9959899f2e86d03f7850820ad6a6b8aa3ad0 Mon Sep 17 00:00:00 2001 From: JenChieh Date: Sun, 21 Jul 2024 00:31:56 -0700 Subject: [PATCH 56/90] ci: Test Emacs 29.4 --- .github/workflows/activate.yml | 2 +- .github/workflows/test.yml | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/activate.yml b/.github/workflows/activate.yml index 84d51ac..b18111c 100644 --- a/.github/workflows/activate.yml +++ b/.github/workflows/activate.yml @@ -23,7 +23,7 @@ jobs: - 26.3 - 27.2 - 28.2 - - 29.3 + - 29.4 experimental: [false] include: - os: ubuntu-latest diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 139a491..28927e8 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -23,7 +23,7 @@ jobs: - 26.3 - 27.2 - 28.2 - - 29.3 + - 29.4 experimental: [false] include: - os: ubuntu-latest From 187699e2d80f6a3b0ec7b2fb2e1d7ece2712208f Mon Sep 17 00:00:00 2001 From: Elijah Gabe <163072436+DevelopmentCool2449@users.noreply.github.com> Date: Tue, 13 Aug 2024 02:38:18 -0600 Subject: [PATCH 57/90] Allow propertized ascii banner text (#537) --- dashboard-widgets.el | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/dashboard-widgets.el b/dashboard-widgets.el index 68f6d24..89c0649 100644 --- a/dashboard-widgets.el +++ b/dashboard-widgets.el @@ -795,7 +795,8 @@ Argument IMAGE-PATH path to the image." (if (file-exists-p txt) (insert-file-contents txt) (save-excursion (insert txt))) - (put-text-property (point) (point-max) 'face 'dashboard-text-banner) + (unless (text-properties-at 0 txt) + (put-text-property (point) (point-max) 'face 'dashboard-text-banner)) (setq text-width 0) (while (not (eobp)) (let ((line-length (- (line-end-position) (line-beginning-position)))) From c9d2dda2cd75e9f6d05be0e52fb126f63e6e7430 Mon Sep 17 00:00:00 2001 From: SpringerJack <46654987+SpringerJack@users.noreply.github.com> Date: Fri, 23 Aug 2024 17:29:48 +0200 Subject: [PATCH 58/90] Fix vertical offset for centering (#538) --- dashboard.el | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/dashboard.el b/dashboard.el index 1bc7f24..f880e6c 100644 --- a/dashboard.el +++ b/dashboard.el @@ -516,7 +516,9 @@ See `dashboard-item-generators' for all items available." (when dashboard-vertically-center-content (goto-char (point-min)) - (when-let* ((content-height (cdr (window-absolute-pixel-position (point-max)))) + (when-let* ((start-height (cdr (window-absolute-pixel-position (point-min)))) + (end-height (cdr (window-absolute-pixel-position (point-max)))) + (content-height (- end-height start-height)) (vertical-padding (floor (/ (- (window-pixel-height) content-height) 2))) ((> vertical-padding 0)) (vertical-lines (1- (floor (/ vertical-padding (line-pixel-height))))) From 6257b4afbd10f1238783b05df4067d8325c67c14 Mon Sep 17 00:00:00 2001 From: heraplem Date: Sun, 22 Sep 2024 10:10:05 -0700 Subject: [PATCH 59/90] Fix sorting by priority in agenda (#544) --- dashboard-widgets.el | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/dashboard-widgets.el b/dashboard-widgets.el index 89c0649..ad0ad36 100644 --- a/dashboard-widgets.el +++ b/dashboard-widgets.el @@ -1403,7 +1403,7 @@ different actions." (org-get-category) (dashboard-agenda--formatted-tags))) (todo-state (org-get-todo-state)) - (item-priority (org-get-priority (org-get-heading t t t t))) + (item-priority (org-get-priority (org-get-heading t t nil t))) (todo-index (and todo-state (length (member todo-state org-todo-keywords-1)))) (entry-data (list 'dashboard-agenda-file (buffer-file-name) From c9058228d11ed08b840b2324bb8e0a4c948e59e3 Mon Sep 17 00:00:00 2001 From: Ricardo Arredondo Date: Fri, 6 Sep 2024 04:09:25 -0600 Subject: [PATCH 60/90] Fix #490 by replacing links in headlines with its description. --- dashboard-widgets.el | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/dashboard-widgets.el b/dashboard-widgets.el index ad0ad36..0545c7a 100644 --- a/dashboard-widgets.el +++ b/dashboard-widgets.el @@ -53,6 +53,7 @@ (declare-function org-get-todo-face "ext:org.el") (declare-function org-get-todo-state "ext:org.el") (declare-function org-in-archived-heading-p "ext:org.el") +(declare-function org-link-display-format "ext:org.el") (declare-function org-map-entries "ext:org.el") (declare-function org-outline-level "ext:org.el") (declare-function org-release-buffers "ext:org.el") @@ -1421,7 +1422,7 @@ different actions." (defun dashboard-agenda--formatted-headline () "Set agenda faces to `HEADLINE' when face text property is nil." - (let* ((headline (org-get-heading t t t t)) + (let* ((headline (org-link-display-format (org-get-heading t t t t))) (todo (or (org-get-todo-state) "")) (org-level-face (nth (- (org-outline-level) 1) org-level-faces)) (todo-state (format org-agenda-todo-keyword-format todo))) From b44e9df6ab9c9c8907b644f32e2abf4eda8cce86 Mon Sep 17 00:00:00 2001 From: Ricardo Arredondo Date: Sun, 22 Sep 2024 10:53:55 -0600 Subject: [PATCH 61/90] Feature: Dashboard agenda action. --- dashboard-widgets.el | 24 ++++++++++++++++++++---- 1 file changed, 20 insertions(+), 4 deletions(-) diff --git a/dashboard-widgets.el b/dashboard-widgets.el index 0545c7a..155a4fb 100644 --- a/dashboard-widgets.el +++ b/dashboard-widgets.el @@ -215,6 +215,10 @@ If nil it is disabled. Possible values for list-type are: :type 'string :group 'dashboard) +(defcustom dashboard-agenda-action 'dashboard-agenda--visit-file-other-window + "Function to call when dashboard make an action over agenda item." + :type 'function) + (defcustom dashboard-remote-path-icon (pcase dashboard-icon-type ('all-the-icons (all-the-icons-octicon "radio-tower" :height 1.0 :v-adjust 0.01)) @@ -1569,6 +1573,19 @@ to compare." ((null arg2) t) (t (apply predicate (list arg1 arg2)))))) +(defun dashboard-agenda--visit-file (file point) + "Action on agenda-entry that visit a FILE at POINT." + (let ((buffer (find-file-noselect file))) + (with-current-buffer buffer + (goto-char point) + (switch-to-buffer buffer) + (recenter-top-bottom)))) + +(defun dashboard-agenda--visit-file-other-window (file point) + "Visit FILE at POINT of an agenda item in other window." + (let ((buffer (find-file-other-window file))) + (with-current-buffer buffer (goto-char point) (recenter-top-bottom)))) + (defun dashboard-insert-agenda (list-size) "Add the list of LIST-SIZE items of agenda." (require 'org-agenda) @@ -1581,10 +1598,9 @@ to compare." 'agenda (dashboard-get-shortcut 'agenda) `(lambda (&rest _) - (let ((buffer (find-file-other-window (get-text-property 0 'dashboard-agenda-file ,el)))) - (with-current-buffer buffer - (goto-char (get-text-property 0 'dashboard-agenda-loc ,el)) - (switch-to-buffer buffer)))) + (let ((file (get-text-property 0 'dashboard-agenda-file ,el)) + (point (get-text-property 0 'dashboard-agenda-loc ,el))) + (funcall dashboard-agenda-action file point))) (format "%s" el))) ;; From 946b9957470a3cac6b089bdf2d9edd07a29fcc9c Mon Sep 17 00:00:00 2001 From: Jen-Chieh Shen Date: Mon, 23 Sep 2024 16:45:33 -0700 Subject: [PATCH 62/90] fix: Compile warning (#545) --- dashboard-widgets.el | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/dashboard-widgets.el b/dashboard-widgets.el index 155a4fb..7be0371 100644 --- a/dashboard-widgets.el +++ b/dashboard-widgets.el @@ -217,7 +217,8 @@ If nil it is disabled. Possible values for list-type are: (defcustom dashboard-agenda-action 'dashboard-agenda--visit-file-other-window "Function to call when dashboard make an action over agenda item." - :type 'function) + :type 'function + :group 'dashboard) (defcustom dashboard-remote-path-icon (pcase dashboard-icon-type From 9479466d39652a8e32b74ee83822421fa08024d9 Mon Sep 17 00:00:00 2001 From: Jen-Chieh Shen Date: Thu, 21 Nov 2024 04:30:18 +0800 Subject: [PATCH 63/90] fix: Compile warnings in Emacs 31 --- dashboard-widgets.el | 22 +++++++++++----------- 1 file changed, 11 insertions(+), 11 deletions(-) diff --git a/dashboard-widgets.el b/dashboard-widgets.el index 7be0371..d3e4655 100644 --- a/dashboard-widgets.el +++ b/dashboard-widgets.el @@ -156,7 +156,7 @@ See `create-image' and Info node `(elisp)Image Descriptors'." "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 + :type '(list string) :group 'dashboard) (defcustom dashboard-icon-type (and (or dashboard-set-heading-icons @@ -788,7 +788,7 @@ Argument IMAGE-PATH path to the image." (defun dashboard-insert-banner () "Insert the banner at the top of the dashboard." (goto-char (point-max)) - (when-let ((banner (dashboard-choose-banner dashboard-startup-banner))) + (when-let* ((banner (dashboard-choose-banner dashboard-startup-banner))) (insert "\n") (let ((start (point)) buffer-read-only @@ -797,7 +797,7 @@ Argument IMAGE-PATH path to the image." (graphic-mode (display-graphic-p))) (when graphic-mode (insert "\n")) ;; If specified, insert a text banner. - (when-let ((txt (plist-get banner :text))) + (when-let* ((txt (plist-get banner :text))) (if (file-exists-p txt) (insert-file-contents txt) (save-excursion (insert txt))) @@ -811,7 +811,7 @@ Argument IMAGE-PATH path to the image." (forward-line 1))) ;; If specified, insert an image banner. When displayed in a graphical frame, this will ;; replace the text banner. - (when-let ((img (plist-get banner :image))) + (when-let* ((img (plist-get banner :image))) (let ((img-props (append (when (> dashboard-image-banner-max-width 0) (list :max-width dashboard-image-banner-max-width)) @@ -893,7 +893,7 @@ Argument IMAGE-PATH path to the image." (not (string-equal icon "")) (not (string-equal title ""))) (propertize " " 'face `(:inherit (variable-pitch - ,face)))) + ,face)))) (when title (propertize title 'face face))) :help-echo help :action action @@ -985,8 +985,8 @@ to widget creation." (defun dashboard-insert-footer () "Insert footer of dashboard." - (when-let ((footer (dashboard-random-footer)) - (footer-icon (dashboard-footer-icon))) + (when-let* ((footer (dashboard-random-footer)) + (footer-icon (dashboard-footer-icon))) (dashboard-insert-center (if (string-empty-p footer-icon) footer-icon (concat footer-icon " ")) @@ -1422,7 +1422,7 @@ different actions." (defun dashboard-agenda--entry-timestamp (point) "Get the timestamp from an entry at POINT." - (when-let ((timestamp (org-entry-get point "TIMESTAMP"))) + (when-let* ((timestamp (org-entry-get point "TIMESTAMP"))) (org-time-string-to-time timestamp))) (defun dashboard-agenda--formatted-headline () @@ -1443,8 +1443,8 @@ If not height is found on FACE or `dashboard-items-face' use `default'." (defun dashboard-agenda--formatted-time () "Get the scheduled or dead time of an entry. If no time is found return nil." - (when-let ((time (or (org-get-scheduled-time (point)) (org-get-deadline-time (point)) - (dashboard-agenda--entry-timestamp (point))))) + (when-let* ((time (or (org-get-scheduled-time (point)) (org-get-deadline-time (point)) + (dashboard-agenda--entry-timestamp (point))))) (format-time-string dashboard-agenda-time-string-format time))) (defun dashboard-agenda--formatted-tags () @@ -1493,7 +1493,7 @@ if returns a point." (defun dashboard-get-agenda () "Get agenda items for today or for a week from now." - (if-let ((prefix-format (assoc 'dashboard-agenda org-agenda-prefix-format))) + (if-let* ((prefix-format (assoc 'dashboard-agenda org-agenda-prefix-format))) (setcdr prefix-format dashboard-agenda-prefix-format) (push (cons 'dashboard-agenda dashboard-agenda-prefix-format) org-agenda-prefix-format)) (org-compile-prefix-format 'dashboard-agenda) From 2be75c0ab87a6279ea9840f7c043f7605788d6fb Mon Sep 17 00:00:00 2001 From: Ricardo Arredondo <839303+ricardoricho@users.noreply.github.com> Date: Sat, 7 Dec 2024 11:02:35 -0600 Subject: [PATCH 64/90] Fix vertically-center. (#547) Dashboard-open use dashboard--with-buffer and switch to it before inserting the startupify list. Remove dashboard-force-refresh and pass it as optional argument to force-refresh the buffer. --- dashboard.el | 42 +++++++++++++++++++++--------------------- 1 file changed, 21 insertions(+), 21 deletions(-) diff --git a/dashboard.el b/dashboard.el index f880e6c..8e21bf5 100644 --- a/dashboard.el +++ b/dashboard.el @@ -164,9 +164,6 @@ example: :type 'string :group 'dashboard) -(defvar dashboard-force-refresh nil - "If non-nil, force refresh dashboard buffer.") - (defvar dashboard--section-starts nil "List of section starting positions.") @@ -492,8 +489,8 @@ See `dashboard-item-generators' for all items available." (insert "\n") (insert dashboard-page-separator))) -(defun dashboard-insert-startupify-lists () - "Insert the list of widgets into the buffer." +(defun dashboard-insert-startupify-lists (&optional force-refresh) + "Insert the list of widgets into the buffer, FORCE-REFRESH is optional." (interactive) (let ((inhibit-redisplay t) (recentf-is-on (recentf-enabled-p)) @@ -502,7 +499,7 @@ See `dashboard-item-generators' for all items available." (when recentf-is-on (setq recentf-list (dashboard-subseq recentf-list dashboard-num-recents))) (dashboard--with-buffer - (when (or dashboard-force-refresh (not (eq major-mode 'dashboard-mode))) + (when (or force-refresh (not (eq major-mode 'dashboard-mode))) (run-hooks 'dashboard-before-initialize-hook) (erase-buffer) (setq dashboard--section-starts nil) @@ -513,29 +510,32 @@ See `dashboard-item-generators' for all items available." (apply (car entry) `(,(cdr entry))) (funcall entry))) dashboard-startupify-list) - - (when dashboard-vertically-center-content - (goto-char (point-min)) - (when-let* ((start-height (cdr (window-absolute-pixel-position (point-min)))) - (end-height (cdr (window-absolute-pixel-position (point-max)))) - (content-height (- end-height start-height)) - (vertical-padding (floor (/ (- (window-pixel-height) content-height) 2))) - ((> vertical-padding 0)) - (vertical-lines (1- (floor (/ vertical-padding (line-pixel-height))))) - ((> vertical-lines 0))) - (insert (make-string vertical-lines ?\n)))) - - (goto-char (point-min)) + (dashboard-vertically-center) (dashboard-mode))) (when recentf-is-on (setq recentf-list origial-recentf-list)))) +(defun dashboard-vertically-center () + "Center vertically the content of dashboard. Always go to point-min char." + (when-let* (dashboard-vertically-center-content + (start-height (cdr (window-absolute-pixel-position (point-min)))) + (end-height (cdr (window-absolute-pixel-position (point-max)))) + (content-height (- end-height start-height)) + (vertical-padding (floor (/ (- (window-pixel-height) content-height) 2))) + ((> vertical-padding 0)) + (vertical-lines (1- (floor (/ vertical-padding (line-pixel-height))))) + ((> vertical-lines 0))) + (goto-char (point-min)) + (insert (make-string vertical-lines ?\n))) + (goto-char (point-min))) + ;;;###autoload (defun dashboard-open (&rest _) "Open (or refresh) the *dashboard* buffer." (interactive) - (let ((dashboard-force-refresh t)) (dashboard-insert-startupify-lists)) - (switch-to-buffer dashboard-buffer-name)) + (dashboard--with-buffer + (switch-to-buffer (current-buffer)) + (dashboard-insert-startupify-lists t))) (defalias #'dashboard-refresh-buffer #'dashboard-open) From 47f2080d017ced2f9ad5458678ddadcaa5416855 Mon Sep 17 00:00:00 2001 From: winkelnp <68015877+winkelnp@users.noreply.github.com> Date: Sat, 7 Dec 2024 18:19:38 +0100 Subject: [PATCH 65/90] correct cons option dashboard-startup-banner in README (#552) --- README.org | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.org b/README.org index fdb8f6d..8632dcc 100644 --- a/README.org +++ b/README.org @@ -103,7 +103,7 @@ To update the banner or banner title ;; currently supported types are gif/image/text/xbm. ;; - a cons of 2 strings which specifies the path of an image to use ;; and other path of a text file to use if image isn't supported. - ;; ("path/to/image/file/image.png" . "path/to/text/file/text.txt"). + ;; (cons "path/to/image/file/image.png" "path/to/text/file/text.txt"). ;; - a list that can display an random banner, ;; supported values are: string (filepath), 'official, 'logo and integers. From 697e5d9fedafa2e612c4274ec3b288bdd9dc8ecc Mon Sep 17 00:00:00 2001 From: NicoloZorzetto <56208253+NicoloZorzetto@users.noreply.github.com> Date: Wed, 11 Dec 2024 04:59:43 +0100 Subject: [PATCH 66/90] small typo in dashboard-path-shorten-string (#553) --- dashboard-widgets.el | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/dashboard-widgets.el b/dashboard-widgets.el index d3e4655..1b44d21 100644 --- a/dashboard-widgets.el +++ b/dashboard-widgets.el @@ -488,7 +488,7 @@ Set to nil for unbounded." :group 'dashboard) (defcustom dashboard-path-shorten-string "..." - "String the that displays in the center of the path." + "Shorten the string that displays in the center of the path." :type 'string :group 'dashboard) From 0492db29bbd58fcc932af584c5ebca37a0cea16f Mon Sep 17 00:00:00 2001 From: Jen-Chieh Shen Date: Wed, 11 Dec 2024 20:33:50 +0800 Subject: [PATCH 67/90] feat: Use built-in truncate-string-ellipsis (#555) * feat: Use built-in truncate-string-ellipsis * fix compile --- dashboard-widgets.el | 36 ++++++++++++++++++++++-------------- 1 file changed, 22 insertions(+), 14 deletions(-) diff --git a/dashboard-widgets.el b/dashboard-widgets.el index 1b44d21..f816d5d 100644 --- a/dashboard-widgets.el +++ b/dashboard-widgets.el @@ -15,6 +15,7 @@ (require 'cl-lib) (require 'image) +(require 'mule-util) (require 'subr-x) ;; @@ -71,8 +72,9 @@ (declare-function string-pixel-width "subr-x.el") ; TODO: remove this after 29.1 (declare-function shr-string-pixel-width "shr.el") ; TODO: remove this after 29.1 +(defvar truncate-string-ellipsis) +(declare-function truncate-string-ellipsis "mule-util.el") ; TODO: remove this after 28.1 (defvar recentf-list nil) - (defvar dashboard-buffer-name) ;; @@ -463,8 +465,12 @@ shortcut is disabled. See `dashboard-items' for possible values of list-type.'" When an item is nil or not present, the default name is used. Will be of the form `(default-name . new-name)'." :type '(alist :key-type string :value-type string) - :options '("Recent Files:" "Bookmarks:" "Agenda for today:" - "Agenda for the coming week:" "Registers:" "Projects:") + :options '("Recent Files:" + "Bookmarks:" + "Agenda for today:" + "Agenda for the coming week:" + "Registers:" + "Projects:") :group 'dashboard) (defcustom dashboard-items-default-length 20 @@ -487,11 +493,6 @@ Set to nil for unbounded." :type 'integer :group 'dashboard) -(defcustom dashboard-path-shorten-string "..." - "Shorten the string that displays in the center of the path." - :type 'string - :group 'dashboard) - ;; ;;; Faces @@ -1014,22 +1015,29 @@ to widget creation." "Return directory name from PATH." (file-name-nondirectory (directory-file-name (file-name-directory path)))) +(defun dashboard-truncate-string-ellipsis () + "Return the string used to indicate truncation." + (if (fboundp 'truncate-string-ellipsis) + (truncate-string-ellipsis) + (or truncate-string-ellipsis + "..."))) + (defun dashboard-shorten-path-beginning (path) "Shorten PATH from beginning if exceeding maximum length." (let* ((len-path (length path)) (slen-path (dashboard-str-len path)) - (len-rep (dashboard-str-len dashboard-path-shorten-string)) + (len-rep (dashboard-str-len (dashboard-truncate-string-ellipsis))) (len-total (- dashboard-path-max-length len-rep)) front) (if (<= slen-path dashboard-path-max-length) path (setq front (ignore-errors (substring path (- slen-path len-total) len-path))) - (if front (concat dashboard-path-shorten-string front) "")))) + (if front (concat (dashboard-truncate-string-ellipsis) front) "")))) (defun dashboard-shorten-path-middle (path) "Shorten PATH from middle if exceeding maximum length." (let* ((len-path (length path)) (slen-path (dashboard-str-len path)) - (len-rep (dashboard-str-len dashboard-path-shorten-string)) + (len-rep (dashboard-str-len (dashboard-truncate-string-ellipsis))) (len-total (- dashboard-path-max-length len-rep)) (center (/ len-total 2)) (end-back center) @@ -1038,20 +1046,20 @@ to widget creation." (if (<= slen-path dashboard-path-max-length) path (setq back (substring path 0 end-back) front (ignore-errors (substring path start-front len-path))) - (if front (concat back dashboard-path-shorten-string front) "")))) + (if front (concat back (dashboard-truncate-string-ellipsis) front) "")))) (defun dashboard-shorten-path-end (path) "Shorten PATH from end if exceeding maximum length." (let* ((len-path (length path)) (slen-path (dashboard-str-len path)) - (len-rep (dashboard-str-len dashboard-path-shorten-string)) + (len-rep (dashboard-str-len (dashboard-truncate-string-ellipsis))) (diff (- slen-path len-path)) (len-total (- dashboard-path-max-length len-rep diff)) back) (if (<= slen-path dashboard-path-max-length) path (setq back (ignore-errors (substring path 0 len-total))) (if (and back (< 0 dashboard-path-max-length)) - (concat back dashboard-path-shorten-string) "")))) + (concat back (dashboard-truncate-string-ellipsis)) "")))) (defun dashboard--get-base-length (path type) "Return the length of the base from the PATH by TYPE." From da658d5fb4a430462dcc711a2368d20072ddc512 Mon Sep 17 00:00:00 2001 From: Jen-Chieh Shen Date: Wed, 11 Dec 2024 20:45:24 +0800 Subject: [PATCH 68/90] feat: Drop Emacs 26.x support (#556) --- .github/workflows/activate.yml | 3 --- .github/workflows/test.yml | 3 --- Eask | 6 +++++- dashboard.el | 2 +- 4 files changed, 6 insertions(+), 8 deletions(-) diff --git a/.github/workflows/activate.yml b/.github/workflows/activate.yml index b18111c..246e03e 100644 --- a/.github/workflows/activate.yml +++ b/.github/workflows/activate.yml @@ -20,7 +20,6 @@ jobs: matrix: os: [ubuntu-latest, macos-latest, windows-latest] emacs-version: - - 26.3 - 27.2 - 28.2 - 29.4 @@ -36,8 +35,6 @@ jobs: emacs-version: snapshot experimental: true exclude: - - os: macos-latest - emacs-version: 26.3 - os: macos-latest emacs-version: 27.2 diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 28927e8..6f489ab 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -20,7 +20,6 @@ jobs: matrix: os: [ubuntu-latest, macos-latest, windows-latest] emacs-version: - - 26.3 - 27.2 - 28.2 - 29.4 @@ -36,8 +35,6 @@ jobs: emacs-version: snapshot experimental: true exclude: - - os: macos-latest - emacs-version: 26.3 - os: macos-latest emacs-version: 27.2 diff --git a/Eask b/Eask index f75244d..a5ecafb 100644 --- a/Eask +++ b/Eask @@ -13,10 +13,14 @@ (source "gnu") (source "melpa") -(depends-on "emacs" "26.1") +(depends-on "emacs" "27.1") (development (depends-on "elisp-lint") (depends-on "page-break-lines")) (setq network-security-level 'low) ; see https://github.com/jcs090218/setup-emacs-windows/issues/156#issuecomment-932956432 + +(add-hook 'eask-before-compile-hook + (lambda (&rest _) + (setq byte-compile-error-on-warn t))) diff --git a/dashboard.el b/dashboard.el index 8e21bf5..404b0dc 100644 --- a/dashboard.el +++ b/dashboard.el @@ -14,7 +14,7 @@ ;; Created: October 05, 2016 ;; Package-Version: 1.9.0-SNAPSHOT ;; Keywords: startup, screen, tools, dashboard -;; Package-Requires: ((emacs "26.1")) +;; Package-Requires: ((emacs "27.1")) ;;; Commentary: ;; An extensible Emacs dashboard, with sections for From 3e89ff658c582fce62380f658ddec72a641ded30 Mon Sep 17 00:00:00 2001 From: nicolo Date: Mon, 23 Dec 2024 21:30:44 +0100 Subject: [PATCH 69/90] Fixed dashboard-previous-section docstring --- dashboard.el | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/dashboard.el b/dashboard.el index 404b0dc..1714112 100644 --- a/dashboard.el +++ b/dashboard.el @@ -211,7 +211,7 @@ example: ;;; Navigation (defun dashboard-previous-section () - "Navigate forward to next section." + "Navigate backwards to previous section." (interactive) (let* ((items-len (1- (length dashboard-items))) (first-item (car (nth 0 dashboard-items))) From e04bc3067179410e8174e4f84f224a8f8f92a6c9 Mon Sep 17 00:00:00 2001 From: nicolo Date: Mon, 23 Dec 2024 21:33:09 +0100 Subject: [PATCH 70/90] Created dashboard-cycle-section-forward and dashboard-cycle-section-backward functions --- dashboard.el | 30 ++++++++++++++++++++++++++++++ 1 file changed, 30 insertions(+) diff --git a/dashboard.el b/dashboard.el index 1714112..7119478 100644 --- a/dashboard.el +++ b/dashboard.el @@ -267,6 +267,36 @@ example: (when (and items-pg (< items-id items-len)) (dashboard--goto-line items-pg)))) +(defun dashboard-cycle-section-forward (&optional section) + "Cycle forward through the entries in SECTION. +If SECTION is nil, cycle in the current section." + (let ((target-section (or section (dashboard--current-section)))) + (if target-section + (condition-case nil + (progn + (widget-forward 1) + (unless (eq target-section (dashboard--current-section)) + (dashboard--goto-section target-section))) + (widget-forward 1)) + (widget-forward 1)))) + +(defun dashboard-cycle-section-backward (&optional section) + "Cycle backward through the entries in SECTION. +If SECTION is nil, cycle in the current section." + (let ((target-section (or section (dashboard--current-section)))) + (if target-section + (condition-case nil + (progn + (widget-backward 1) + (unless (eq target-section (dashboard--current-section)) + (progn + (dashboard--goto-section target-section) + (while (eq target-section (dashboard--current-section)) + (widget-forward 1)) + (widget-backward 1)))) + (widget-backward 1)) + (widget-backward 1)))) + (defun dashboard-section-1 () "Navigate to section 1." (interactive) (dashboard--goto-section-by-index 1)) (defun dashboard-section-2 () From da2eb29b592b37d10f51ad2fc109cf41bc480734 Mon Sep 17 00:00:00 2001 From: nicolo Date: Mon, 23 Dec 2024 21:35:03 +0100 Subject: [PATCH 71/90] Created full documentation for variables and functions --- README.org | 1 + variables-and-functions.org | 124 ++++++++++++++++++++++++++++++++++++ 2 files changed, 125 insertions(+) create mode 100644 variables-and-functions.org diff --git a/README.org b/README.org index 8632dcc..2a469c9 100644 --- a/README.org +++ b/README.org @@ -227,6 +227,7 @@ Or (setq dashboard-projects-switch-function 'projectile-persp-switch-project) #+end_src +Please check the [[./variables-and-functions.org][complete list of variables and functions]]. ** Org mode’s agenda To display today’s agenda items on the dashboard, add ~agenda~ to ~dashboard-items~: diff --git a/variables-and-functions.org b/variables-and-functions.org new file mode 100644 index 0000000..7edc88d --- /dev/null +++ b/variables-and-functions.org @@ -0,0 +1,124 @@ +** Variables +These are the variables available to users out of the box: +| **Variable** | **Description** | **Possible States** | +|------------------------------------|----------------------------------------------------------------------------------|---------------------------------------------------------------------------------------------------------| +| `dashboard-navigation-cycle` | Enable cycling through sections in navigation. | `t`: Enable, `nil`: Disable | +| `dashboard-items` | Specify sections to display and their lengths. | List of `(section . count)` pairs (e.g., `((recents . 5) (bookmarks . 5) (projects . 5))`) | +| `dashboard-startup-banner` | Define the banner at the top of the dashboard. | `'official`, path to an image, or `nil` | +| `dashboard-banner-logo-title` | Text to display below the banner. | Any string (e.g., `"Welcome to Emacs!"`) | +| `dashboard-center-content` | Center the content horizontally. | `t`: Enable, `nil`: Disable | +| `dashboard-vertically-center-content` | Center the content vertically. | `t`: Enable, `nil`: Disable | +| `dashboard-page-separator` | String used to separate sections in the buffer. | Any string (default: `"\n\n"`) | +| `dashboard-set-heading-icons` | Show icons next to section headings. | `t`: Enable, `nil`: Disable | +| `dashboard-set-file-icons` | Show icons next to items. | `t`: Enable, `nil`: Disable | +| `dashboard-heading-icons` | Icons to use for section headings. | Alist of `(section . icon-name)` pairs (e.g., `((recents . "history") (bookmarks . "bookmark"))`) | +| `dashboard-icon-type` | Icon style used for headings and items. | `'all-the-icons`, `'ascii`, `nil` | +| `dashboard-recentf-show-base` | Control how recentf entries are displayed. | `'Respect format`, `'hide`, `'absolute`, `'expand`, `'truncate-middle` | +| `dashboard-recentf-item-format` | Format string for displaying recentf items. | Any valid format string (e.g., `"%s"`) | +| `dashboard-bookmarks-item-format` | Format string for displaying bookmarks items. | Any valid format string (e.g., `"%s"`) | +| `dashboard-path-style` | How to truncate paths. | `'truncate-beginning`, `'truncate-middle`, `'truncate-end`, `nil` | +| `dashboard-path-max-length` | Maximum length of displayed paths. | Integer (default: `70`) | +| `dashboard-footer` | Footer text to display at the bottom of the dashboard. | Any string (default: `nil`) | +| `dashboard-set-footer` | Enable or disable the footer. | `t`: Enable, `nil`: Disable | +| `dashboard-footer-messages` | List of footer messages to display randomly. | List of strings (e.g., `("Enjoy your Emacs session!" "Type M-x help for help.")`) | +| `dashboard-projects-backend` | Backend used for project integration. | `'projectile`, `'project-el`, or `nil` | +| `dashboard-projects-switch-function` | Function to call when switching projects. | Function (e.g., `projectile-persp-switch-project`) | +| `dashboard-agenda-prefix-format` | Custom format string for agenda items. | Any valid Org-mode prefix format | +| `dashboard-agenda-show-all` | Whether to show all agenda items. | `t`: Enable, `nil`: Disable | +| `dashboard-agenda-files` | Files to include in the agenda section. | List of file paths | +| `dashboard-week-agenda` | Whether to show the weekly agenda. | `t`: Enable, `nil`: Disable | +| `dashboard-projects-switch-project-action` | Action to take when switching projects. | Function (e.g., `'magit-status`) | +| `dashboard-buffer-name` | Name of the dashboard buffer. | Any string (default: `*dashboard*`) | +| `dashboard-before-initialize-hook` | Hook run before initializing the dashboard buffer. | Hook (list of functions) | +| `dashboard-after-initialize-hook` | Hook run after initializing the dashboard buffer. | Hook (list of functions) | + + +Example usage: + +- In plain e-lisp: +#+begin_src emacs-lisp + ;; ... + (setq dashboard-startup-banner 'official) + (setq dashboard-center-content t) + (setq dashboard-banner-logo-title "Welcome back") + (dashboard-setup-startup-hook) +#+end_src + +- With use-package: +#+begin_src emacs-lisp + (use-package dashboard + :ensure t + :init + (setq initial-buffer-choice 'dashboard-open) + :config + (dashboard-setup-startup-hook) + :custom + (dashboard-startup-banner 'official) + (dashboard-center-content t) + (dashboard-banner-logo-title "Welcome back")) +#+end_src +** Functions +These are the variables available to users out of the box: +| **Function** | **Description** | **Arguments** | +|-------------------------------------|-----------------------------------------------------------------------|-------------------------| +| `dashboard-open` | Opens or refreshes the dashboard buffer. | None | +| `dashboard-refresh-buffer` | Alias for `dashboard-open`. | None | +| `dashboard-setup-startup-hook` | Sets up hooks for initializing the dashboard. | None | +| `dashboard-initialize` | Switch to the dashboard buffer and run initialization hooks. | None | +| `dashboard-insert-startupify-lists` | Inserts the dashboard widgets into the buffer. | Optional `force-refresh` | +| `dashboard-next-section` | Navigate forward to the next section in the dashboard. | None | +| `dashboard-previous-section` | Navigate backward to the previous section in the dashboard. | None | +| `dashboard-cycle-section-forward` | Cycle forward through the entries in a specific section. | `section` (optional) | +| `dashboard-cycle-section-backward` | Cycle backward through the entries in a specific section. | `section` (optional) | +| `dashboard-cycle-current-section-forward` | Cycle forward through entries in the current section. | None | +| `dashboard-cycle-current-section-backward` | Cycle backward through entries in the current section. | None | +| `dashboard-remove-item-under` | Remove the current item from the dashboard. | None | +| `dashboard-insert-items` | Insert all configured dashboard items into the buffer. | None | +| `dashboard-insert-banner` | Insert the banner into the dashboard buffer. | None | +| `dashboard-insert-newline` | Insert a newline in the dashboard buffer. | None | +| `dashboard-insert-page-break` | Insert a page break in the dashboard buffer. | None | +| `dashboard-insert-footer` | Insert the footer into the dashboard buffer. | None | +| `dashboard-insert-navigator` | Insert the navigator into the dashboard buffer. | None | +| `dashboard-insert-banner-title` | Insert the banner title into the dashboard buffer. | None | +| `dashboard-insert-init-info` | Insert initialization information into the dashboard buffer. | None | +| `dashboard--current-section` | Return the symbol of the current section in the dashboard. | None | +| `dashboard--goto-section` | Move to a specified section in the dashboard. | `section` | +| `dashboard--goto-section-by-index` | Navigate to a section by its index. | `index` | +| `dashboard--section-lines` | Return a list of line numbers where each section starts. | None | +| `dashboard--current-index` | Return the index of the current section. | `section`, `pos` (optional) | +| `dashboard--section-list` | Return the list of items in a section. | `section` | +| `dashboard--on-path-item-p` | Check if the point is on an item in a path section. | None | +| `dashboard--current-item-in-path` | Return the file path of the current item under point. | None | +| `dashboard--ffap-guesser--adv` | Advice around `ffap-guesser` to guess items under point in the dashboard. | `fnc`, `args` | +| `dashboard-remove-item-recentf` | Remove an item from the recentf section. | None | +| `dashboard-remove-item-bookmarks` | Remove an item from the bookmarks section. | None | +| `dashboard-remove-item-projects` | Remove an item from the projects section. | None | +| `dashboard-remove-item-agenda` | Remove an item from the agenda section. | None | +| `dashboard-remove-item-registers` | Remove an item from the registers section. | None | +| `dashboard-return` | Press the return key on an item in the dashboard. | None | +| `dashboard-mouse-1` | Click an item in the dashboard using mouse-1. | None | +| `dashboard-resize-on-hook` | Re-render the dashboard on window size changes. | Optional `_` | +| `dashboard-vertically-center` | Vertically center the content of the dashboard buffer. | None | + + +Example usage (bindings in this case): + +- In plain e-lisp: +#+begin_src emacs-lisp + ;; Navigate to the next section programmatically + (dashboard-next-section) + + ;; Bind it to a key in the global keymap + (global-set-key (kbd "C-c n") 'dashboard-next-section) +#+end_src + +- With use-package: +#+begin_src emacs-lisp +(use-package dashboard + :ensure t + :config + (dashboard-setup-startup-hook) + ;; Bind in `dashboard-mode-map` for use only in the dashboard - to not disrupt keybidnings in other modes + :bind (:map dashboard-mode-map + ("n" . dashboard-next-section))) +#+end_src From 7c2ada561191f0208136626901e4614e73c6059b Mon Sep 17 00:00:00 2001 From: JenChieh Date: Wed, 1 Jan 2025 00:45:32 -0800 Subject: [PATCH 72/90] Update copyright year --- dashboard-widgets.el | 2 +- dashboard.el | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/dashboard-widgets.el b/dashboard-widgets.el index 7be0371..a29a9a6 100644 --- a/dashboard-widgets.el +++ b/dashboard-widgets.el @@ -1,6 +1,6 @@ ;;; dashboard-widgets.el --- A startup screen extracted from Spacemacs -*- lexical-binding: t -*- -;; Copyright (c) 2016-2024 emacs-dashboard maintainers +;; Copyright (c) 2016-2025 emacs-dashboard maintainers ;; This file is not part of GNU Emacs. ;; diff --git a/dashboard.el b/dashboard.el index f880e6c..c325114 100644 --- a/dashboard.el +++ b/dashboard.el @@ -1,6 +1,6 @@ ;;; dashboard.el --- A startup screen extracted from Spacemacs -*- lexical-binding: t -*- -;; Copyright (c) 2016-2024 emacs-dashboard maintainers +;; Copyright (c) 2016-2025 emacs-dashboard maintainers ;; ;; Author : Rakan Al-Hneiti ;; Maintainer : Jesús Martínez From b8a600b1dfec39e621dd5310ea3494e8a17cb817 Mon Sep 17 00:00:00 2001 From: JenChieh Date: Mon, 10 Feb 2025 16:20:45 -0800 Subject: [PATCH 73/90] ignore ds_store --- .gitignore | 3 +++ 1 file changed, 3 insertions(+) diff --git a/.gitignore b/.gitignore index fd1e6a7..c7e292e 100644 --- a/.gitignore +++ b/.gitignore @@ -13,3 +13,6 @@ dist/ # packaging *-autoloads.el *-pkg.el + +# OS genrated +.DS_Store \ No newline at end of file From ef1cad9f10afc811320b9fa77318455985cf3559 Mon Sep 17 00:00:00 2001 From: JenChieh Date: Mon, 10 Feb 2025 16:21:07 -0800 Subject: [PATCH 74/90] chore: Move external docs to docs folder --- README.org | 2 +- variables-and-functions.org => docs/variables-and-functions.org | 0 2 files changed, 1 insertion(+), 1 deletion(-) rename variables-and-functions.org => docs/variables-and-functions.org (100%) diff --git a/README.org b/README.org index 2a469c9..40674c8 100644 --- a/README.org +++ b/README.org @@ -227,7 +227,7 @@ Or (setq dashboard-projects-switch-function 'projectile-persp-switch-project) #+end_src -Please check the [[./variables-and-functions.org][complete list of variables and functions]]. +Please check the [[./docs/variables-and-functions.org][complete list of variables and functions]]. ** Org mode’s agenda To display today’s agenda items on the dashboard, add ~agenda~ to ~dashboard-items~: diff --git a/variables-and-functions.org b/docs/variables-and-functions.org similarity index 100% rename from variables-and-functions.org rename to docs/variables-and-functions.org From e09056cab7a654755f6f7d3479d5388ad123ce44 Mon Sep 17 00:00:00 2001 From: JenChieh Date: Mon, 10 Feb 2025 16:27:47 -0800 Subject: [PATCH 75/90] chore: Update maintainer list --- dashboard.el | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/dashboard.el b/dashboard.el index cc476d2..545ea97 100644 --- a/dashboard.el +++ b/dashboard.el @@ -3,8 +3,8 @@ ;; Copyright (c) 2016-2025 emacs-dashboard maintainers ;; ;; Author : Rakan Al-Hneiti -;; Maintainer : Jesús Martínez -;; Shen, Jen-Chieh +;; Maintainer : Shen, Jen-Chieh +;; Ricardo Arredondo ;; URL : https://github.com/emacs-dashboard/emacs-dashboard ;; ;; This file is not part of GNU Emacs. @@ -15,6 +15,7 @@ ;; Package-Version: 1.9.0-SNAPSHOT ;; Keywords: startup, screen, tools, dashboard ;; Package-Requires: ((emacs "27.1")) + ;;; Commentary: ;; An extensible Emacs dashboard, with sections for From c417c66011b37307fc61da82b6497cce2d6a9903 Mon Sep 17 00:00:00 2001 From: Jen-Chieh Shen Date: Mon, 10 Feb 2025 16:39:52 -0800 Subject: [PATCH 76/90] docs: Add dev instruction for using Eask --- README.org | 38 ++++++++++++++++++++++++++++++++++++-- 1 file changed, 36 insertions(+), 2 deletions(-) diff --git a/README.org b/README.org index 40674c8..7a6bd03 100644 --- a/README.org +++ b/README.org @@ -359,6 +359,40 @@ This is accomplished with the following steps: make install #+END_SRC -** Prerequisites +Or, you can use [[https://github.com/emacs-eask/cli][Eask]] to set up +the development environment, so there's no need to delete your local ~dashboard~. -* [[https://github.com/emacs-eask/cli][Eask]] +Install all dependencies and development dependencies: + +#+BEGIN_SRC shell + eask install-deps --dev +#+END_SRC + +To test the package's installation: + +#+BEGIN_SRC shell + eask package + eask install +#+END_SRC + +To test compilation: + +#+BEGIN_SRC shell + eask compile +#+END_SRC + +🪧 The following steps are optional, but we recommend you follow these lint results! + +The built-in ~checkdoc~ linter: + +#+BEGIN_SRC shell + eask lint checkdoc +#+END_SRC + +The standard ~package~ linter: + +#+BEGIN_SRC shell + eask lint package +#+END_SRC + +/📝 P.S. For more information, find the Eask manual at https://emacs-eask.github.io/. From 6906bf8288eb017c295d9f28d200f83c09878160 Mon Sep 17 00:00:00 2001 From: Jen-Chieh Shen Date: Mon, 10 Feb 2025 17:24:12 -0800 Subject: [PATCH 77/90] feat: Expose indent spaces (#563) --- dashboard-widgets.el | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/dashboard-widgets.el b/dashboard-widgets.el index 221896c..df60150 100644 --- a/dashboard-widgets.el +++ b/dashboard-widgets.el @@ -16,6 +16,7 @@ (require 'cl-lib) (require 'image) (require 'mule-util) +(require 'rect) (require 'subr-x) ;; @@ -940,7 +941,8 @@ to widget creation." (mapc (lambda (el) (let ((tag ,@rest)) - (insert "\n ") + (insert "\n") + (insert (spaces-string (or standard-indent tab-width 4))) (when (and (dashboard-display-icons-p) dashboard-set-file-icons) From 9adf24569d76e428fb98a562f1f1e087dc9d608d Mon Sep 17 00:00:00 2001 From: Christoffer Arvidsson <26621143+christoffer-arvidsson@users.noreply.github.com> Date: Wed, 12 Feb 2025 20:25:20 +0100 Subject: [PATCH 78/90] feat: Parameters for file icon height and v-adjust (#546) * feat: Parameters for file icon height and v-adjust This commit adds support for tweaking the height and v-adjust of file icons. It aligns with the existing parameters `dashboard-heading-icon-height` and `dashboard-heading-icon-v-adjust`, which work similarly for heading icons. Defaults are set to the previous defaults. * Rename dashboard-file-icon to dashboard-icon-file * Allow tweaking dir/remote icon based on custom variable Enables tweaking the directory/remote icon based on the custom variables `dashboard-icon-file-height` and `dashboard-icon-file-v-adjust`. * Add file icon variables to README Adds a short paragraph on how to tweak the look of file icons to the README. * style: indent error --------- Co-authored-by: JenChieh --- README.org | 8 ++++++++ dashboard-widgets.el | 17 +++++++++++++++-- 2 files changed, 23 insertions(+), 2 deletions(-) diff --git a/README.org b/README.org index 7a6bd03..60a7ac8 100644 --- a/README.org +++ b/README.org @@ -196,6 +196,14 @@ To modify heading icons with another icon from nerd-icons octicons: (bookmarks . "nf-oct-book"))) #+END_SRC +To modify the icon height or vertical adjust: +#+BEGIN_SRC emacs-lisp + (setq dashboard-icon-file-height 1.75) + (setq dashboard-icon-file-v-adjust -0.125) + (setq dashboard-heading-icon-height 1.75) + (setq dashboard-heading-icon-v-adjust -0.125) +#+END_SRC + To customize the buttons of the navigator like this: #+BEGIN_SRC emacs-lisp ;; Format: "(icon title help action face prefix suffix)" diff --git a/dashboard-widgets.el b/dashboard-widgets.el index df60150..a7865bf 100644 --- a/dashboard-widgets.el +++ b/dashboard-widgets.el @@ -210,6 +210,16 @@ If nil it is disabled. Possible values for list-type are: :type 'float :group 'dashboard) +(defcustom dashboard-icon-file-height 1.0 + "The height of the file icons." + :type 'float + :group 'dashboard) + +(defcustom dashboard-icon-file-v-adjust -0.05 + "The v-adjust of the file icons." + :type 'float + :group 'dashboard) + (defcustom dashboard-agenda-item-icon (pcase dashboard-icon-type ('all-the-icons (all-the-icons-octicon "primitive-dot" :height 1.0 :v-adjust 0.01)) @@ -949,7 +959,9 @@ to widget creation." (let* ((path (car (last (split-string ,@rest " - ")))) (icon (if (and (not (file-remote-p path)) (file-directory-p path)) - (dashboard-icon-for-dir path nil "") + (dashboard-icon-for-dir path + :height dashboard-icon-file-height + :v-adjust dashboard-icon-file-v-adjust) (cond ((or (string-equal ,section-name "Agenda for today:") (string-equal ,section-name "Agenda for the coming week:")) @@ -957,7 +969,8 @@ to widget creation." ((file-remote-p path) dashboard-remote-path-icon) (t (dashboard-icon-for-file (file-name-nondirectory path) - :v-adjust -0.05)))))) + :height dashboard-icon-file-height + :v-adjust dashboard-icon-file-v-adjust)))))) (setq tag (concat icon " " ,@rest)))) (widget-create 'item From 0a0c123f073fbfd10e420b13dbcb9023569bbeb0 Mon Sep 17 00:00:00 2001 From: Jen-Chieh Shen Date: Wed, 12 Feb 2025 11:26:27 -0800 Subject: [PATCH 79/90] chore: Changelog for #546 --- CHANGELOG.md | 1 + 1 file changed, 1 insertion(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 64d52d1..8483241 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -16,6 +16,7 @@ Check [Keep a Changelog](http://keepachangelog.com/) for recommendations on how * feat: Support for insert startupify list in order (#506) * Support for random banners (#510) * Support for random footer icon (#519) +* feat: Parameters for file icon `height` and `v-adjust` (#546) ## 1.8.0 > Released Jul 26, 2023 From 264706e2d595bd298b7718c5755eff1655189db1 Mon Sep 17 00:00:00 2001 From: Jen-Chieh Shen Date: Mon, 24 Feb 2025 01:43:48 -0800 Subject: [PATCH 80/90] Update test.yml --- .github/workflows/test.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 6f489ab..a9a9e42 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -23,6 +23,7 @@ jobs: - 27.2 - 28.2 - 29.4 + - 30.1 experimental: [false] include: - os: ubuntu-latest From 0310b0bffa6631a7ea6c740b28c679e32a3cac75 Mon Sep 17 00:00:00 2001 From: Jen-Chieh Shen Date: Mon, 24 Feb 2025 01:43:56 -0800 Subject: [PATCH 81/90] Update activate.yml --- .github/workflows/activate.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/activate.yml b/.github/workflows/activate.yml index 246e03e..278e8dd 100644 --- a/.github/workflows/activate.yml +++ b/.github/workflows/activate.yml @@ -23,6 +23,7 @@ jobs: - 27.2 - 28.2 - 29.4 + - 30.1 experimental: [false] include: - os: ubuntu-latest From 9616e5b5e793c3d8228a8fccf7b9ef7ace365005 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Elijah=20Gabe=20P=C3=A9rez?= <163072436+DevelopmentCool2449@users.noreply.github.com> Date: Wed, 26 Feb 2025 19:21:56 -0600 Subject: [PATCH 82/90] Add support for click widgets in touchscreen. (#567) * dashboard.el (dashboard-mode-map): Add `' for click widgets. --- dashboard.el | 1 + 1 file changed, 1 insertion(+) diff --git a/dashboard.el b/dashboard.el index 545ea97..2d6cb75 100644 --- a/dashboard.el +++ b/dashboard.el @@ -62,6 +62,7 @@ (define-key map (kbd "C-i") #'widget-forward) (define-key map [backtab] #'widget-backward) (define-key map (kbd "RET") #'dashboard-return) + (define-key map (kbd "") #'widget-button-click) (define-key map [mouse-1] #'dashboard-mouse-1) (define-key map (kbd "}") #'dashboard-next-section) (define-key map (kbd "{") #'dashboard-previous-section) From 4737b37562c0e5d3c96eb24462f62eaa782134ba Mon Sep 17 00:00:00 2001 From: Ricardo Arredondo <839303+ricardoricho@users.noreply.github.com> Date: Wed, 9 Apr 2025 01:27:30 -0600 Subject: [PATCH 83/90] Fix #566 to show "installed packages" instead of "loaded packages". (#570) * Fix #566 to show "installed packages" instead of "load packages". Also, change defcustom to defun in `dashboard-init-info`, this remove the possibility to customize a text when `dashboard-insert-init-info` but there is `dashboard-banner-logo-title` which is more suitable for that purpose. * Restore dashboard-init-info to be a custom function. * Set package-count and init-time as dashboard-init-info params Also delete obsolet cutom variable dashboard-set-init-info. * Return dasbord-init-info to be function with no arguments. * fix: indentation * refactor: Error type on init info * chore: changelog --------- Co-authored-by: JenChieh --- CHANGELOG.md | 1 + dashboard-widgets.el | 73 ++++++++++++++++++++------------ docs/FAQ.org | 1 - docs/variables-and-functions.org | 4 ++ 4 files changed, 51 insertions(+), 28 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 8483241..9240426 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -17,6 +17,7 @@ Check [Keep a Changelog](http://keepachangelog.com/) for recommendations on how * Support for random banners (#510) * Support for random footer icon (#519) * feat: Parameters for file icon `height` and `v-adjust` (#546) +* fix: Show `installed packages` instead of `loaded packages`. (#570) ## 1.8.0 > Released Jul 26, 2023 diff --git a/dashboard-widgets.el b/dashboard-widgets.el index a7865bf..193e2e4 100644 --- a/dashboard-widgets.el +++ b/dashboard-widgets.el @@ -135,13 +135,6 @@ See `create-image' and Info node `(elisp)Image Descriptors'." (make-obsolete-variable 'dashboard-set-navigator 'dashboard-startupify-list "1.9.0") -(defcustom dashboard-set-init-info t - "When non nil, init info will be displayed under the banner." - :type 'boolean - :group 'dashboard) -(make-obsolete-variable 'dashboard-set-init-info - 'dashboard-startupify-list "1.9.0") - (defcustom dashboard-set-footer t "When non nil, a footer will be displayed at the bottom." :type 'boolean @@ -288,24 +281,45 @@ Example: (const nil))))) :group 'dashboard) -(defcustom dashboard-init-info - (lambda () - (let ((package-count 0) (time (emacs-init-time))) - (when (bound-and-true-p package-alist) - (setq package-count (length package-activated-list))) - (when (boundp 'straight--profile-cache) - (setq package-count (+ (hash-table-count straight--profile-cache) package-count))) - (when (fboundp 'elpaca--queued) - (setq time (format "%f seconds" (float-time (time-subtract elpaca-after-init-time - before-init-time)))) - (setq package-count (length (elpaca--queued)))) - (if (zerop package-count) - (format "Emacs started in %s" time) - (format "%d packages loaded in %s" package-count time)))) - "Init info with packages loaded and init time." - :type '(function string) +(defcustom dashboard-init-info #'dashboard-init--info + "Custom function that must return a string to place instead of init-info." + :type 'function :group 'dashboard) +(defun dashboard-init--time () + "Return Emacs starting time in string including seconds ending." + (if (fboundp 'elpaca--queued) + (format "%s seconds" + (float-time (time-subtract elpaca-after-init-time + before-init-time))) + (emacs-init-time))) + +(defun dashboard-init--packages-count () + "Get the intalled package count depending on package manager. +Supported package managers are: package.el, straight.el and elpaca.el." + (let* ((package-count (if (bound-and-true-p package-alist) + (length package-activated-list) + 0)) + (straight-count (if (boundp 'straight--profile-cache) + (hash-table-count straight--profile-cache) + 0)) + (elpaca-count (if (fboundp 'elpaca--queued) + (length (elpaca--queued)) + 0))) + (+ package-count straight-count elpaca-count))) + + +(defun dashboard-init--info () + "Format init message. +Use `dashboard-init--time' and `dashboard-init--package-count' to generate +init message." + (let ((init-time (dashboard-init--time)) + (packages-count (dashboard-init--packages-count))) + (if (zerop packages-count) + (format "Emacs started in %s" init-time) + (format "%d packages installed. Emacs started in %s." + packages-count init-time)))) + (defcustom dashboard-display-icons-p #'display-graphic-p "Predicate to determine whether dashboard should show icons. Can be nil to not show icons and any truthy value to show them. When set to a @@ -876,10 +890,15 @@ Argument IMAGE-PATH path to the image." ;;; Initialize info (defun dashboard-insert-init-info () "Insert init info." - (let ((init-info (if (functionp dashboard-init-info) - (funcall dashboard-init-info) - dashboard-init-info))) - (dashboard-insert-center (propertize init-info 'face 'font-lock-comment-face)))) + (let ((init-info (cond ((stringp dashboard-init-info) + dashboard-init-info) + ((functionp dashboard-init-info) + (funcall dashboard-init-info)) + (t + (user-error "Unknown init info type (%s): %s" + (type-of init-info) init-info))))) + (dashboard-insert-center + (propertize init-info 'face 'font-lock-comment-face)))) (defun dashboard-insert-navigator () "Insert Navigator of the dashboard." diff --git a/docs/FAQ.org b/docs/FAQ.org index 76c4718..bca1318 100644 --- a/docs/FAQ.org +++ b/docs/FAQ.org @@ -113,4 +113,3 @@ If you want to change its icon you may use this: :face 'font-lock-keyword-face)) Also it can be a string list for display random footer icons. #+END_SRC - diff --git a/docs/variables-and-functions.org b/docs/variables-and-functions.org index 7edc88d..586d779 100644 --- a/docs/variables-and-functions.org +++ b/docs/variables-and-functions.org @@ -7,6 +7,7 @@ These are the variables available to users out of the box: | `dashboard-startup-banner` | Define the banner at the top of the dashboard. | `'official`, path to an image, or `nil` | | `dashboard-banner-logo-title` | Text to display below the banner. | Any string (e.g., `"Welcome to Emacs!"`) | | `dashboard-center-content` | Center the content horizontally. | `t`: Enable, `nil`: Disable | +| `dashboard-init-info` | Custom variable, could be a string or a function that returns a string | default: `dashboard-init--info` | | `dashboard-vertically-center-content` | Center the content vertically. | `t`: Enable, `nil`: Disable | | `dashboard-page-separator` | String used to separate sections in the buffer. | Any string (default: `"\n\n"`) | | `dashboard-set-heading-icons` | Show icons next to section headings. | `t`: Enable, `nil`: Disable | @@ -73,6 +74,9 @@ These are the variables available to users out of the box: | `dashboard-cycle-current-section-forward` | Cycle forward through entries in the current section. | None | | `dashboard-cycle-current-section-backward` | Cycle backward through entries in the current section. | None | | `dashboard-remove-item-under` | Remove the current item from the dashboard. | None | +| `dashboard-init--info` | Build a string with the init-time and package-count | | +| `dashboard-init--time` | Same as `emacs-init-time` and support elpaca init time | | +| `dashboard-init--package-count | Return the number of installed packages | | | `dashboard-insert-items` | Insert all configured dashboard items into the buffer. | None | | `dashboard-insert-banner` | Insert the banner into the dashboard buffer. | None | | `dashboard-insert-newline` | Insert a newline in the dashboard buffer. | None | From 4b7a4f1151e899ae90ec54c733686f765ab87a00 Mon Sep 17 00:00:00 2001 From: JenChieh Date: Wed, 9 Apr 2025 00:29:17 -0700 Subject: [PATCH 84/90] fix: free variable error --- dashboard-widgets.el | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/dashboard-widgets.el b/dashboard-widgets.el index 193e2e4..cb6f128 100644 --- a/dashboard-widgets.el +++ b/dashboard-widgets.el @@ -896,7 +896,7 @@ Argument IMAGE-PATH path to the image." (funcall dashboard-init-info)) (t (user-error "Unknown init info type (%s): %s" - (type-of init-info) init-info))))) + (type-of dashboard-init-info) dashboard-init-info))))) (dashboard-insert-center (propertize init-info 'face 'font-lock-comment-face)))) From 29b223d782a4479dc57904367b1fb940a2ffa8a4 Mon Sep 17 00:00:00 2001 From: Jen-Chieh Shen Date: Wed, 23 Apr 2025 06:49:20 +0800 Subject: [PATCH 85/90] fix: Warning missing lexical-binding cookie (#572) --- Eask | 2 ++ 1 file changed, 2 insertions(+) diff --git a/Eask b/Eask index a5ecafb..b49e48e 100644 --- a/Eask +++ b/Eask @@ -1,3 +1,5 @@ +;; -*- mode: eask; lexical-binding: t -*- + (package "dashboard" "1.9.0snapshot" "A startup screen extracted from Spacemacs") From 300f87567df7b177bb5a2f2b757983e80c596547 Mon Sep 17 00:00:00 2001 From: Jen-Chieh Shen Date: Fri, 9 May 2025 14:53:17 -0700 Subject: [PATCH 86/90] fix: wrong defcustom type for dashboard-footer-message --- dashboard-widgets.el | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/dashboard-widgets.el b/dashboard-widgets.el index cb6f128..f6966d7 100644 --- a/dashboard-widgets.el +++ b/dashboard-widgets.el @@ -152,7 +152,7 @@ See `create-image' and Info node `(elisp)Image Descriptors'." "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 string) + :type '(repeat string) :group 'dashboard) (defcustom dashboard-icon-type (and (or dashboard-set-heading-icons From f07661b39bec3683cf9edb7b1c58f6e658b6f764 Mon Sep 17 00:00:00 2001 From: Ricardo Arredondo <839303+ricardoricho@users.noreply.github.com> Date: Wed, 21 May 2025 03:00:05 -0600 Subject: [PATCH 87/90] Pass dashboard heading icon to dashboard-insert-section (#576) * Pass dashboard heading icon to dashboard-insert-section * Change dashboard-heading-icons to support family function and name --- dashboard-widgets.el | 54 +++++++++++++++----------------- docs/variables-and-functions.org | 2 +- 2 files changed, 26 insertions(+), 30 deletions(-) diff --git a/dashboard-widgets.el b/dashboard-widgets.el index f6966d7..b25e78e 100644 --- a/dashboard-widgets.el +++ b/dashboard-widgets.el @@ -187,10 +187,14 @@ The value can be one of: `all-the-icons', `nerd-icons'." (projects . "nf-oct-rocket") (registers . "nf-oct-database")))) "Association list for the icons of the heading sections. -Will be of the form `(list-type . icon-name-string)`. -If nil it is disabled. Possible values for list-type are: -`recents' `bookmarks' `projects' `agenda' `registers'" - :type '(alist :key-type symbol :value-type string) +Will be of the form `(SECTION . ICON)`, where SECTION could be any dashboard +section, for example: `recents' `bookmarks' `projects' `agenda' `registers'. + +ICON could be the name of the icon belonging to `octicon' family +or (ICON-FUNCTION ICON-NAME), for example: \"nf-oct-file\" using +nerd-icons or (all-the-icons-faicon \"newspaper-o\") using all-the-icons." + :type '(alist :key-type symbol + :value-type (choice string (cons function string))) :group 'dashboard) (defcustom dashboard-heading-icon-height 1.2 @@ -667,30 +671,8 @@ When called with TIMES return a function that insert TIMES number of newlines." (defun dashboard-insert-heading (heading &optional shortcut icon) "Insert a widget HEADING in dashboard buffer, adding SHORTCUT, ICON if provided." - (when (and (dashboard-display-icons-p) dashboard-set-heading-icons) - (let ((args `( :height ,dashboard-heading-icon-height - :v-adjust ,dashboard-heading-icon-v-adjust - :face dashboard-heading))) - (insert - (pcase heading - ("Recent Files:" - (apply #'dashboard-octicon (cdr (assoc 'recents dashboard-heading-icons)) args)) - ("Bookmarks:" - (apply #'dashboard-octicon (cdr (assoc 'bookmarks dashboard-heading-icons)) args)) - ((or "Agenda for today:" - "Agenda for the coming week:") - (apply #'dashboard-octicon (cdr (assoc 'agenda dashboard-heading-icons)) args)) - ("Registers:" - (apply #'dashboard-octicon (cdr (assoc 'registers dashboard-heading-icons)) args)) - ("Projects:" - (apply #'dashboard-octicon (cdr (assoc 'projects dashboard-heading-icons)) args)) - ("List Directories:" - (apply #'dashboard-octicon (cdr (assoc 'ls-directories dashboard-heading-icons)) args)) - ("List Files:" - (apply #'dashboard-octicon (cdr (assoc 'ls-files dashboard-heading-icons)) args)) - (_ - (if (null icon) " " icon)))) - (insert " "))) + (when (and (dashboard-display-icons-p) dashboard-set-heading-icons icon) + (insert icon " ")) (insert (propertize heading 'face 'dashboard-heading)) @@ -949,7 +931,8 @@ WIDGET-PARAMS are passed to the \"widget-create\" function." (when (and ,list ,shortcut-char dashboard-show-shortcuts) - ,shortcut-char)) + ,shortcut-char) + (dashboard-heading-icon ,shortcut-id)) (if ,list (when (and (dashboard-insert-section-list ,section-name @@ -960,6 +943,19 @@ WIDGET-PARAMS are passed to the \"widget-create\" function." (dashboard-insert-shortcut ,shortcut-id ,shortcut-char ,section-name)) (insert (propertize "\n --- No items ---" 'face 'dashboard-no-items-face))))) +(defun dashboard-heading-icon (section) + "Get the icon for SECTION from `dashboard-heading-icons'. +Return a space if icon is not found." + (let ((args (list :height dashboard-heading-icon-height + :v-adjust dashboard-heading-icon-v-adjust + :face 'dashboard-heading)) + (icon (assoc section dashboard-heading-icons))) + (if icon (cond + ((stringp (cdr icon)) (apply #'dashboard-octicon (cdr icon) args)) + ((listp (cdr icon)) (apply (cadr icon) (caddr icon) args)) + (t (error "Bad value %s in `dashboard-heading-icons'" icon))) + " "))) + ;; ;;; Section list diff --git a/docs/variables-and-functions.org b/docs/variables-and-functions.org index 586d779..9df381d 100644 --- a/docs/variables-and-functions.org +++ b/docs/variables-and-functions.org @@ -12,7 +12,7 @@ These are the variables available to users out of the box: | `dashboard-page-separator` | String used to separate sections in the buffer. | Any string (default: `"\n\n"`) | | `dashboard-set-heading-icons` | Show icons next to section headings. | `t`: Enable, `nil`: Disable | | `dashboard-set-file-icons` | Show icons next to items. | `t`: Enable, `nil`: Disable | -| `dashboard-heading-icons` | Icons to use for section headings. | Alist of `(section . icon-name)` pairs (e.g., `((recents . "history") (bookmarks . "bookmark"))`) | +| `dashboard-heading-icons` | Icons to use for section headings. | Alist of `(section . icon-spec)` pairs, where icon-spec could be a name or a function-family and name (e.g., `((recents . "history") (bookmarks . "bookmark") (my-news . (all-the-icons-faicon "newspaper-o")) (agenda . (nerd-icons-codicon "nf-cod-calendar"))`) | | `dashboard-icon-type` | Icon style used for headings and items. | `'all-the-icons`, `'ascii`, `nil` | | `dashboard-recentf-show-base` | Control how recentf entries are displayed. | `'Respect format`, `'hide`, `'absolute`, `'expand`, `'truncate-middle` | | `dashboard-recentf-item-format` | Format string for displaying recentf items. | Any valid format string (e.g., `"%s"`) | From 8c2cf0cfde4f5dac8c477f755380fffef6824108 Mon Sep 17 00:00:00 2001 From: Ricardo Arredondo <839303+ricardoricho@users.noreply.github.com> Date: Tue, 8 Jul 2025 02:57:31 +0200 Subject: [PATCH 88/90] Fix #561 using dashboard--find-max-width to get banner text width (#571) --- dashboard-widgets.el | 23 +++++++++-------------- 1 file changed, 9 insertions(+), 14 deletions(-) diff --git a/dashboard-widgets.el b/dashboard-widgets.el index b25e78e..6d34105 100644 --- a/dashboard-widgets.el +++ b/dashboard-widgets.el @@ -798,25 +798,20 @@ Argument IMAGE-PATH path to the image." (goto-char (point-max)) (when-let* ((banner (dashboard-choose-banner dashboard-startup-banner))) (insert "\n") + (when (display-graphic-p) (insert "\n")) (let ((start (point)) buffer-read-only text-width - image-spec - (graphic-mode (display-graphic-p))) - (when graphic-mode (insert "\n")) + image-spec) ;; If specified, insert a text banner. (when-let* ((txt (plist-get banner :text))) - (if (file-exists-p txt) - (insert-file-contents txt) - (save-excursion (insert txt))) - (unless (text-properties-at 0 txt) - (put-text-property (point) (point-max) 'face 'dashboard-text-banner)) - (setq text-width 0) - (while (not (eobp)) - (let ((line-length (- (line-end-position) (line-beginning-position)))) - (when (< text-width line-length) - (setq text-width line-length))) - (forward-line 1))) + (save-excursion + (if (file-exists-p txt) + (insert-file-contents txt) + (insert txt))) + (put-text-property start (point-max) 'face 'dashboard-text-banner) + (setq text-width (dashboard--find-max-width start (point-max))) + (goto-char (point-max))) ;; If specified, insert an image banner. When displayed in a graphical frame, this will ;; replace the text banner. (when-let* ((img (plist-get banner :image))) From 1787f3136ddbdd329b67fde4c99df487d841cab8 Mon Sep 17 00:00:00 2001 From: Jen-Chieh Shen Date: Sat, 12 Jul 2025 01:27:54 +0800 Subject: [PATCH 89/90] docs: Convert to links to changelog (#580) --- CHANGELOG.md | 192 +++++++++++++++++++++++++-------------------------- 1 file changed, 96 insertions(+), 96 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 9240426..e867226 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -8,144 +8,144 @@ Check [Keep a Changelog](http://keepachangelog.com/) for recommendations on how ## 1.9.0 (Unreleased) > Released N/A -* fix: Make remove entry optional (#480) -* Add dashboard icon face (#483) -* Add customization option to hide the cursor on the dashboard (#492) +* fix: Make remove entry optional ([#480](../../pull/480)) +* Add dashboard icon face ([#483](../../pull/483)) +* Add customization option to hide the cursor on the dashboard ([#492](../../pull/492)) * Add option to vertically center dashboard (#318 and #493) -* fix: Adding animation to webp image (#502) -* feat: Support for insert startupify list in order (#506) -* Support for random banners (#510) -* Support for random footer icon (#519) -* feat: Parameters for file icon `height` and `v-adjust` (#546) -* fix: Show `installed packages` instead of `loaded packages`. (#570) +* fix: Adding animation to webp image ([#502](../../pull/502)) +* feat: Support for insert startupify list in order ([#506](../../pull/506)) +* Support for random banners ([#510](../../pull/510)) +* Support for random footer icon ([#519](../../pull/519)) +* feat: Parameters for file icon `height` and `v-adjust` ([#546](../../pull/546)) +* fix: Show `installed packages` instead of `loaded packages`. ([#570](../../pull/570)) ## 1.8.0 > Released Jul 26, 2023 -* Disable display-line-numbers-mode (#182) -* Mute no project removed message (#212) -* Align the file icons horizontally (#221) -* Fix package count when using package.el and straight.el simultaneously (#233) -* Fix fitler agenda by time (#232) -* Respect to custom items face instead of widget-button face (#273) -* Support for image transforms (#278) -* Allow moving point during `dashboard-mode-hook` (#227) -* Add truncate style for path (#279) -* Add agenda highlight headlines (#281) -* Fix mosue click error (#285) -* Add flag to refresh instead to kill the dashboard buffer (#290) -* Fix wrong recent files when first starting the dashboard buffer (#294) -* Add license file (#296) -* Fix icon for week agenda items (#300) -* Make `page-break-lines` as optional dependency (#315) -* Add feature to customize section headings (#316) -* Add gif support (#327) -* Fix init info reporting with wrong time (#330) -* Add new ASCII GNU Emacs logo, `banners/4.txt`. (#337) -* Add feature to sort agenda (#335) -* Update the CI process uasing Cask (#341) -* Add a changelog (#342) -* Make shortcut function name respect to shortcut id (#348) -* Add capability to custom align agenda widget (#350) -* Correct straight.el package count (#354) -* Lazy load modules specify in dashboard buffer (#359) -* Clean up zombie project for project.el (#363) -* Add capability to navigate each section (#365) -* Add functionality to delete items (#366) -* Fix issue dashboard-banners-directory resolves with two slashes ("dashboard//banners") (GNU only?) (#367) -* Add capability to remove item for agenda (#372) -* Add CI, activation test (#381) -* Fix dashboard not showing up in daemon mode (#382) -* Calculate truncate path length in pixel (#402) -* Center banner with properties and combine text with image (#407) -* Caculate line length in pixel width (#427) -* Add ascii option to dashboard-startup-banner (#436) -* Agenda tags format (#441) -* Make icon display predicate customizeable (#442) -* Add support for nerd-icons (#451) -* Add custom variables for icon's arguments (#461) +* Disable display-line-numbers-mode ([#182](../../pull/182)) +* Mute no project removed message ([#212](../../pull/212)) +* Align the file icons horizontally ([#221](../../pull/221)) +* Fix package count when using package.el and straight.el simultaneously ([#233](../../pull/233)) +* Fix fitler agenda by time ([#232](../../pull/232)) +* Respect to custom items face instead of widget-button face ([#273](../../pull/273)) +* Support for image transforms ([#278](../../pull/278)) +* Allow moving point during `dashboard-mode-hook` ([#227](../../pull/227)) +* Add truncate style for path ([#279](../../pull/279)) +* Add agenda highlight headlines ([#281](../../pull/281)) +* Fix mosue click error ([#285](../../pull/285)) +* Add flag to refresh instead to kill the dashboard buffer ([#290](../../pull/290)) +* Fix wrong recent files when first starting the dashboard buffer ([#294](../../pull/294)) +* Add license file ([#296](../../pull/296)) +* Fix icon for week agenda items ([#300](../../pull/300)) +* Make `page-break-lines` as optional dependency ([#315](../../pull/315)) +* Add feature to customize section headings ([#316](../../pull/316)) +* Add gif support ([#327](../../pull/327)) +* Fix init info reporting with wrong time ([#330](../../pull/330)) +* Add new ASCII GNU Emacs logo, `banners/4.txt`. ([#337](../../pull/337)) +* Add feature to sort agenda ([#335](../../pull/335)) +* Update the CI process uasing Cask ([#341](../../pull/341)) +* Add a changelog ([#342](../../pull/342)) +* Make shortcut function name respect to shortcut id ([#348](../../pull/348)) +* Add capability to custom align agenda widget ([#350](../../pull/350)) +* Correct straight.el package count ([#354](../../pull/354)) +* Lazy load modules specify in dashboard buffer ([#359](../../pull/359)) +* Clean up zombie project for project.el ([#363](../../pull/363)) +* Add capability to navigate each section ([#365](../../pull/365)) +* Add functionality to delete items ([#366](../../pull/366)) +* Fix issue dashboard-banners-directory resolves with two slashes ("dashboard//banners") (GNU only?) ([#367](../../pull/367)) +* Add capability to remove item for agenda ([#372](../../pull/372)) +* Add CI, activation test ([#381](../../pull/381)) +* Fix dashboard not showing up in daemon mode ([#382](../../pull/382)) +* Calculate truncate path length in pixel ([#402](../../pull/402)) +* Center banner with properties and combine text with image ([#407](../../pull/407)) +* Caculate line length in pixel width ([#427](../../pull/427)) +* Add ascii option to dashboard-startup-banner ([#436](../../pull/436)) +* Agenda tags format ([#441](../../pull/441)) +* Make icon display predicate customizeable ([#442](../../pull/442)) +* Add support for nerd-icons ([#451](../../pull/451)) +* Add custom variables for icon's arguments ([#461](../../pull/461)) ## 1.7.0 > Released Feb 21, 2020 * Update year in Copyright -* Fix CI and include emacs 27 (#218) +* Fix CI and include emacs 27 ([#218](../../pull/218)) * Disable package-lint checks for now -* Fix error when `dashboard--section-starts' is nil (#204) -* Smaller icon size for remote files (#211) -* Create a custom variable for dashboard-footer (#186) -* Replace defvar with defcustom, making customize work properly (#205) -* Disable undo history for dashboard buffer (#207) -* Avoid loading `all-the-icons` prematurely (#209) +* Fix error when `dashboard--section-starts' is nil ([#204](../../pull/204)) +* Smaller icon size for remote files ([#211](../../pull/211)) +* Create a custom variable for dashboard-footer ([#186](../../pull/186)) +* Replace defvar with defcustom, making customize work properly ([#205](../../pull/205)) +* Disable undo history for dashboard buffer ([#207](../../pull/207)) +* Avoid loading `all-the-icons` prematurely ([#209](../../pull/209)) * Get elisp-lint path using find -* Refactor: use all-the-icons-icon-for-dir (#198) +* Refactor: use all-the-icons-icon-for-dir ([#198](../../pull/198)) * Update Emacs 26 to 26.3 * Update elisp-lint package * Update circe to 2.1 -* Replace if with when (#200) -* Fix space after comma for phrase in dashboard-footer (#194) -* Fix face description typo (#189) -* Fix widget face bug. Fixed some linting issues (#177) -* Dashboard return button (#171) -* Fix icons for weekly agenda and add an icon final condition (#173) -* Added filtering by category for org mode (#167) -* Revert "Remove `(require 'seq)` (#165)" -* Remove `(require 'seq)` (#165) +* Replace if with when ([#200](../../pull/200)) +* Fix space after comma for phrase in dashboard-footer ([#194](../../pull/194)) +* Fix face description typo ([#189](../../pull/189)) +* Fix widget face bug. Fixed some linting issues ([#177](../../pull/177)) +* Dashboard return button ([#171](../../pull/171)) +* Fix icons for weekly agenda and add an icon final condition ([#173](../../pull/173)) +* Added filtering by category for org mode ([#167](../../pull/167)) +* Revert "Remove `(require 'seq)` ([#165](../../pull/165))" +* Remove `(require 'seq)` ([#165](../../pull/165)) * Restore seq-take properly -* Replace `seq-take` with its code (#161) -* Reduce initial requires (#162) +* Replace `seq-take` with its code ([#161](../../pull/161)) +* Reduce initial requires ([#162](../../pull/162)) * Update screenshot -* Vimish bindings (#139) +* Vimish bindings ([#139](../../pull/139)) ## 1.6.0 > Released Jun 07, 2019 -* Added foot note plus several enhancements and code improvements (#137) @romatthe -* Do not require all-the-icons for footer icon, use it only if it is available (#141) @JesusMtnez -* Properly use footer icon fallback text (#142) @JesusMtnez -* Add face: dashboard-footer (#145) @seagle0128 -* Clean up project list before loading it (#144) @seagle0128 -* Add the navigator below the banner with the customized buttons. (#143) @seagle0128 -* Support `straight.el` properly in `dashboard-init-info` (#147) @JesusMtnez -* Support multiple lines for the navigator. (#150) @JesusMtnez -* Add newline at the end of insert footer. (#149) @jcs090218 +* Added foot note plus several enhancements and code improvements ([#137](../../pull/137)) @romatthe +* Do not require all-the-icons for footer icon, use it only if it is available ([#141](../../pull/141)) @JesusMtnez +* Properly use footer icon fallback text ([#142](../../pull/142)) @JesusMtnez +* Add face: dashboard-footer ([#145](../../pull/145)) @seagle0128 +* Clean up project list before loading it ([#144](../../pull/144)) @seagle0128 +* Add the navigator below the banner with the customized buttons. ([#143](../../pull/143)) @seagle0128 +* Support `straight.el` properly in `dashboard-init-info` ([#147](../../pull/147)) @JesusMtnez +* Support multiple lines for the navigator. ([#150](../../pull/150)) @JesusMtnez +* Add newline at the end of insert footer. ([#149](../../pull/149)) @jcs090218 * Update metadata in comments @JesusMtnez * Drop 24.4 support, from now on checking from emacs 25.3 @JesusMtnez ## 1.5.0 > Released May 27, 2019 -* Support bookmark/agenda/register/project actions. (#131) -* Made heading icons a customizable variable (#135) +* Support bookmark/agenda/register/project actions. ([#131](../../pull/131)) +* Made heading icons a customizable variable ([#135](../../pull/135)) ## 1.4.0 > Released May 22, 2019 -* Update emacs versions used in CircleCI (#124) +* Update emacs versions used in CircleCI ([#124](../../pull/124)) - Emacs 25.3 - Emacs 26.2 - Emacs master -* Added heading and file icons (#123) -* Added new init info functionality (#126) +* Added heading and file icons ([#123](../../pull/123)) +* Added new init info functionality ([#126](../../pull/126)) ## 1.3.1 > Released Mar 20, 2019 -* No need to launch 'projectile-mode (#113) -* Use "Applications" group and give a proper description (#114) -* Fix error in `dashboard-next-section` (#118) -* Make line moving commands behave like `dired` (#117) +* No need to launch 'projectile-mode ([#113](../../pull/113)) +* Use "Applications" group and give a proper description ([#114](../../pull/114)) +* Fix error in `dashboard-next-section` ([#118](../../pull/118)) +* Make line moving commands behave like `dired` ([#117](../../pull/117)) ## 1.3.0 > Released Mar 03, 2019 -* New configuration `dashboard-center-content` to center content (#88) -* Handle the case where dashboard lines longer than win width (#101) -* Fix shortcut regression bug (#102) -* Fix opening org mode "links" (#106) -* Add shortcut indicators to sections (#103) -* Indicate when a section has no items (#107) -* Give section headings a face for easy visual scanning (#109) +* New configuration `dashboard-center-content` to center content ([#88](../../pull/88)) +* Handle the case where dashboard lines longer than win width ([#101](../../pull/101)) +* Fix shortcut regression bug ([#102](../../pull/102)) +* Fix opening org mode "links" ([#106](../../pull/106)) +* Add shortcut indicators to sections ([#103](../../pull/103)) +* Indicate when a section has no items ([#107](../../pull/107)) +* Give section headings a face for easy visual scanning ([#109](../../pull/109)) ## 1.2.5 > Released Feb 25, 2019 From 24774014a4c09556b568246db7f47bab9f8c2c79 Mon Sep 17 00:00:00 2001 From: Jen-Chieh Shen Date: Sat, 12 Jul 2025 01:29:49 +0800 Subject: [PATCH 90/90] docs: minor changes (#581) --- CHANGELOG.md | 28 ++++++++++++++-------------- 1 file changed, 14 insertions(+), 14 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index e867226..a39abdb 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -11,7 +11,7 @@ Check [Keep a Changelog](http://keepachangelog.com/) for recommendations on how * fix: Make remove entry optional ([#480](../../pull/480)) * Add dashboard icon face ([#483](../../pull/483)) * Add customization option to hide the cursor on the dashboard ([#492](../../pull/492)) -* Add option to vertically center dashboard (#318 and #493) +* Add option to vertically center dashboard ([#318](../../pull/318) and [#493](../../pull/493)) * fix: Adding animation to webp image ([#502](../../pull/502)) * feat: Support for insert startupify list in order ([#506](../../pull/506)) * Support for random banners ([#510](../../pull/510)) @@ -59,7 +59,7 @@ Check [Keep a Changelog](http://keepachangelog.com/) for recommendations on how * Calculate truncate path length in pixel ([#402](../../pull/402)) * Center banner with properties and combine text with image ([#407](../../pull/407)) * Caculate line length in pixel width ([#427](../../pull/427)) -* Add ascii option to dashboard-startup-banner ([#436](../../pull/436)) +* Add ascii option to `dashboard-startup-banner` ([#436](../../pull/436)) * Agenda tags format ([#441](../../pull/441)) * Make icon display predicate customizeable ([#442](../../pull/442)) * Add support for nerd-icons ([#451](../../pull/451)) @@ -78,7 +78,7 @@ Check [Keep a Changelog](http://keepachangelog.com/) for recommendations on how * Disable undo history for dashboard buffer ([#207](../../pull/207)) * Avoid loading `all-the-icons` prematurely ([#209](../../pull/209)) * Get elisp-lint path using find -* Refactor: use all-the-icons-icon-for-dir ([#198](../../pull/198)) +* Refactor: use `all-the-icons-icon-for-dir` ([#198](../../pull/198)) * Update Emacs 26 to 26.3 * Update elisp-lint package * Update circe to 2.1 @@ -100,17 +100,17 @@ Check [Keep a Changelog](http://keepachangelog.com/) for recommendations on how ## 1.6.0 > Released Jun 07, 2019 -* Added foot note plus several enhancements and code improvements ([#137](../../pull/137)) @romatthe -* Do not require all-the-icons for footer icon, use it only if it is available ([#141](../../pull/141)) @JesusMtnez -* Properly use footer icon fallback text ([#142](../../pull/142)) @JesusMtnez -* Add face: dashboard-footer ([#145](../../pull/145)) @seagle0128 -* Clean up project list before loading it ([#144](../../pull/144)) @seagle0128 -* Add the navigator below the banner with the customized buttons. ([#143](../../pull/143)) @seagle0128 -* Support `straight.el` properly in `dashboard-init-info` ([#147](../../pull/147)) @JesusMtnez -* Support multiple lines for the navigator. ([#150](../../pull/150)) @JesusMtnez -* Add newline at the end of insert footer. ([#149](../../pull/149)) @jcs090218 -* Update metadata in comments @JesusMtnez -* Drop 24.4 support, from now on checking from emacs 25.3 @JesusMtnez +* Added foot note plus several enhancements and code improvements ([#137](../../pull/137)) **@romatthe** +* Do not require all-the-icons for footer icon, use it only if it is available ([#141](../../pull/141)) **@JesusMtnez** +* Properly use footer icon fallback text ([#142](../../pull/142)) **@JesusMtnez** +* Add face: dashboard-footer ([#145](../../pull/145)) **@seagle0128** +* Clean up project list before loading it ([#144](../../pull/144)) **@seagle0128** +* Add the navigator below the banner with the customized buttons. ([#143](../../pull/143)) **@seagle0128** +* Support `straight.el` properly in `dashboard-init-info` ([#147](../../pull/147)) **@JesusMtnez** +* Support multiple lines for the navigator. ([#150](../../pull/150)) **@JesusMtnez** +* Add newline at the end of insert footer. ([#149](../../pull/149)) **@jcs090218** +* Update metadata in comments **@JesusMtnez** +* Drop 24.4 support, from now on checking from emacs 25.3 **@JesusMtnez** ## 1.5.0 > Released May 27, 2019