Subject: bug#46177: 27.1; Display problem with minibuffer overlay when using display property

From: Clemens <[email-masked]>
Date: Sat, 30 Jan 2021 10:30:21 +0100

> Better in what sense?
> 
> If you mean a way that prevents the background of the prompt from
> being applied to the text you display via the overlay, I think the
> best/only way is for the overlay string or display string to specify
> the background color.

Yes, I meant to avoid the issue that the minibuffer prompt face gets
applied to strings defined in the display property. The code I posted
simply removes any strings in the display spec and inlines them, which
seems to work well, too. The problem is not only the background color it 
seems, I would need to completely undo the effects of the minibuffer 
prompt face and I don't know how to do that. But what I'm doing now 
works and if there isn't a better solution I'm fine with using it.

I don't understand the reasons for the current behaviour but please
check out the following which seems not appropriate to me:

(set-face-attribute 'minibuffer-prompt nil :foreground "purple")
(minibuffer-with-setup-hook
     (lambda ()
       (overlay-put
        (make-overlay (point-max) (point-max) nil t t)
        'after-string
        (concat " from"
	           (propertize " world"
			       'display
			       " minibuffer"))))
   (read-string "Hello"))

Even with the " from" string between the string defined in the display 
property gets the prompt face applied.