Cleaned up the dashboard

Would still like to get the features to display, but that is minor.
This commit is contained in:
Howard Abrams 2023-08-11 16:29:06 -07:00
parent 14b4db4330
commit 4a6a3c87b1
2 changed files with 48 additions and 37 deletions

View file

@ -211,8 +211,9 @@ While the space can be use to separate words (acting a bit like a =.*= regular e
#+begin_src emacs-lisp #+begin_src emacs-lisp
(use-package orderless (use-package orderless
:commands (orderless-filter) :commands (orderless-filter)
:config
(push 'orderless completion-styles)
:custom :custom
(completion-styles '(orderless basic))
(completion-ignore-case t) (completion-ignore-case t)
(completion-category-defaults nil) (completion-category-defaults nil)
(completion-category-overrides '((file (styles partial-completion))))) (completion-category-overrides '((file (styles partial-completion)))))

View file

@ -63,6 +63,34 @@ For this, I use the [[https://github.com/tkf/emacs-request][request]] package (a
(lambda (&key data &allow-other-keys) (lambda (&key data &allow-other-keys)
(setq ha-dad-joke data)))))) (setq ha-dad-joke data))))))
#+end_src #+end_src
** Features
I would appreciate seeing if my Emacs installation has the features that I expect:
#+begin_src emacs-lisp
(defun ha-hamacs-features (&optional iconic)
"Simple display of features I'm most keen about.
If ICONIC is non-nil, return a string of icons."
(interactive)
(let* ((png-icon (all-the-icons-material "image"))
(svg-icon (all-the-icons-alltheicon "svg"))
(ts-icon (all-the-icons-faicon "tree"))
(tls-icon (all-the-icons-faicon "expeditedssl"))
(json-icon (all-the-icons-fileicon "jsx"))
(mag-icon (all-the-icons-faicon "magic"))
(jit-icon (all-the-icons-faicon "cog"))
(results (s-join " "
(list (when (and (fboundp 'native-comp-available-p)
(native-comp-available-p))
(if iconic jit-icon "Native-Compilation"))
(when (treesit-available-p) (if iconic ts-icon "TreeSit"))
(when (image-type-available-p 'svg) (if iconic svg-icon "SVG"))
(when (image-type-available-p 'png) (if iconic png-icon "PNG"))
(when (gnutls-available-p) (if iconic tls-icon "TLS"))
(when (json-available-p) (if iconic json-icon "JSON"))
(when (fboundp 'imagemagick-types) (if iconic mag-icon "ImageMagick"))))))
(if (called-interactively-p)
(message "Enabled features: %s" results)
results)))
#+end_src
** Dashboard ** Dashboard
The [[https://github.com/emacs-dashboard/emacs-dashboard][emacs-dashboard]] project makes a nicer startup screen. The [[https://github.com/emacs-dashboard/emacs-dashboard][emacs-dashboard]] project makes a nicer startup screen.
#+begin_src emacs-lisp #+begin_src emacs-lisp
@ -85,8 +113,9 @@ The [[https://github.com/emacs-dashboard/emacs-dashboard][emacs-dashboard]] proj
dashboard-projects-switch-function 'projectile-persp-switch-project dashboard-projects-switch-function 'projectile-persp-switch-project
dashboard-items '((projects . 5) dashboard-items '((projects . 5)
;; (agenda . 5) ;; (agenda . 5)
(bookmarks . 5))) (bookmarks . 5))
(setq dashboard-footer-messages (list (ha--dad-joke))) dashboard-set-heading-icons t
dashboard-footer-messages (list (ha--dad-joke)))
:config :config
(dashboard-setup-startup-hook) (dashboard-setup-startup-hook)
@ -101,32 +130,6 @@ The [[https://github.com/emacs-dashboard/emacs-dashboard][emacs-dashboard]] proj
(use-package page-break-lines) (use-package page-break-lines)
#+end_src #+end_src
I would appreciate seeing if my Emacs installation has the features that I expect:
#+begin_src emacs-lisp
(defun ha-hamacs-features (&optional iconic)
"Simple display of features I'm most keen about.
If ICONIC is non-nil, return a string of icons."
(interactive)
(let* ((png-icon (all-the-icons-material "image"))
(svg-icon (all-the-icons-alltheicon "svg"))
(tls-icon (all-the-icons-faicon "expeditedssl"))
(json-icon (all-the-icons-fileicon "jsx"))
(mag-icon (all-the-icons-faicon "magic"))
(jit-icon (all-the-icons-faicon "cog"))
(results (s-join " "
(list (when (and (fboundp 'native-comp-available-p)
(native-comp-available-p))
(if iconic jit-icon "Native-Compilation"))
(when (image-type-available-p 'svg) (if iconic svg-icon "SVG"))
(when (image-type-available-p 'png) (if iconic png-icon "PNG"))
(when (gnutls-available-p) (if iconic tls-icon "TLS"))
(when (json-available-p) (if iconic json-icon "JSON"))
(when (fboundp 'imagemagick-types) (if iconic mag-icon "ImageMagick"))))))
(if (called-interactively-p)
(message "Enabled features: %s" results)
results)))
#+end_src
* Right Side * Right Side
On the right side should show a list of keybindings or other hints that I want to work on memorizing. On the right side should show a list of keybindings or other hints that I want to work on memorizing.
@ -145,6 +148,9 @@ Lots of things to learn and keep straight. Lets try the [[https://github.com/
'(:key "x" :description "s-exp") '(:key "x" :description "s-exp")
'(:key "'" :description "string") '(:key "'" :description "string")
'(:key "d" :description "function") '(:key "d" :description "function")
'(:key "f" :description "function ... tree-sitter")
'(:key "b" :description "loop ... tree-sitter")
'(:key "u" :description "condition ... tree-sitter")
'(:key "j" :description "smaller indent block") '(:key "j" :description "smaller indent block")
'(:key "k" :description "larger indent block") '(:key "k" :description "larger indent block")
'(:key "i" :description "indented block") '(:key "i" :description "indented block")
@ -202,19 +208,23 @@ Simple function to display a file in the top-right corner (if the file exists):
* Altogether * Altogether
The =dashboard= project hooks to [[help:emacs-startup-hook][emacs-startup-hook]] and this =ha-dashboard= function hooks to dashboards [[help:dashboard-after-initialize-hook][dashboard-after-initialize-hook]]: The =dashboard= project hooks to [[help:emacs-startup-hook][emacs-startup-hook]] and this =ha-dashboard= function hooks to dashboards [[help:dashboard-after-initialize-hook][dashboard-after-initialize-hook]]:
#+begin_src emacs-lisp #+begin_src emacs-lisp
(defun ha-dashboard () (defun ha-dashboard ()
"Shows the extra stuff with the dashboard." "Shows the extra stuff with the dashboard."
(interactive) (interactive)
(let ((width (thread-first (window-total-width) (switch-to-buffer "*dashboard*")
(/ 3) (delete-other-windows)
(* 2)))) (split-window-horizontally)
(split-window-right width) (other-window 1)
(cheatsheet-show) (switch-to-buffer "*cheatsheet*")
(ha-show-learn-this))) (cheatsheet-mode)
(erase-buffer)
(insert (cheatsheet--format))
(setq buffer-read-only t)
;; (shrink-window-horizontally (- (window-size nil t) 50))
(shrink-window-horizontally 40)
(goto-char (point-min)))
#+end_src #+end_src
* Technical Artifacts :noexport: * Technical Artifacts :noexport:
Let's =provide= a name so we can =require= this file: Let's =provide= a name so we can =require= this file: