summaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
authorjao <jao@gnu.org>2020-11-18 23:40:28 +0000
committerjao <jao@gnu.org>2020-11-18 23:40:28 +0000
commit97b08a6dcf48b1b607b6d4b0a9f0a064c8796b5f (patch)
tree97f8c75411c3fc2970c164f57759870325172f68
parent7911d5bc6761be4d772a8a28a680965ec6b4cd9e (diff)
downloadelibs-97b08a6dcf48b1b607b6d4b0a9f0a064c8796b5f.tar.gz
elibs-97b08a6dcf48b1b607b6d4b0a9f0a064c8796b5f.tar.bz2
minibuffer improvements
-rw-r--r--misc/jao-minibuffer.el14
1 files changed, 8 insertions, 6 deletions
diff --git a/misc/jao-minibuffer.el b/misc/jao-minibuffer.el
index 746a925..132566a 100644
--- a/misc/jao-minibuffer.el
+++ b/misc/jao-minibuffer.el
@@ -27,7 +27,7 @@
(defvar jao-minibuffer-info ())
(defvar jao-minibuffer-notification nil)
(defvar jao-minibuffer-align-right-p t)
-(defvar jao-minibuffer-right-margin 2)
+(defvar jao-minibuffer-right-margin (if window-system 0 1))
(defvar jao-minibuffer-maximized-frames-p t)
(defconst jao-minibuffer--name " *Minibuf-0*")
@@ -42,10 +42,11 @@
(buffer-substring (point-min) (point-max))))
(defun jao-minibuffer--aligned (&optional w currentp)
- (let ((msg (string-trim (if currentp
- (jao-minibuffer--current)
- (format-mode-line (or jao-minibuffer-notification
- jao-minibuffer-info))))))
+ (let* ((msg (if currentp
+ (jao-minibuffer--current)
+ (format-mode-line (or jao-minibuffer-notification
+ jao-minibuffer-info))))
+ (msg (propertize (string-trim msg) :minibuffer-message t)))
(when (not (string-empty-p msg))
(if jao-minibuffer-align-right-p
(let* ((mw (if jao-minibuffer-maximized-frames-p
@@ -57,7 +58,7 @@
(concat " ยท " msg)))))
(defun jao-minibuffer--set-message (msg)
- (let ((msg (replace-regexp-in-string "\n" " " msg)))
+ (let ((msg (string-trim (replace-regexp-in-string "\n" " " msg))))
(concat msg (jao-minibuffer--aligned (length msg) t))))
;;;###autoload
@@ -84,6 +85,7 @@
(setq set-message-function #'jao-minibuffer--set-message)
(setq clear-message-function #'jao-minibuffer-refresh)
+(setq resize-mini-windows nil)
(provide 'jao-minibuffer)
;;; jao-minibuffer.el ends here