bug-gnu-emacs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

bug#46177: 27.1; Display problem with minibuffer overlay when using disp


From: Eli Zaretskii
Subject: bug#46177: 27.1; Display problem with minibuffer overlay when using display property
Date: Sat, 30 Jan 2021 10:26:47 +0200

> Cc: 46177@debbugs.gnu.org
> From: Clemens <clemens.radermacher@posteo.de>
> Date: Fri, 29 Jan 2021 21:26:26 +0100
> 
> > That's a feature: Emacs treats display strings and overlay strings
> > differently for the purposes of face merging.
> 
> Okay, thanks. I have a problem with this when displaying completion 
> candidates in the minibuffer. The candidates are displayed via 
> `after-string` overlay. The candidates are provided by the caller and 
> can contain the `display` property. Right now I "inline" any parts of 
> the string that use `display` to avoid this:
> 
> 
> (defun selectrum--display-string (str)
>    "Return display string of STR."
>    (let ((len (length str))
>          (display "")
>          (start 0)
>          (end 0))
>      (while (not (eq len end))
>        (setq end (next-single-property-change start 'display str len))
>        (let ((val  (get-text-property start 'display str)))
>          (if (and val (stringp val))
>              (setq display (concat display val))
>            (setq display (concat display (substring str start end)))))
>        (setq start end))
>      display))
> 
> 
> Is there a better way?

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.





reply via email to

[Prev in Thread] Current Thread [Next in Thread]