From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!.POSTED!not-for-mail From: YAMAMOTO Mitsuharu Newsgroups: gmane.emacs.bugs Subject: bug#26742: Display bug with composed strings Date: Wed, 03 May 2017 12:50:16 +0900 Organization: Faculty of Science, Chiba University Message-ID: References: NNTP-Posting-Host: blaine.gmane.org Mime-Version: 1.0 (generated by SEMI 1.14.6 - "Maruoka") Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable X-Trace: blaine.gmane.org 1493783480 17443 195.159.176.226 (3 May 2017 03:51:20 GMT) X-Complaints-To: usenet@blaine.gmane.org NNTP-Posting-Date: Wed, 3 May 2017 03:51:20 +0000 (UTC) User-Agent: Wanderlust/2.14.0 (Africa) SEMI/1.14.6 (Maruoka) FLIM/1.14.8 (=?UTF-8?Q?Shij=C5=8D?=) APEL/10.6 Emacs/22.3 (sparc-sun-solaris2.8) MULE/5.0 (SAKAKI) Cc: 26742@debbugs.gnu.org To: =?UTF-8?Q?Cl=C3=A9ment?= Pit--Claudel Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Wed May 03 05:51:13 2017 Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([208.118.235.17]) by blaine.gmane.org with esmtp (Exim 4.84_2) (envelope-from ) id 1d5lJm-0004K5-Ke for geb-bug-gnu-emacs@m.gmane.org; Wed, 03 May 2017 05:51:10 +0200 Original-Received: from localhost ([::1]:34611 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1d5lJp-0008GT-81 for geb-bug-gnu-emacs@m.gmane.org; Tue, 02 May 2017 23:51:13 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:57858) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1d5lJi-0008GO-Fe for bug-gnu-emacs@gnu.org; Tue, 02 May 2017 23:51:07 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1d5lJe-0001fM-J0 for bug-gnu-emacs@gnu.org; Tue, 02 May 2017 23:51:06 -0400 Original-Received: from debbugs.gnu.org ([208.118.235.43]:53584) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1d5lJe-0001es-F0 for bug-gnu-emacs@gnu.org; Tue, 02 May 2017 23:51:02 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1d5lJe-00077R-3Z for bug-gnu-emacs@gnu.org; Tue, 02 May 2017 23:51:02 -0400 X-Loop: help-debbugs@gnu.org Resent-From: YAMAMOTO Mitsuharu Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Wed, 03 May 2017 03:51:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 26742 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: Original-Received: via spool by 26742-submit@debbugs.gnu.org id=B26742.149378342127313 (code B ref 26742); Wed, 03 May 2017 03:51:02 +0000 Original-Received: (at 26742) by debbugs.gnu.org; 3 May 2017 03:50:21 +0000 Original-Received: from localhost ([127.0.0.1]:51782 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1d5lIz-00076T-1X for submit@debbugs.gnu.org; Tue, 02 May 2017 23:50:21 -0400 Original-Received: from mathmail.math.s.chiba-u.ac.jp ([133.82.132.2]:63601) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1d5lIx-00076K-M0 for 26742@debbugs.gnu.org; Tue, 02 May 2017 23:50:20 -0400 Original-Received: from fermat1.math.s.chiba-u.ac.jp (fermat [192.168.32.10]) by mathmail.math.s.chiba-u.ac.jp (Postfix) with ESMTP id 8C8E3F08E4; Wed, 3 May 2017 12:50:16 +0900 (JST) (envelope-from mituharu@math.s.chiba-u.ac.jp) In-Reply-To: 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" Xref: news.gmane.org gmane.emacs.bugs:132208 Archived-At: > If I create a file temp.txt containing the following: > -*- prettify-symbols-alist: (("R_PO" 8477 (Br . cl) 8804)); -*- > !!! R_PO !!! > and run =E2=80=98emacs-24.5 -Q temp.txt -f prettify-symbols-mode=E2=80=99= , I observe > a surprising display bug: when I move the point across the second > line, as soon as the point reaches the blank space after =E2=80=9CR_PO=E2= =80=9D, I > see a second =E2=84=9D displayed instead of the third =E2=80=9C!=E2=80=9D. On the Mac port, the filled box cursor disappears if I move it on the composite characters. The patch below seems to work for this bug. Could you try if it also solves the problems you observe? YAMAMOTO Mitsuharu mituharu@math.s.chiba-u.ac.jp diff --git a/src/xdisp.c b/src/xdisp.c index e3315c4..12ae202 100644 --- a/src/xdisp.c +++ b/src/xdisp.c @@ -24698,6 +24698,20 @@ set_glyph_string_background_width (struct glyph_st= ring *s, int start, int last_x } =20 =20 +/* Return glyph string that shares background with glyph string S and + whose `background_width' member has been set. */ + +static struct glyph_string * +glyph_string_containing_background_width (struct glyph_string *s) +{ + if (s->cmp) + while (s->cmp_from) + s =3D s->prev; + + return s; +} + + /* Compute overhangs and x-positions for glyph string S and its predecessors, or successors. X is the starting x-position for S. BACKWARD_P non-zero means process predecessors. */ @@ -25025,7 +25039,10 @@ draw_glyphs (struct window *w, int x, struct glyph= _row *row, i =3D start; BUILD_GLYPH_STRINGS (i, end, head, tail, hl, x, last_x); if (tail) - x_reached =3D tail->x + tail->background_width; + { + s =3D glyph_string_containing_background_width (tail); + x_reached =3D s->x + s->background_width; + } else x_reached =3D x; =20 @@ -25180,6 +25197,9 @@ draw_glyphs (struct window *w, int x, struct glyph_= row *row, compute_overhangs_and_x (h, tail->x + tail->width, 0); append_glyph_string_lists (&head, &tail, h, t); } + tail =3D glyph_string_containing_background_width (tail); + if (clip_tail) + clip_tail =3D glyph_string_containing_background_width (clip_tail); if (clip_head || clip_tail) for (s =3D head; s; s =3D s->next) {