From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Eli Zaretskii Newsgroups: gmane.emacs.bugs Subject: bug#46177: 27.1; Display problem with minibuffer overlay when using display property Date: Sat, 30 Jan 2021 10:26:47 +0200 Message-ID: <83czxmakzc.fsf@gnu.org> References: <453b0490-261a-9e80-5d0c-8b3e4ba6d9f0@posteo.de> <83mtwry4h3.fsf@gnu.org> Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="5714"; mail-complaints-to="usenet@ciao.gmane.io" Cc: 46177@debbugs.gnu.org To: Clemens Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Sat Jan 30 09:27:16 2021 Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane-mx.org Original-Received: from lists.gnu.org ([209.51.188.17]) by ciao.gmane.io with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1l5lb9-0001NS-FL for geb-bug-gnu-emacs@m.gmane-mx.org; Sat, 30 Jan 2021 09:27:15 +0100 Original-Received: from localhost ([::1]:36128 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1l5lb8-0008Be-2F for geb-bug-gnu-emacs@m.gmane-mx.org; Sat, 30 Jan 2021 03:27:14 -0500 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:46840) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1l5law-0008BU-KY for bug-gnu-emacs@gnu.org; Sat, 30 Jan 2021 03:27:02 -0500 Original-Received: from debbugs.gnu.org ([209.51.188.43]:42060) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1l5law-0003bT-Cw for bug-gnu-emacs@gnu.org; Sat, 30 Jan 2021 03:27:02 -0500 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1l5law-0000CT-6t for bug-gnu-emacs@gnu.org; Sat, 30 Jan 2021 03:27:02 -0500 X-Loop: help-debbugs@gnu.org Resent-From: Eli Zaretskii Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Sat, 30 Jan 2021 08:27:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 46177 X-GNU-PR-Package: emacs Original-Received: via spool by 46177-submit@debbugs.gnu.org id=B46177.1611995196733 (code B ref 46177); Sat, 30 Jan 2021 08:27:02 +0000 Original-Received: (at 46177) by debbugs.gnu.org; 30 Jan 2021 08:26:36 +0000 Original-Received: from localhost ([127.0.0.1]:53606 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1l5laV-0000Bk-Qk for submit@debbugs.gnu.org; Sat, 30 Jan 2021 03:26:36 -0500 Original-Received: from eggs.gnu.org ([209.51.188.92]:57138) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1l5laT-0000BX-IX for 46177@debbugs.gnu.org; Sat, 30 Jan 2021 03:26:34 -0500 Original-Received: from fencepost.gnu.org ([2001:470:142:3::e]:40282) by eggs.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1l5laN-0003MJ-5T; Sat, 30 Jan 2021 03:26:27 -0500 Original-Received: from 84.94.185.95.cable.012.net.il ([84.94.185.95]:3580 helo=home-c4e4a596f7) by fencepost.gnu.org with esmtpsa (TLS1.2:RSA_AES_256_CBC_SHA1:256) (Exim 4.82) (envelope-from ) id 1l5laL-0000m5-WE; Sat, 30 Jan 2021 03:26:26 -0500 In-Reply-To: (message from Clemens on Fri, 29 Jan 2021 21:26:26 +0100) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-BeenThere: bug-gnu-emacs@gnu.org List-Id: "Bug reports for GNU Emacs, the Swiss army knife of text editors" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Original-Sender: "bug-gnu-emacs" Xref: news.gmane.io gmane.emacs.bugs:198915 Archived-At: > Cc: 46177@debbugs.gnu.org > From: Clemens > 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.