From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.ciao.gmane.io!not-for-mail From: Eli Zaretskii Newsgroups: gmane.emacs.bugs Subject: bug#39390: 28.0.50; prettify-symbols-mode confuses display when start/end faces are different Date: Mon, 17 Feb 2020 19:30:04 +0200 Message-ID: <83blpxm89v.fsf@gnu.org> References: <3184164c-5d94-6cb3-aca4-338b710bf97f@thaumogen.net> <83eevcj4ar.fsf@gnu.org> <83blqgj285.fsf@gnu.org> <34ca60a0-3658-0e64-b16f-829d914d4b81@thaumogen.net> <837e14iynq.fsf@gnu.org> <27701089-4429-f345-6ecd-4f11d3124a8c@thaumogen.net> <8336bsiwe2.fsf@gnu.org> <83v9onhdq4.fsf@gnu.org> <83o8tymnlk.fsf@gnu.org> <83mu9imitt.fsf@gnu.org> <83lfp2mimd.fsf@gnu.org> <50e865ca-58f4-7111-65de-15be80741357@thaumogen.net> <83k14mmgcq.fsf@gnu.org> <87ftf931kw.fsf@gnu.org> <875zg5432t.fsf@gnu.org> Injection-Info: ciao.gmane.io; posting-host="ciao.gmane.io:159.69.161.202"; logging-data="103672"; mail-complaints-to="usenet@ciao.gmane.io" Cc: knz@thaumogen.net, 39390@debbugs.gnu.org To: Tassilo Horn Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Mon Feb 17 18:31:12 2020 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 1j3kEi-000QqM-NJ for geb-bug-gnu-emacs@m.gmane-mx.org; Mon, 17 Feb 2020 18:31:12 +0100 Original-Received: from localhost ([::1]:49140 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1j3kEh-00085o-BI for geb-bug-gnu-emacs@m.gmane-mx.org; Mon, 17 Feb 2020 12:31:11 -0500 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:37540) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1j3kEZ-00085V-AU for bug-gnu-emacs@gnu.org; Mon, 17 Feb 2020 12:31:04 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1j3kEY-0005k3-AW for bug-gnu-emacs@gnu.org; Mon, 17 Feb 2020 12:31:03 -0500 Original-Received: from debbugs.gnu.org ([209.51.188.43]:33196) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1j3kEY-0005jt-7e for bug-gnu-emacs@gnu.org; Mon, 17 Feb 2020 12:31:02 -0500 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1j3kEY-0008CN-5e for bug-gnu-emacs@gnu.org; Mon, 17 Feb 2020 12:31: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: Mon, 17 Feb 2020 17:31:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 39390 X-GNU-PR-Package: emacs Original-Received: via spool by 39390-submit@debbugs.gnu.org id=B39390.158196060231360 (code B ref 39390); Mon, 17 Feb 2020 17:31:02 +0000 Original-Received: (at 39390) by debbugs.gnu.org; 17 Feb 2020 17:30:02 +0000 Original-Received: from localhost ([127.0.0.1]:39168 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1j3kDZ-00089Z-Uq for submit@debbugs.gnu.org; Mon, 17 Feb 2020 12:30:02 -0500 Original-Received: from eggs.gnu.org ([209.51.188.92]:50569) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1j3kDY-000898-EK for 39390@debbugs.gnu.org; Mon, 17 Feb 2020 12:30:00 -0500 Original-Received: from fencepost.gnu.org ([2001:470:142:3::e]:57134) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1j3kDS-00053o-Am; Mon, 17 Feb 2020 12:29:54 -0500 Original-Received: from [176.228.60.248] (port=3441 helo=home-c4e4a596f7) by fencepost.gnu.org with esmtpsa (TLS1.2:RSA_AES_256_CBC_SHA1:256) (Exim 4.82) (envelope-from ) id 1j3kDP-0007ap-UI; Mon, 17 Feb 2020 12:29:52 -0500 In-reply-to: <875zg5432t.fsf@gnu.org> (message from Tassilo Horn on Mon, 17 Feb 2020 16:59:38 +0100) X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 209.51.188.43 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:176151 Archived-At: > From: Tassilo Horn > Cc: Eli Zaretskii , 39390@debbugs.gnu.org > Date: Mon, 17 Feb 2020 16:59:38 +0100 > > > There is an error in the display code when compose-region composes > > over multiple faces, and I'd like us to focus on that. I'm pretty > > sure that pretty-symbols-mode is just one of multiple ways one can > > trigger this bug. > > Indeed, that's the real problem. I guess that there's an implicit > assumption that composition always takes place in one word or symbol > which is almost always fontified with just one face. Your example > invalidates that assumption. As I explained at the very beginning of this discussion, this is not an assumption, this is part of the basic design of the Emacs display engine: it _never_ considers characters in different faces together, and thus can never compose them. We could perhaps lift this limitation when faces differ only in colors (thus we will be able to support character compositions when part of them are inside a highlighted region), but a face in general specifies also the font, its dimensions, weight, slant, etc., and we cannot possibly combine glyphs that come from different fonts. So this limitation is not really arbitrary, and can only be lifted by a thorough redesign of how the display engine traverses the text it is about to display, and what it does when it meets a composition that crosses face boundaries. Let me also remind you that character composition was introduced for purposes very different from what pretty-symbols-mode does; it definitely wasn't supposed to support arbitrary display of one text as another: for that you have display strings and overlays. > But then the question is how the composition should be displayed? In > your example where you replace "setq abc" with the LAST QUARTER MOON > WITH FACE Unicode character, should that have font-lock-keyword-face > (like setq) or the default face (like abc)? Imagine that font-lock-keyword-face specifies bold-italic typeface, or maybe even a different size of the font, for example. There be dragons.