summaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
authorjao <jao@gnu.org>2022-09-23 01:06:24 +0100
committerjao <jao@gnu.org>2022-09-23 01:06:24 +0100
commit463ae961086cbc722034a2f87f2fe0e0f80f298b (patch)
tree64fa344ed8c5a0aecc44a72400ef644c49969e61
parentc4b66e0193357cc7574d905fb523b2f5ef1214d7 (diff)
downloadelibs-463ae961086cbc722034a2f87f2fe0e0f80f298b.tar.gz
elibs-463ae961086cbc722034a2f87f2fe0e0f80f298b.tar.bz2
eldoc improvements; minibuffer aware it uses invisible text sometimes
-rw-r--r--init.el8
-rw-r--r--lib/eos/jao-minibuffer.el5
2 files changed, 9 insertions, 4 deletions
diff --git a/init.el b/init.el
index 5bb2baa..455d03c 100644
--- a/init.el
+++ b/init.el
@@ -422,11 +422,15 @@
;;;; eldoc
(use-package eldoc
:init (setq eldoc-minor-mode-string nil
- eldoc-echo-area-use-multiline-p t
- eldoc-echo-area-prefer-doc-buffer t
+ eldoc-idle-delay 0.1
+ eldoc-echo-area-display-truncation-message nil
+ eldoc-echo-area-use-multiline-p 1
+ eldoc-echo-area-prefer-doc-buffer 'maybe
eldoc-display-functions '(eldoc-display-in-echo-area))
:config (global-eldoc-mode 1))
+(jao-define-attached-buffer "\\*eldoc\\( .*\\)?\\*" 0.33)
+
;; bookmarks
(setq bookmark-default-file "~/.emacs.d/emacs.bmk"
bookmark-fringe-mark nil)
diff --git a/lib/eos/jao-minibuffer.el b/lib/eos/jao-minibuffer.el
index 40dabf4..50c17a8 100644
--- a/lib/eos/jao-minibuffer.el
+++ b/lib/eos/jao-minibuffer.el
@@ -78,9 +78,10 @@
(unless (string-blank-p p) (concat p "\n"))))
(defun jao-minibuffer--format-msg (msg)
- (let* ((msgs (mapcar #'jao-minibuffer--strip-prev (split-string msg "\n")))
+ (let* ((msgs (mapcar #'jao-minibuffer--strip-prev (split-string msg "\n" t)))
+ (msgs (cl-remove-if (lambda (s) (get-text-property 0 'invisible s)) msgs))
(prefix (jao-minibuffer--prefix msgs))
- (msg (car (last msgs)))
+ (msg (or (car (last msgs)) ""))
(w (string-width msg)))
(if jao-minibuffer-align-right
(concat prefix msg (jao-minibuffer--aligned w))