From: YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
To: "Clément Pit--Claudel" <clement.pitclaudel@live.com>
Cc: 26742@debbugs.gnu.org
Subject: bug#26742: Display bug with composed strings
Date: Wed, 03 May 2017 12:50:16 +0900 [thread overview]
Message-ID: <wlr306r43r.wl%mituharu@math.s.chiba-u.ac.jp> (raw)
In-Reply-To: <b12f6014-026f-760c-e9ad-e8134133f155@live.com>
> If I create a file temp.txt containing the following:
> -*- prettify-symbols-alist: (("R_PO" 8477 (Br . cl) 8804)); -*-
> !!! R_PO !!!
> and run ‘emacs-24.5 -Q temp.txt -f prettify-symbols-mode’, 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 “R_PO”, I
> see a second ℝ displayed instead of the third “!”.
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_string *s, int start, int last_x
}
+/* 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 = 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 = start;
BUILD_GLYPH_STRINGS (i, end, head, tail, hl, x, last_x);
if (tail)
- x_reached = tail->x + tail->background_width;
+ {
+ s = glyph_string_containing_background_width (tail);
+ x_reached = s->x + s->background_width;
+ }
else
x_reached = x;
@@ -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 = glyph_string_containing_background_width (tail);
+ if (clip_tail)
+ clip_tail = glyph_string_containing_background_width (clip_tail);
if (clip_head || clip_tail)
for (s = head; s; s = s->next)
{
next prev parent reply other threads:[~2017-05-03 3:50 UTC|newest]
Thread overview: 24+ messages / expand[flat|nested] mbox.gz Atom feed top
2017-05-02 6:58 bug#26742: Display bug with composed strings Clément Pit--Claudel
2017-05-02 8:15 ` Eli Zaretskii
2017-05-02 15:40 ` Clément Pit--Claudel
2017-05-02 16:46 ` Eli Zaretskii
2017-05-02 17:18 ` Andreas Schwab
2017-05-02 17:53 ` Eli Zaretskii
2017-05-02 19:02 ` Andreas Schwab
2017-05-02 19:08 ` Eli Zaretskii
2017-05-02 17:22 ` Clément Pit--Claudel
2017-05-02 17:57 ` Eli Zaretskii
2017-05-02 18:20 ` Eli Zaretskii
2017-05-02 19:06 ` Andreas Schwab
2017-05-02 20:01 ` Eli Zaretskii
2017-05-03 5:15 ` Clément Pit--Claudel
2017-05-03 5:20 ` Clément Pit--Claudel
2017-05-03 14:50 ` Eli Zaretskii
2017-05-03 3:50 ` YAMAMOTO Mitsuharu [this message]
2017-05-03 14:42 ` Eli Zaretskii
2017-05-03 16:53 ` Andreas Schwab
2017-05-04 5:39 ` YAMAMOTO Mitsuharu
2017-05-04 6:30 ` YAMAMOTO Mitsuharu
2017-05-04 16:21 ` Andreas Schwab
2017-05-04 22:40 ` Clément Pit--Claudel
2017-05-07 23:41 ` mituharu
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=wlr306r43r.wl%mituharu@math.s.chiba-u.ac.jp \
--to=mituharu@math.s.chiba-u.ac.jp \
--cc=26742@debbugs.gnu.org \
--cc=clement.pitclaudel@live.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
Code repositories for project(s) associated with this external index
https://git.savannah.gnu.org/cgit/emacs.git
https://git.savannah.gnu.org/cgit/emacs/org-mode.git
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.