diff options
author | jao <jao@gnu.org> | 2020-12-29 19:45:25 +0000 |
---|---|---|
committer | jao <jao@gnu.org> | 2020-12-29 19:45:25 +0000 |
commit | f2f3cd5c430d73cd0ff87bf9df230b56f364ef80 (patch) | |
tree | 8b0898f71fd62e0bd2c55253dd1ceaad988afee7 /sys | |
parent | 2c87fa26f3a6abb9f12673bc633db11f0cb1b1c7 (diff) | |
download | elibs-f2f3cd5c430d73cd0ff87bf9df230b56f364ef80.tar.gz elibs-f2f3cd5c430d73cd0ff87bf9df230b56f364ef80.tar.bz2 |
jao-minibuffer: configurable fixed frame width (for exwm)
Diffstat (limited to 'sys')
-rw-r--r-- | sys/jao-minibuffer.el | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/sys/jao-minibuffer.el b/sys/jao-minibuffer.el index ed31af9..4d3104c 100644 --- a/sys/jao-minibuffer.el +++ b/sys/jao-minibuffer.el @@ -29,6 +29,7 @@ (defvar jao-minibuffer-align-right-p t) (defvar jao-minibuffer-right-margin (if window-system 0 1)) (defvar jao-minibuffer-maximized-frames-p nil) +(defvar jao-minibuffer-frame-width nil) (defvar jao-minibuffer-notification-timeout 5) (defvar jao-minibuffer-enabled-p t) @@ -44,12 +45,12 @@ (buffer-substring (point-min) (point-max)))) (defun jao-minibuffer--width () - (if jao-minibuffer-maximized-frames-p - (frame-width) - (window-width (minibuffer-window)))) + (cond ((numberp jao-minibuffer-frame-width) jao-minibuffer-frame-width) + (jao-minibuffer-maximized-frames-p (frame-width)) + (t (min (frame-width) (window-width (minibuffer-window)))))) (defun jao-minibuffer--format-info () - (mapconcat 'identity + (mapconcat 'string-trim (seq-filter (lambda (s) (not (string-blank-p s))) (mapcar 'format-mode-line (if jao-minibuffer-align-right-p |