GNU bug report logs - #46177
27.1; Display problem with minibuffer overlay when using display property

Previous Next

Package: emacs;

Reported by: Clemens <clemens.radermacher <at> posteo.de>

Date: Fri, 29 Jan 2021 18:00:01 UTC

Severity: normal

Found in version 27.1

Done: Clemens <clemens.radermacher <at> posteo.de>

Bug is archived. No further changes may be made.

Full log


Message #14 received at 46177 <at> debbugs.gnu.org (full text, mbox):

From: Eli Zaretskii <eliz <at> gnu.org>
To: Clemens <clemens.radermacher <at> posteo.de>
Cc: 46177 <at> debbugs.gnu.org
Subject: Re: bug#46177: 27.1; Display problem with minibuffer overlay when
 using display property
Date: Sat, 30 Jan 2021 10:26:47 +0200
> Cc: 46177 <at> debbugs.gnu.org
> From: Clemens <clemens.radermacher <at> 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.




This bug report was last modified 4 years and 111 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.