From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: =?UTF-8?Q?Cl=C3=A9ment?= Pit--Claudel Newsgroups: gmane.emacs.bugs Subject: bug#22323: Font fallback causes inconsistent stacking of faces in overlays with invisible property Date: Thu, 7 Jan 2016 20:19:25 -0500 Message-ID: <568F0E9D.3070200@live.com> References: <568E97E7.2030604@live.com> <831t9t2qrv.fsf@gnu.org> NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="n7ptk6stXuBUbN7CfwCoAa3dXhueD1SaD" X-Trace: ger.gmane.org 1452216081 794 80.91.229.3 (8 Jan 2016 01:21:21 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Fri, 8 Jan 2016 01:21:21 +0000 (UTC) Cc: 22323@debbugs.gnu.org To: Eli Zaretskii Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Fri Jan 08 02:21:10 2016 Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([208.118.235.17]) by plane.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1aHLjp-0002Te-AN for geb-bug-gnu-emacs@m.gmane.org; Fri, 08 Jan 2016 02:21:09 +0100 Original-Received: from localhost ([::1]:33551 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1aHLjo-0000YV-Dp for geb-bug-gnu-emacs@m.gmane.org; Thu, 07 Jan 2016 20:21:08 -0500 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:38226) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1aHLjW-0000W0-QO for bug-gnu-emacs@gnu.org; Thu, 07 Jan 2016 20:21:05 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1aHLik-0000WD-Ly for bug-gnu-emacs@gnu.org; Thu, 07 Jan 2016 20:20:50 -0500 Original-Received: from debbugs.gnu.org ([208.118.235.43]:53868) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1aHLik-0000Vq-H0 for bug-gnu-emacs@gnu.org; Thu, 07 Jan 2016 20:20:02 -0500 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84) (envelope-from ) id 1aHLik-0000F7-4T for bug-gnu-emacs@gnu.org; Thu, 07 Jan 2016 20:20:02 -0500 X-Loop: help-debbugs@gnu.org Resent-From: =?UTF-8?Q?Cl=C3=A9ment?= Pit--Claudel Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Fri, 08 Jan 2016 01:20:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 22323 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: Original-Received: via spool by 22323-submit@debbugs.gnu.org id=B22323.1452215977896 (code B ref 22323); Fri, 08 Jan 2016 01:20:02 +0000 Original-Received: (at 22323) by debbugs.gnu.org; 8 Jan 2016 01:19:37 +0000 Original-Received: from localhost ([127.0.0.1]:42088 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84) (envelope-from ) id 1aHLiL-0000EN-7V for submit@debbugs.gnu.org; Thu, 07 Jan 2016 20:19:37 -0500 Original-Received: from mout.kundenserver.de ([212.227.126.134]:53499) by debbugs.gnu.org with esmtp (Exim 4.84) (envelope-from ) id 1aHLiI-0000E9-TN for 22323@debbugs.gnu.org; Thu, 07 Jan 2016 20:19:36 -0500 Original-Received: from [18.189.101.34] ([18.189.101.34]) by mrelayeu.kundenserver.de (mreue002) with ESMTPSA (Nemesis) id 0MOXA5-1aKO6s1Xlt-005mQA; Fri, 08 Jan 2016 02:19:27 +0100 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:38.0) Gecko/20100101 Thunderbird/38.4.0 In-Reply-To: <831t9t2qrv.fsf@gnu.org> X-Provags-ID: V03:K0:1DsMLTo49bOvolXGrFFRShOzceKDCvUCEZMqgILiGL2v0d+5/0s n+aTBGQ44fa6LGPntJRB8+BWCaoIGy6hnGTO82hkbn1zsSOvpx0FwpW2ml44SfqRymgd6fW Lm2NHjTcllHH8cgzu1LUbAJNv+h/gabarB9QfKVznoa4tlTdiWoXYD44SLvHx7d1iNrqQZR 22C+XSZGKOQFAjeFvf7YQ== X-UI-Out-Filterresults: notjunk:1;V01:K0:jusq2r0z5rU=:ZdTCBc3mmQuYCIt4pKwa5q MfKMfqSsPr4i72iErKbkjvMLrQeRbXhvHE/0+NMcd10mnmXzpA4bHGgUaU7W3n7KyWgXEWD+W Be7ZgODy35NY0DBV9AlBeZ7w6VVRu4YhCMlX27080leJGj11L07FHzwMI+RW74YKxJ+HJPjsB /M4XAUgIiFutLnnV+gx0nlQp+0r42PwHUanhWbw7QCJP8mhN983RwQCK5if8y933tG3EuKJeD 1LOsflKVVSr3U6S2DULP3FhwQXS5suyeZQ/QxPnPG0stoNvxaJPACt3Q5Iu9aGVRpnHB50OWs KywfgjntXh8b9298lFM0x559hbjj+lggcmy+C9efS2ybwDk1otdDOk3Mbiw3cvNe6FYl/1hq3 73xKzAxZ0lleo9faM5lJsxbqnedbRZ3dy8mR/XKeSCP4JFyL0cJcKgEJcO3mLD+zs86yXpgXL 5G3qqxpl8FOwvktFhlP7OP5uoUk9k5HyvjNSV4Ai3kvXDAIFjtKHQdA9ohqaXoWyUXrHZZlPE ox+VAt7wC1eMje1yTdNLGLx9MbD0JzYrMdROwKPSk9oblH59FzaHhBGgh3TpOPm8JpfGFl1Da oW3F6AaGHGJXeVTJudZ+c2ooaNb8wXn8CIC7Rw3POUcSGlLq9A/L9E4I75VMzGNY+Tlp0ABQe 8EliZcSKWAqV/zp5FD/s9ef7QahPGvkQqxdmAfIaEJvZzDx59pgGA2DFdU7+lnlx2oRU= 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: 208.118.235.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.org@gnu.org Original-Sender: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.bugs:111344 Archived-At: This is an OpenPGP/MIME signed message (RFC 4880 and 3156) --n7ptk6stXuBUbN7CfwCoAa3dXhueD1SaD Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable On 01/07/2016 04:02 PM, Eli Zaretskii wrote: >> Date: Thu, 07 Jan 2016 22:12:42 +0200 >> From: Eli Zaretskii >> Cc: 22320@debbugs.gnu.org >> >>> The same problems exist for composition, but keeping the properties o= f the first character seems to work well there; maybe we could consider h= armonizing both behaviors? >> >> I'm not sure I understand what exactly are you proposing to do. We >> cannot treat invisible text like we treat character compositions, each= >> one invokes a very different machinery with distinct and very >> different features. >=20 > Here's a suggestion: ignore the face of the invisible text altogether, > and instead always use the face of the last visible character. The > patch to do that is below; it fixes all of your test cases. But since > you would like to see the face of the invisible text show through, I'm > not sure you will like it... >=20 > WDYT? I like it :) I find it much more consistent that what we currently have. = Plus, has a desirable property that you pointed out and that I agree with, that= the properties of the invisible text do not affect the display of the ellipsi= s. The current implementation doesn't have that property (adding a face to a hid= den character will cause the ellipsis to change to the default face), so I th= ink it's a net gain. (In fact, I'm even a bit surprised that it handles the selection and font= fallback cases properly. It's great that it does though; but did I apply = the patch incorrectly?) Cl=C3=A9ment. > diff --git a/src/xdisp.c b/src/xdisp.c > index 87a92fc..7e5f7df 100644 > --- a/src/xdisp.c > +++ b/src/xdisp.c > @@ -4583,14 +4583,15 @@ setup_for_ellipsis (struct it *it, int len) > it->current.dpvec_index =3D 0; > it->dpvec_face_id =3D -1; > =20 > - /* Reset the current face ID to default if the last visible > - character and the first invisible character have different faces.= > - IT->saved_face_id was set in handle_stop to the face of the > - preceding character, and will be different from IT->face_id only > - if the invisible text skipped in handle_invisible_prop has some > - non-default face. IT's face is restored in set_iterator_to_next.= */ > - if (it->saved_face_id < 0 || it->saved_face_id !=3D it->face_id) > - it->saved_face_id =3D it->face_id =3D DEFAULT_FACE_ID; > + /* Use IT->saved_face_id for the ellipsis, so that it has the same > + face as the preceding text. IT->saved_face_id was set in > + handle_stop to the face of the preceding character, and will be > + different from IT->face_id only if the invisible text skipped in > + handle_invisible_prop has some non-default face. We thus ignore > + the face of the invisible text when we display the ellipsis. > + IT's face is restored in set_iterator_to_next. */ > + if (it->saved_face_id >=3D 0) > + it->face_id =3D it->saved_face_id; > =20 > /* If the ellipsis represents buffer text, it means we advanced in > the buffer, so we should no longer ignore overlay strings. */ >=20 >=20 --n7ptk6stXuBUbN7CfwCoAa3dXhueD1SaD Content-Type: application/pgp-signature; name="signature.asc" Content-Description: OpenPGP digital signature Content-Disposition: attachment; filename="signature.asc" -----BEGIN PGP SIGNATURE----- Version: GnuPG v2.0.22 (GNU/Linux) iQIcBAEBAgAGBQJWjw6dAAoJEPqg+cTm90wjpVgQAKhSSRrt7atan4+26VcGiR0V aFVc+CaZ7J9fj14GoucjBV9t1KHthU8q/NUhd8RMqvZvq1mmfLEiCK5hUYD8Lzlb vObVqMvkWya+HF36KC9b9IG+eez+1RJz1sNa5cBCQolQfMSD5NeSA7zD3K0pyw4z 0boU/QMcLcc4B3cRarohNBFozPiXdyr+xuJWT5zjwfTHOodtiU5Pf3x+Ap3MLVpp DeoNbpWEBjYEkRrHzoGFQfrfvfIGBQnUD9wlfIXl7brsXduIORItlHPqeNHDVsQt 4wPF6gzow5Oh3+98qh+PcNVcuxghthtGqwIrV+Xaj9fWnw7zsCLH+UX2oPAlHIJ8 rwbYC0Z1/f9ypbfi4+LLW0cZevufUoOCPdmm3tYIzhAQw7EUcVq82iI0DOWFqH5B 529peL0J6eo4XMWnlVNCNH7BF33Go2g35pyRHQwMjZEE7TVZu/LvumQbI9Gv1SXE hNxdINEPfXgxBXyeqr/GrtYVYClbjrPAOxavzI6YmAsx4/1Ma5p267zlta+FJt6c g4w2Wmm5kV+cappK2TVHpSmeWcfBPa8T97BsrZBxiBC5JZF4h/H4y3F83C3Vwg89 ivfmpGkJtsA4D148to+paAMb60F4I48tJubcQH9WXkhL4kqKBF6cZiXg4S6fzEnO q4tSaf477yClvHSZavz8 =FZsP -----END PGP SIGNATURE----- --n7ptk6stXuBUbN7CfwCoAa3dXhueD1SaD--