From f7dd6221829a1efb0445da28114a1481ae3c6aa0 Mon Sep 17 00:00:00 2001 From: jao Date: Fri, 23 Oct 2020 01:39:52 +0100 Subject: jao-minibuffer nits --- misc/jao-minibuffer.el | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) (limited to 'misc') diff --git a/misc/jao-minibuffer.el b/misc/jao-minibuffer.el index 9f28390..e55e5a2 100644 --- a/misc/jao-minibuffer.el +++ b/misc/jao-minibuffer.el @@ -28,7 +28,7 @@ (defvar jao-minibuffer-align-right-p t) (defvar jao-minibuffer-right-margin 2) -;; (setq jao-minibuffer-align-right-p t) +(defconst jao-minibuffer--name " *Minibuf-0*") (defun jao-minibuffer--trim (s w) (if (<= (length s) w) @@ -39,7 +39,8 @@ (let ((msg (format-mode-line jao-minibuffer-info))) (when (not (string-empty-p msg)) (if jao-minibuffer-align-right-p - (let ((w (- (frame-width) (or w 0) jao-minibuffer-right-margin))) + (let* ((mw (window-width (minibuffer-window))) + (w (- mw (or w 0) jao-minibuffer-right-margin))) (if (> w 0) (jao-minibuffer--trim msg w) "")) (concat " ยท " msg))))) @@ -56,7 +57,7 @@ ;;;###autoload (defun jao-minibuffer-refresh () (interactive "") - (with-current-buffer " *Minibuf-0*" + (with-current-buffer jao-minibuffer--name (erase-buffer) (insert (jao-minibuffer--aligned)))) -- cgit v1.2.3