summaryrefslogtreecommitdiffhomepage
path: root/lib
diff options
context:
space:
mode:
authorjao <jao@gnu.org>2021-04-30 23:07:30 +0100
committerjao <jao@gnu.org>2021-04-30 23:07:30 +0100
commitac9201a7d7ebc6dc4e4e8f3a542f7f209be585ee (patch)
treea2fa3d836eb165a75abb609d047b831b5c9cd4f7 /lib
parentbf94f1b767b586580fd664f8406184e0af9ccc86 (diff)
downloadelibs-ac9201a7d7ebc6dc4e4e8f3a542f7f209be585ee.tar.gz
elibs-ac9201a7d7ebc6dc4e4e8f3a542f7f209be585ee.tar.bz2
mode-line in minibuffer
Diffstat (limited to 'lib')
-rw-r--r--lib/eos/jao-minibuffer.el25
1 files changed, 23 insertions, 2 deletions
diff --git a/lib/eos/jao-minibuffer.el b/lib/eos/jao-minibuffer.el
index 263f917..1b64a31 100644
--- a/lib/eos/jao-minibuffer.el
+++ b/lib/eos/jao-minibuffer.el
@@ -89,15 +89,36 @@
(erase-buffer)
(insert msg))))
+(defvar jao-minibuffer--mode-line-format
+ '("%1+%n %o (%2l,%2c) " ;; %z
+ (:propertize " %[%b%] " face mode-line-buffer-id)
+ " ("
+ (:propertize mode-name face jao-themes-f00)
+ (:propertize ("" minor-mode-alist (vc-mode vc-mode)) face jao-themes-dimm)
+ ")"
+ mode-line-misc-info))
+
;;;###autoload
-(defun jao-minibuffer-refresh ()
+(defun jao-minibuffer-refresh (&rest _ignore)
(interactive)
(when jao-minibuffer-enabled-p
(jao-minibuffer--insert (or (jao-minibuffer--aligned) ""))))
;;;###autoload
(defun jao-minibuffer-add-variable (variable-name &optional order)
- (add-to-ordered-list 'jao-minibuffer-info `(:eval ,variable-name) order))
+ (let ((v (if (symbolp variable-name) `(:eval ,variable-name) variable-name)))
+ (setq jao-minibuffer-info (remove v jao-minibuffer-info))
+ (add-to-ordered-list 'jao-minibuffer-info v order)))
+
+;;;###autoload
+(defun jao-minibuffer-add-mode-line (order)
+ (setq-default mode-line-format '(" "))
+ (set-face-attribute 'mode-line nil
+ :box nil :height 1 :background "grey70")
+ (set-face-attribute 'mode-line-inactive nil
+ :box nil :height 1 :background "grey90")
+ (advice-add 'force-mode-line-update :after #'jao-minibuffer-refresh)
+ (jao-minibuffer-add-variable 'jao-minibuffer--mode-line-format order))
(defvar jao-minibuffer--notification-timer nil)