emacs-elpa-diffs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[nongnu] elpa/minibar 2bf88ae60a 05/17: While updating, don't exit on in


From: ELPA Syncer
Subject: [nongnu] elpa/minibar 2bf88ae60a 05/17: While updating, don't exit on input, that doesn't work on Emacs 28
Date: Sun, 27 Nov 2022 16:01:37 -0500 (EST)

branch: elpa/minibar
commit 2bf88ae60a2c97990a68c22a4574f7f580c1af2b
Author: Akib Azmain Turja <akib@disroot.org>
Commit: Akib Azmain Turja <akib@disroot.org>

    While updating, don't exit on input, that doesn't work on Emacs 28
---
 minibar.el | 68 ++++++++++++++++++++++++++++++--------------------------------
 1 file changed, 33 insertions(+), 35 deletions(-)

diff --git a/minibar.el b/minibar.el
index 9c1be83056..26cf9d354b 100644
--- a/minibar.el
+++ b/minibar.el
@@ -91,43 +91,41 @@ string to display, or nil in case there is to show."
   (mapconcat #'identity (delete nil (mapcar #'funcall modules))
              minibar-module-separator))
 
-;;;###autoload
 (defun minibar--update ()
   "Update Minibar."
-  (while-no-input
-    (with-temp-buffer
-      (let ((bar "")
-            (width (frame-width (window-frame (minibuffer-window))))
-            (left (minibar--render-group
-                   minibar-group-left))
-            (middle (minibar--render-group
-                     minibar-group-middle))
-            (right (minibar--render-group
-                    minibar-group-right)))
-
-        ;; HACK: Emacs doesn't show the last character on terminal, so
-        ;; decrease the width by one in that case.
-        (unless (display-graphic-p)
-          (setq width (1- width)))
-        (unless (zerop (length left))
-          (setq bar (concat left minibar-group-separator)))
-        (unless (zerop (length middle))
-          (setq bar (concat bar (make-list
-                                (max 0 (- (/ (- width (length middle)) 2)
-                                          (length bar)))
-                                 ? )
-                            middle minibar-group-separator)))
-        (unless (zerop (length right))
-          (setq bar (concat bar (make-list
-                                (max 0 (- width (length right)
-                                          (length bar)))
-                                 ? )
-                            right)))
-        (let ((text (format (format "%%-%i.%is" width width) bar)))
-          (add-face-text-property 0 width 'minibar-face t text)
-          (with-current-buffer (get-buffer-create " *Minibuf-0*")
-            (erase-buffer)
-            (insert text)))))))
+  (with-temp-buffer
+    (let ((bar "")
+          (width (frame-width (window-frame (minibuffer-window))))
+          (left (minibar--render-group
+                 minibar-group-left))
+          (middle (minibar--render-group
+                   minibar-group-middle))
+          (right (minibar--render-group
+                  minibar-group-right)))
+
+      ;; HACK: Emacs doesn't show the last character on terminal, so
+      ;; decrease the width by one in that case.
+      (unless (display-graphic-p)
+        (setq width (1- width)))
+      (unless (zerop (length left))
+        (setq bar (concat left minibar-group-separator)))
+      (unless (zerop (length middle))
+        (setq bar (concat bar (make-list
+                              (max 0 (- (/ (- width (length middle)) 2)
+                                        (length bar)))
+                               ? )
+                          middle minibar-group-separator)))
+      (unless (zerop (length right))
+        (setq bar (concat bar (make-list
+                              (max 0 (- width (length right)
+                                        (length bar)))
+                               ? )
+                          right)))
+      (let ((text (format (format "%%-%i.%is" width width) bar)))
+        (add-face-text-property 0 width 'minibar-face t text)
+        (with-current-buffer (get-buffer-create " *Minibuf-0*")
+          (erase-buffer)
+          (insert text))))))
 
 ;;;###autoload
 (define-minor-mode minibar-mode



reply via email to

[Prev in Thread] Current Thread [Next in Thread]