From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Bertram Felgenhauer Newsgroups: gmane.emacs.bugs Subject: bug#8703: truncated unicode glyphs in X11 Date: Fri, 20 May 2011 13:56:04 +0200 Message-ID: <20110520115604.GA2413@24f89f8c-e6a1-4e75-85ee-bb8a3743bb9f> References: <20110519201702.GA2448@24f89f8c-e6a1-4e75-85ee-bb8a3743bb9f> <83tycpfz78.fsf@gnu.org> NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Trace: dough.gmane.org 1305892637 16039 80.91.229.12 (20 May 2011 11:57:17 GMT) X-Complaints-To: usenet@dough.gmane.org NNTP-Posting-Date: Fri, 20 May 2011 11:57:17 +0000 (UTC) Cc: 8703@debbugs.gnu.org To: Eli Zaretskii Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Fri May 20 13:57:08 2011 Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([140.186.70.17]) by lo.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1QNOKK-0007lq-3Q for geb-bug-gnu-emacs@m.gmane.org; Fri, 20 May 2011 13:57:08 +0200 Original-Received: from localhost ([::1]:54521 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1QNOKJ-0006Zf-52 for geb-bug-gnu-emacs@m.gmane.org; Fri, 20 May 2011 07:57:07 -0400 Original-Received: from eggs.gnu.org ([140.186.70.92]:58615) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1QNOKG-0006ZP-89 for bug-gnu-emacs@gnu.org; Fri, 20 May 2011 07:57:05 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1QNOKF-0004Kk-71 for bug-gnu-emacs@gnu.org; Fri, 20 May 2011 07:57:04 -0400 Original-Received: from debbugs.gnu.org ([140.186.70.43]:54101) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1QNOKF-0004Kf-5L for bug-gnu-emacs@gnu.org; Fri, 20 May 2011 07:57:03 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.69) (envelope-from ) id 1QNOKE-0006P0-6V; Fri, 20 May 2011 07:57:02 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Bertram Felgenhauer Original-Sender: debbugs-submit-bounces@debbugs.gnu.org Resent-To: owner@debbugs.gnu.org Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Fri, 20 May 2011 11:57:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 8703 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: Original-Received: via spool by 8703-submit@debbugs.gnu.org id=B8703.130589257824555 (code B ref 8703); Fri, 20 May 2011 11:57:02 +0000 Original-Received: (at 8703) by debbugs.gnu.org; 20 May 2011 11:56:18 +0000 Original-Received: from localhost ([127.0.0.1] helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1QNOJV-0006O0-5C for submit@debbugs.gnu.org; Fri, 20 May 2011 07:56:17 -0400 Original-Received: from mail-fx0-f44.google.com ([209.85.161.44]) by debbugs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1QNOJS-0006Nj-ID for 8703@debbugs.gnu.org; Fri, 20 May 2011 07:56:15 -0400 Original-Received: by fxm15 with SMTP id 15so2615131fxm.3 for <8703@debbugs.gnu.org>; Fri, 20 May 2011 04:56:08 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=googlemail.com; s=gamma; h=domainkey-signature:date:from:to:cc:subject:message-id:references :mime-version:content-type:content-disposition:in-reply-to :user-agent; bh=7rQHpU0v5H0CmDHgysHnBN8RTq9YJ/ak4O/ThvAHwUs=; b=gAIaOhNokRhGl3QiaHeQ90O/mwGPjbDZBx51SiI7ZM+Vm1wbM20ttkA7u57oaatbA9 u0tqKTReFK/WE8EkLxlqUU/lI6vllhDO/gsp3hxKUoRHwlMP6V0Sexjws6s8DcSwG4jy ZQgwcVfMegwYbCzHm1kSytQQrpkrrJGBBk1IY= DomainKey-Signature: a=rsa-sha1; c=nofws; d=googlemail.com; s=gamma; h=date:from:to:cc:subject:message-id:references:mime-version :content-type:content-disposition:in-reply-to:user-agent; b=nThckfnCdTJwp9GH1Ztzpshm+lm3tNPP9cI1m/FlPKHUHv8zHx9lqtOoQ3JOpV0Ps/ dLyRrhXQOWImtPBBm2LE1jt88hsDPdVIVpc8v33Uv4LcK//SuN+Yy3w8YV5l4rpvcHwn vBQzjn1SUGPzY78g6p/yQJIcqBg1fkOi9wL0g= Original-Received: by 10.223.43.145 with SMTP id w17mr851460fae.12.1305892568739; Fri, 20 May 2011 04:56:08 -0700 (PDT) Original-Received: from bat (lap46-cl-c703.uibk.ac.at [138.232.66.246]) by mx.google.com with ESMTPS id 18sm1418123fan.1.2011.05.20.04.56.06 (version=TLSv1/SSLv3 cipher=OTHER); Fri, 20 May 2011 04:56:07 -0700 (PDT) Content-Disposition: inline In-Reply-To: <83tycpfz78.fsf@gnu.org> User-Agent: Mutt/1.5.21 (2010-09-15) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.11 Precedence: list Resent-Date: Fri, 20 May 2011 07:57:02 -0400 X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6 (newer, 3) X-Received-From: 140.186.70.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:46608 Archived-At: Dear Eli, Eli Zaretskii wrote: > > Date: Thu, 19 May 2011 22:17:02 +0200 > > From: Bertram Felgenhauer > > > > I have tracked down the regression using git-bisect, and found it > > was introduced by > > > > http://git.savannah.gnu.org/cgit/emacs.git/commit/?id=5d747e944fd5a15bb36f865efc214024803c5fcf > > For those using bzr, this is revision 100011 on the emacs-23 branch or > revision 99634.13.1 on the trunk. Perhaps Handa-san could take a look > at this, as he made that change. > > > Undoing a single change restores the correct behaviour for me: > > > > diff --git a/src/xdisp.c b/src/xdisp.c > > index 3c9d385..20365ff 100644 > > --- a/src/xdisp.c > > +++ b/src/xdisp.c > > @@ -5926,8 +5926,7 @@ get_next_display_element (struct it *it) > > : STRINGP (it->string) ? IT_STRING_CHARPOS (*it) > > : IT_CHARPOS (*it)); > > > > - it->face_id = FACE_FOR_CHAR (it->f, face, it->char_to_display, pos, > > - it->string); > > + it->face_id = FACE_FOR_CHAR (it->f, face, it->c, pos, it->string); > > Can you tell what are the values of it->c and it->char_to_display at > this point, for one of the characters hose display is truncated? For the example screenshot, I found the following cases where it->c and it->char_to_display differ: it->c it->char_to_display 8896 (N-ARY LOGICAL AND) 34 (QUOTATION MARK) 8801 (IDENTICAL TO) 32 (SPACE) 10233 (LONG RIGHTWARDS DOUBLE ARROW) 32 (SPACE) it->char_to_display is the previous character in the string each time, and indeed there's a possibility that this path is taken but it->char_to_display was not set by get_next_display_element: when it->what == IT_COMPOSITION and it->cmp_it.ch < 0. The following patch also works for me: diff --git a/src/xdisp.c b/src/xdisp.c index 3c9d385..c9848fd 100644 --- a/src/xdisp.c +++ b/src/xdisp.c @@ -5902,6 +5902,8 @@ get_next_display_element (struct it *it) it->char_to_display = it->c; } } + else if (it->what == IT_COMPOSITION && it->cmp_it.ch < 0) + it->char_to_display = it->c; #ifdef HAVE_WINDOW_SYSTEM /* Adjust face id for a multibyte character. There are no multibyte For completeness: The behaviour seems to be independent of the font being used. I tried with the 6x13 system font (which by its fixed width nature displays fine, btw) and with "DejaVu Sans Mono" which I used for the screenshots (sorry for not mentioning that in the original report.) Thanks, Bertram