I tried to advice
read-string but nothing worked.
For example, when I called
yes-or-no-p, no advice handlers were called.
Is there general way how to detect that user is interacting with minibuffer? I need it because I have some package which in idle time print some data into minibuffer, problem is, when I interact somehow with minibuffer and wait here for a while, that package will simply print some garbage into it when I need it for something completely different.
EDIT: Currently I use following solution, but its kinda bad, I want something generic.
(advice-add #'yes-or-no-p :around (lambda (oldfun &rest args) ;; eat all messages (setq eldoc-message-function (lambda (&rest args) nil)) (prog1 (apply oldfun args) (setq eldoc-message-function #'eldoc-minibuffer-message))))