summaryrefslogtreecommitdiffhomepage
path: root/lib/eos/jao-mode-line.el
diff options
context:
space:
mode:
authorjao <jao@gnu.org>2024-03-27 01:02:42 +0000
committerjao <jao@gnu.org>2024-03-27 01:02:42 +0000
commit059b84a559da1219a79aabfdac7485ce755fd159 (patch)
tree4b6c771103d3ae0b282e70dc64a61ddf289ba52c /lib/eos/jao-mode-line.el
parent7dbdc86499fa858239b85883ad2cf09dbcb903e5 (diff)
downloadelibs-059b84a559da1219a79aabfdac7485ce755fd159.tar.gz
elibs-059b84a559da1219a79aabfdac7485ce755fd159.tar.bz2
better mode-line in minibuffer
Diffstat (limited to 'lib/eos/jao-mode-line.el')
-rw-r--r--lib/eos/jao-mode-line.el29
1 files changed, 24 insertions, 5 deletions
diff --git a/lib/eos/jao-mode-line.el b/lib/eos/jao-mode-line.el
index 843e0b4..5d2bcd9 100644
--- a/lib/eos/jao-mode-line.el
+++ b/lib/eos/jao-mode-line.el
@@ -48,10 +48,17 @@
(interactive "P")
(jao-mode-line--face-height 'mode-line-inactive all))
+(defun jao-mode-line--old-str ()
+ (thread-first (format-mode-line jao-mode-line--old-format)
+ (substring-no-properties)
+ (string-trim)))
+
;;;###autoload
(defun jao-mode-line-echo ()
(interactive)
- (message "%s" (format-mode-line mode-line-format)))
+ (message "%s" (jao-mode-line--old-str))
+ (setq-local header-line-format
+ (if header-line-format nil jao-mode-line--old-format)))
;;;###autoload
(defun jao-mode-line-hide-inactive (frame)
@@ -133,18 +140,29 @@
;; :overline bg
:underline ul :extend t)))
-;;;###autoload
-(defun jao-mode-line-add-to-minibuffer (&optional order)
+(defun jao-mode-line--add-to-minibuffer (order msg-p)
(interactive)
(setq jao-mode-line--old-format mode-line-format)
(setq-default mode-line-format '(" "))
(setq-default mode-line-position jao-mode-line--position)
(dolist (b (buffer-list))
(with-current-buffer b (setq-local mode-line-format '(" "))))
- (jao-minibuffer-add-variable 'jao-mode-line--format (or order 90))
+ (if msg-p
+ (jao-minibuffer-add-msg-variable '(jao-mode-line--old-str) (or order 90))
+ (jao-minibuffer-add-variable 'jao-mode-line--format (or order 90)))
(jao-mode-line-adjust-faces))
;;;###autoload
+(defun jao-mode-line-add-to-minibuffer-right (&optional order)
+ (interactive)
+ (jao-mode-line--add-to-minibuffer order nil))
+
+;;;###autoload
+(defun jao-mode-line-add-to-minibuffer-left (&optional order)
+ (interactive)
+ (jao-mode-line--add-to-minibuffer order t))
+
+;;;###autoload
(defun jao-mode-line-remove-from-minibuffer ()
(interactive)
(jao-mode-line--revert-face nil)
@@ -153,7 +171,8 @@
(dolist (b (buffer-list))
(with-current-buffer b
(setq-local mode-line-format jao-mode-line--old-format)))
- (jao-minibuffer-remove-variable 'jao-mode-line--format))
+ (jao-minibuffer-remove-variable 'jao-mode-line--format)
+ (jao-minibuffer-remove-variable '(jao-mode-line--old-str)))
(provide 'jao-mode-line)