From bf719589eff26eca513ed2f5696ff95fe69a2d4b Mon Sep 17 00:00:00 2001 From: Angel Peralta Date: Fri, 1 May 2026 19:47:50 -0400 Subject: [PATCH 1/3] feat(dashboard): show Lem version in dashboard modeline - Add modeline-version modeline element in src/modeline.lisp that displays the Lem version (e.g. ' v2.3.0 ') from the ASDF system definition, styled with a dim foreground attribute inspired by Doom Emacs. - Export modeline-version, modeline-version-attribute, inactive-modeline-version-attribute, modeline-major-mode and modeline-minor-modes from lem-core in src/internal-packages.lisp. - Apply a per-buffer modeline format for the *dashboard* buffer in lem-dashboard.lisp that appends modeline-version on the right side. - Add a dashboard-version item class in dashboard-items.lisp that renders the version string centered below the splash art, matching the Doom Emacs start-screen style. --- extensions/lem-dashboard/dashboard-items.lisp | 14 ++++++++++++++ extensions/lem-dashboard/default-dashboard.lisp | 2 +- extensions/lem-dashboard/lem-dashboard.lisp | 8 ++++++++ src/internal-packages.lisp | 5 +++++ src/modeline.lisp | 11 +++++++++++ 5 files changed, 39 insertions(+), 1 deletion(-) diff --git a/extensions/lem-dashboard/dashboard-items.lisp b/extensions/lem-dashboard/dashboard-items.lisp index 9017f213c..2582b0b0e 100644 --- a/extensions/lem-dashboard/dashboard-items.lisp +++ b/extensions/lem-dashboard/dashboard-items.lisp @@ -18,6 +18,20 @@ (insert-string point (create-centered-string line) :attribute (item-attribute item)) (insert-character point #\Newline))) +;; Version (Doom Emacs style — centered below splash) +(defclass dashboard-version (dashboard-item) + () + (:documentation "Displays the Lem version string centered, like Doom Emacs.") + (:default-initargs + :item-attribute 'document-header4-attribute + :bottom-margin 1)) + +(defmethod draw-dashboard-item ((item dashboard-version) point) + (let ((version-str (format nil "v~A" (asdf:component-version (asdf:find-system :lem))))) + (insert-string point (create-centered-string version-str) + :attribute (item-attribute item)) + (insert-character point #\Newline))) + ;; Url (defclass dashboard-url (dashboard-item) ((url :initarg :url :accessor url) diff --git a/extensions/lem-dashboard/default-dashboard.lisp b/extensions/lem-dashboard/default-dashboard.lisp index b7b2a67f2..6c8fe4d47 100644 --- a/extensions/lem-dashboard/default-dashboard.lisp +++ b/extensions/lem-dashboard/default-dashboard.lisp @@ -42,7 +42,7 @@ (splash *default-splash*) (footer-messages *default-footer-messages*) hide-links) - (let ((dashboard-items + (let ((dashboard-items (list (make-instance 'dashboard-splash :item-attribute 'document-metadata-attribute :splash-texts splash) diff --git a/extensions/lem-dashboard/lem-dashboard.lisp b/extensions/lem-dashboard/lem-dashboard.lisp index 895ee853b..6cd1cb503 100644 --- a/extensions/lem-dashboard/lem-dashboard.lisp +++ b/extensions/lem-dashboard/lem-dashboard.lisp @@ -101,6 +101,14 @@ (dolist (item *dashboard-layout*) (draw-dashboard-item item point))) (change-buffer-mode buffer 'dashboard-mode) + ;; Show the Lem version in the modeline for the dashboard buffer only + (setf (variable-value 'modeline-format :buffer buffer) + '(" " modeline-write-info modeline-name + (modeline-posline nil :right) + (modeline-position nil :right) + (modeline-minor-modes nil :right) + (modeline-major-mode nil :right) + (modeline-version nil :right))) (move-to-line (buffer-point buffer) old-line) (move-to-column (buffer-point buffer) old-column))))) diff --git a/src/internal-packages.lisp b/src/internal-packages.lisp index 1c64cdcf3..ef4160a6d 100644 --- a/src/internal-packages.lisp +++ b/src/internal-packages.lisp @@ -413,6 +413,8 @@ :modeline-write-info :modeline-name :modeline-mode-names + :modeline-major-mode + :modeline-minor-modes :modeline-position :modeline-posline :modeline-name-attribute @@ -426,6 +428,9 @@ :inactive-modeline-position-attribute :inactive-modeline-name-attribute :inactive-modeline-posline-attribute + :modeline-version + :modeline-version-attribute + :inactive-modeline-version-attribute :convert-modeline-element) ;; command.lisp (:export diff --git a/src/modeline.lisp b/src/modeline.lisp index 4e59a6da6..b3f6bae97 100644 --- a/src/modeline.lisp +++ b/src/modeline.lisp @@ -39,6 +39,12 @@ (define-attribute inactive-modeline-posline-attribute (t :foreground "black" :background "#505050")) +(define-attribute modeline-version-attribute + (t :foreground "#6a6a6a")) + +(define-attribute inactive-modeline-version-attribute + (t :foreground "#444444")) + (defvar *modeline-status-list* nil) (defun modeline-add-status-list (x &optional (buffer nil bufferp)) @@ -124,6 +130,11 @@ 'modeline-posline-attribute 'inactive-modeline-posline-attribute))) +(defun modeline-version (window) + (declare (ignore window)) + (values (format nil " v~A " (asdf:component-version (asdf:find-system :lem))) + 'modeline-version-attribute)) + (defgeneric convert-modeline-element (element window)) (defmethod convert-modeline-element ((element t) window) From 260e3077a32c6884569839ac6371049db9251611 Mon Sep 17 00:00:00 2001 From: Angel Peralta Date: Fri, 1 May 2026 19:52:23 -0400 Subject: [PATCH 2/3] refactor(dashboard): remove Doom Emacs references from comments and docstrings --- extensions/lem-dashboard/dashboard-items.lisp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/extensions/lem-dashboard/dashboard-items.lisp b/extensions/lem-dashboard/dashboard-items.lisp index 2582b0b0e..11c5a0464 100644 --- a/extensions/lem-dashboard/dashboard-items.lisp +++ b/extensions/lem-dashboard/dashboard-items.lisp @@ -18,10 +18,10 @@ (insert-string point (create-centered-string line) :attribute (item-attribute item)) (insert-character point #\Newline))) -;; Version (Doom Emacs style — centered below splash) +;; Version (defclass dashboard-version (dashboard-item) () - (:documentation "Displays the Lem version string centered, like Doom Emacs.") + (:documentation "Displays the Lem version string centered below the splash.") (:default-initargs :item-attribute 'document-header4-attribute :bottom-margin 1)) From bf96130450f26216d20a08053411757cf6308083 Mon Sep 17 00:00:00 2001 From: Angel Peralta Date: Fri, 1 May 2026 19:54:16 -0400 Subject: [PATCH 3/3] refactor(dashboard): remove unused dashboard-version item class --- extensions/lem-dashboard/dashboard-items.lisp | 14 -------------- 1 file changed, 14 deletions(-) diff --git a/extensions/lem-dashboard/dashboard-items.lisp b/extensions/lem-dashboard/dashboard-items.lisp index 11c5a0464..9017f213c 100644 --- a/extensions/lem-dashboard/dashboard-items.lisp +++ b/extensions/lem-dashboard/dashboard-items.lisp @@ -18,20 +18,6 @@ (insert-string point (create-centered-string line) :attribute (item-attribute item)) (insert-character point #\Newline))) -;; Version -(defclass dashboard-version (dashboard-item) - () - (:documentation "Displays the Lem version string centered below the splash.") - (:default-initargs - :item-attribute 'document-header4-attribute - :bottom-margin 1)) - -(defmethod draw-dashboard-item ((item dashboard-version) point) - (let ((version-str (format nil "v~A" (asdf:component-version (asdf:find-system :lem))))) - (insert-string point (create-centered-string version-str) - :attribute (item-attribute item)) - (insert-character point #\Newline))) - ;; Url (defclass dashboard-url (dashboard-item) ((url :initarg :url :accessor url)