As with the comment, pos-tip-show
works fine for me too.
I did hack together a better (but not perfect) version of the momentary-string-display
version. I just rewrote the display function so that it deleted the overlay passively through a hook instead of waiting for an exit-char, which doesn't seem appropriate for what you are trying to do. The display function I put together temporarily overwrites the next line of the buffer with the message. See if you like it.
(defvar my-display-overlay nil)
(defun my-delete-string-display ()
(when (overlayp my-display-overlay)
(delete-overlay my-display-overlay))
(remove-hook 'post-command-hook 'my-delete-string-display))
(defun my-string-display-next-line (string)
"Overwrite contents of next line with STRING until next command."
(let ((str (concat
(make-string (1+ (current-indentation)) 32)
(propertize (copy-sequence string) 'face '(:background "#3e4451" :extend t))))
(start-pos nil)
(end-pos nil))
(unwind-protect
(save-excursion
(my-delete-string-display)
(forward-line)
(setq start-pos (point))
(end-of-line)
(setq end-pos (point))
(setq my-display-overlay (make-overlay start-pos end-pos))
;; Hide full line
(overlay-put my-display-overlay 'display "")
;; Display message
(overlay-put my-display-overlay 'before-string str))
(add-hook 'post-command-hook 'my-delete-string-display))))
(defun my-eldoc-display-message-momentary (format-string &rest args)
"Display eldoc message near point."
(when format-string
(my-string-display-next-line (apply 'format format-string args))))
(setq eldoc-message-function #'my-eldoc-display-message-momentary)
pos-tip-show
version andmomentary-string-display
version displays in the same timing on my system, as far as I can tell. Would you also tell me about exceptedexit-char
? What behavior are you looking for?