summaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
authorjao <jao@gnu.org>2021-05-02 01:13:08 +0100
committerjao <jao@gnu.org>2021-05-02 01:13:08 +0100
commit48abdda22c0ac82ada3a83ec3ea75075bbc05904 (patch)
tree2766dddf77ec9de13e9d07a904bb74c3786d14d6
parenta2ce609c5bd4fd175b487bfdcbdb34b33457621d (diff)
downloadelibs-48abdda22c0ac82ada3a83ec3ea75075bbc05904.tar.gz
elibs-48abdda22c0ac82ada3a83ec3ea75075bbc05904.tar.bz2
jao-minibuffer: better mode-line in minibuffer
-rw-r--r--init.org2
-rw-r--r--lib/eos/jao-minibuffer.el27
2 files changed, 15 insertions, 14 deletions
diff --git a/init.org b/init.org
index ef27335..167fc00 100644
--- a/init.org
+++ b/init.org
@@ -2861,7 +2861,7 @@
telega-symbol-heavy-checkmark "×"
telega-symbol-verified "*"
telega-mode-line-string-format
- '(" " (:eval (telega-mode-line-unread-unmuted))))
+ '(:eval (telega-mode-line-unread-unmuted)))
(with-eval-after-load "tracking"
(jao-shorten-modes 'telega-chat-mode)
(jao-tracking-face 'telega-tracking))
diff --git a/lib/eos/jao-minibuffer.el b/lib/eos/jao-minibuffer.el
index 1b64a31..599a333 100644
--- a/lib/eos/jao-minibuffer.el
+++ b/lib/eos/jao-minibuffer.el
@@ -84,19 +84,21 @@
" " msg)))))
(defun jao-minibuffer--insert (msg)
- (save-window-excursion
- (with-current-buffer jao-minibuffer--name
- (erase-buffer)
- (insert msg))))
+ (with-current-buffer jao-minibuffer--name
+ (erase-buffer)
+ (insert msg)))
(defvar jao-minibuffer--mode-line-format
- '("%1+%n %o (%2l,%2c) " ;; %z
- (:propertize " %[%b%] " face mode-line-buffer-id)
- " ("
+ '((:propertize " %[%b%]" face mode-line-buffer-id)
+ (:propertize
+ (circe-chat-target (:eval (format " [%d] " (length (circe-channel-nicks))))
+ " ")
+ face jao-themes-dimm)
+ "%+ "
(:propertize mode-name face jao-themes-f00)
- (:propertize ("" minor-mode-alist (vc-mode vc-mode)) face jao-themes-dimm)
- ")"
- mode-line-misc-info))
+ (:propertize ("" minor-mode-alist (vc-mode vc-mode)) face jao-themes-f11)
+ (:propertize ("%n L%l " (-3 "%P")) face jao-themes-f12)
+ global-mode-string))
;;;###autoload
(defun jao-minibuffer-refresh (&rest _ignore)
@@ -106,7 +108,7 @@
;;;###autoload
(defun jao-minibuffer-add-variable (variable-name &optional order)
- (let ((v (if (symbolp variable-name) `(:eval ,variable-name) variable-name)))
+ (let ((v `(:eval ,variable-name)))
(setq jao-minibuffer-info (remove v jao-minibuffer-info))
(add-to-ordered-list 'jao-minibuffer-info v order)))
@@ -118,6 +120,7 @@
(set-face-attribute 'mode-line-inactive nil
:box nil :height 1 :background "grey90")
(advice-add 'force-mode-line-update :after #'jao-minibuffer-refresh)
+ (add-hook 'buffer-list-update-hook #'jao-minibuffer-refresh)
(jao-minibuffer-add-variable 'jao-minibuffer--mode-line-format order))
(defvar jao-minibuffer--notification-timer nil)
@@ -154,7 +157,5 @@
(setq set-message-function #'jao-minibuffer--set-message)
(setq clear-message-function #'jao-minibuffer-refresh)
-(setq resize-mini-windows nil)
-
(provide 'jao-minibuffer)
;;; jao-minibuffer.el ends here