From ccb4bf0c36249c71b546ff12216fdcb7a6407ae7 Mon Sep 17 00:00:00 2001 From: Lucien Cartier-Tilet Date: Thu, 29 Apr 2021 20:07:16 +0200 Subject: [PATCH] Add autoload, banner updater and correct require --- eshell-info-banner.el | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/eshell-info-banner.el b/eshell-info-banner.el index 2dccc49..bec0bd3 100644 --- a/eshell-info-banner.el +++ b/eshell-info-banner.el @@ -30,6 +30,7 @@ (require 'cl-lib) (require 'dash) (require 'f) +(require 'em-banner) ; Groups ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; @@ -179,6 +180,7 @@ the left side of the banner." (len (max (length path) len))) (eshell-info-banner--get-longest-path (cdr partitions) len))))) +;; FIXME: There’s apparently an issue here selecting faces (defun eshell-info-banner--get-color-percentage (percentage) "Display a `PERCENTAGE' with its according face." (let ((percentage (if (stringp percentage) @@ -259,6 +261,7 @@ See also `eshell-info-banner--display-memory'." (number-to-string percentage) :inherit (eshell-info-banner--get-color-percentage percentage)))))) +;;;###autoload (defun eshell-info-banner () "Banner for Eshell displaying system information." (let* ((partitions (eshell-info-banner--get-mounted-partitions)) @@ -322,6 +325,9 @@ See also `eshell-info-banner--display-memory'." "\n") (format "\n%s\n" (s-repeat tot-width eshell-info-banner-progress-bar-char))))) +(defun eshell-info-banner-update-banner () + "Update the Eshell banner." + (setq eshell-banner-message (eshell-info-banner))) (provide 'eshell-info-banner)