diff options
author | jao <jao@gnu.org> | 2020-10-23 01:39:52 +0100 |
---|---|---|
committer | jao <jao@gnu.org> | 2020-10-23 01:39:52 +0100 |
commit | f7dd6221829a1efb0445da28114a1481ae3c6aa0 (patch) | |
tree | 0a1837a352d72596896a4bd8d923c73b87fa6f84 | |
parent | b01f6773aeb9bc58e55d71e86f9c0afdb66ae8aa (diff) | |
download | elibs-f7dd6221829a1efb0445da28114a1481ae3c6aa0.tar.gz elibs-f7dd6221829a1efb0445da28114a1481ae3c6aa0.tar.bz2 |
jao-minibuffer nits
-rw-r--r-- | misc/jao-minibuffer.el | 7 |
1 files changed, 4 insertions, 3 deletions
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)))) |