Subject: Re: bug#34939: Some minibuffer behaviour is annoying

From: Juri Linkov <[email-masked]>
Date: Mon, 01 Apr 2019 23:31:27 +0300

>> There is another place where messages conceal the minibuffer:
>> running a version-control command that asks for a branch name
>> and typing TAB for completion runs a command to fetch branch names.
>> Its output conceals the minibuffer when vc-command-messages is non-nil.
>> Here is a fix:
>
> The patch is okay, but wouldn't it be better if 'message', when called from
> the minibuffer, went through command-error-function, or something
> like that?

It's impossible to override ‘message’ with something like

  (advice-add 'message :around
              (lambda (orig-fun &rest args)
                (if (eq (selected-window) (active-minibuffer-window))
                    (apply 'minibuffer-message args)
                  (apply orig-fun args)))
              '((name . message-minibuffer)))

because ‘minibuffer-message’ has ‘message’ calls
and this goes into infinite recursion.