From ed32c28376d1315fbfc7b4f09cbcc47a0c797c88 Mon Sep 17 00:00:00 2001 From: Jen-Chieh Date: Thu, 29 Oct 2020 13:17:29 +0800 Subject: [PATCH 1/3] Update doc for text startup banner. --- README.org | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.org b/README.org index 27c8a769..0df51630 100644 --- a/README.org +++ b/README.org @@ -67,7 +67,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.png" which displays whatever image you would prefer +;; "path/to/your/image.png" or "path/to/your/text.txt" which displays whatever image/text you would prefer ;; Content is not centered by default. To center, set (setq dashboard-center-content t) From e7685c148e3bdb72cea12f8d9dc7a11b59f7dc6f Mon Sep 17 00:00:00 2001 From: Jen-Chieh Date: Thu, 29 Oct 2020 13:17:45 +0800 Subject: [PATCH 2/3] Add text banner option. --- dashboard-widgets.el | 11 ++++------- 1 file changed, 4 insertions(+), 7 deletions(-) diff --git a/dashboard-widgets.el b/dashboard-widgets.el index 023b5c65..fb1e8555 100644 --- a/dashboard-widgets.el +++ b/dashboard-widgets.el @@ -198,11 +198,11 @@ Example: Default value is `official', it displays the Emacs logo. `logo' displays Emacs alternative logo. An integer value is the index of text -banner. A string value must be a path to a .PNG file. +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) (const :tag "logo" logo) - (string :tag "a png path")) + (string :tag "a png or txt path")) :group 'dashboard) (defcustom dashboard-buffer-last-width nil @@ -448,13 +448,10 @@ If MESSAGEBUF is not nil then MSG is also written in message buffer." (dashboard-get-banner-path 1))) ((integerp dashboard-startup-banner) (dashboard-get-banner-path dashboard-startup-banner)) - ((and dashboard-startup-banner - (image-type-available-p (intern (file-name-extension - dashboard-startup-banner))) - (display-graphic-p)) + ((stringp dashboard-startup-banner) (if (file-exists-p dashboard-startup-banner) dashboard-startup-banner - (message "could not find banner %s" dashboard-startup-banner) + (message "could not find banner %s, use default" dashboard-startup-banner) (dashboard-get-banner-path 1))) (t (dashboard-get-banner-path 1))))) From 889ef6cf8bcbebdfd1e5fdde2250b909faf1b524 Mon Sep 17 00:00:00 2001 From: Jen-Chieh Date: Thu, 29 Oct 2020 13:21:15 +0800 Subject: [PATCH 3/3] Compelte msg when not found. --- dashboard-widgets.el | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/dashboard-widgets.el b/dashboard-widgets.el index fb1e8555..86dccddc 100644 --- a/dashboard-widgets.el +++ b/dashboard-widgets.el @@ -451,7 +451,7 @@ If MESSAGEBUF is not nil then MSG is also written in message buffer." ((stringp dashboard-startup-banner) (if (file-exists-p dashboard-startup-banner) dashboard-startup-banner - (message "could not find banner %s, use default" dashboard-startup-banner) + (message "could not find banner %s, use default instead" dashboard-startup-banner) (dashboard-get-banner-path 1))) (t (dashboard-get-banner-path 1)))))