summaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
-rw-r--r--init.el4
-rw-r--r--lib/eos/jao-minibuffer.el7
-rw-r--r--lib/eos/jao-mode-line.el29
3 files changed, 32 insertions, 8 deletions
diff --git a/init.el b/init.el
index d3e40c9..56a0afc 100644
--- a/init.el
+++ b/init.el
@@ -466,7 +466,7 @@
(column-number-mode -1)
;;;; jao-mode-line
-(defvar jao-mode-line-in-minibuffer nil)
+(defvar jao-mode-line-in-minibuffer t)
(use-package jao-mode-line
:commands (jao-mode-line-add-to-minibuffer
@@ -475,7 +475,7 @@
(add-hook 'after-init-hook
(lambda ()
(when jao-mode-line-in-minibuffer
- (jao-mode-line-add-to-minibuffer 90))))
+ (jao-mode-line-add-to-minibuffer-left 90))))
;;;; time display
(setq world-clock-list
diff --git a/lib/eos/jao-minibuffer.el b/lib/eos/jao-minibuffer.el
index a2d9f16..71d5976 100644
--- a/lib/eos/jao-minibuffer.el
+++ b/lib/eos/jao-minibuffer.el
@@ -86,7 +86,12 @@
(concat prefix (jao-minibuffer--aligned (+ 3 w)) " " msg))))
(defun jao-minibuffer--set-message (msg)
- (when jao-minibuffer-mode (jao-minibuffer--format-msg (or msg ""))))
+ (when jao-minibuffer-mode
+ (let* ((info (when jao-minibuffer-msg-info
+ (jao-minibuffer--format-info jao-minibuffer-msg-info)))
+ (info (when info (propertize info 'face 'jao-themes-dimm)))
+ (msg (if info (format "%s - %s" info msg) msg)))
+ (jao-minibuffer--format-msg (or msg "")))))
(setq set-message-function #'jao-minibuffer--set-message)
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)