From mboxrd@z Thu Jan 1 00:00:00 1970 Path: main.gmane.org!not-for-mail From: Sun Yijiang Newsgroups: gmane.emacs.bugs Subject: GNU Emacs bugfix commit Date: Sat, 16 Oct 2004 03:41:02 +0800 Sender: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Message-ID: <5065e2900410151241432714a7@mail.gmail.com> Reply-To: Sun Yijiang NNTP-Posting-Host: deer.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit X-Trace: sea.gmane.org 1097869353 31672 80.91.229.6 (15 Oct 2004 19:42:33 GMT) X-Complaints-To: usenet@sea.gmane.org NNTP-Posting-Date: Fri, 15 Oct 2004 19:42:33 +0000 (UTC) Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Fri Oct 15 21:42:27 2004 Return-path: Original-Received: from lists.gnu.org ([199.232.76.165]) by deer.gmane.org with esmtp (Exim 3.35 #1 (Debian)) id 1CIXy7-00055I-00 for ; Fri, 15 Oct 2004 21:42:27 +0200 Original-Received: from localhost ([127.0.0.1] helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.33) id 1CIY5G-0002gL-VA for geb-bug-gnu-emacs@m.gmane.org; Fri, 15 Oct 2004 15:49:51 -0400 Original-Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.33) id 1CIY5G-0002g9-5c for bug-gnu-emacs@gnu.org; Fri, 15 Oct 2004 15:49:50 -0400 Original-Received: from exim by lists.gnu.org with spam-scanned (Exim 4.33) id 1CIY5F-0002fr-Gj for bug-gnu-emacs@gnu.org; Fri, 15 Oct 2004 15:49:49 -0400 Original-Received: from [199.232.76.173] (helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.33) id 1CIY5F-0002fh-Cr for bug-gnu-emacs@gnu.org; Fri, 15 Oct 2004 15:49:49 -0400 Original-Received: from [64.233.170.205] (helo=mproxy.gmail.com) by monty-python.gnu.org with esmtp (Exim 4.34) id 1CIXxI-0008DF-Uu for bug-gnu-emacs@gnu.org; Fri, 15 Oct 2004 15:41:38 -0400 Original-Received: by mproxy.gmail.com with SMTP id 74so14739rnl for ; Fri, 15 Oct 2004 12:41:36 -0700 (PDT) DomainKey-Signature: a=rsa-sha1; c=nofws; s=beta; d=gmail.com; h=received:message-id:date:from:reply-to:to:subject:mime-version:content-type:content-transfer-encoding; b=OMw4cHl/YUFBc67pGrV8WA31i1BpTFdI++uUg6pWcH7V6Xkrve5PiD7cHsBUHG3vvBQclniqEb6lD0EOSkDYo576/cIGoBkoVCkyE/vqjoywZxIqBJuMRPCXu0SIoawg5bkFFSaZMPhh5MzBhWxGnKUZ9ORYyziaK9f9IZTa4W0 Original-Received: by 10.38.181.77 with SMTP id d77mr396995rnf; Fri, 15 Oct 2004 12:41:02 -0700 (PDT) Original-Received: by 10.38.24.16 with HTTP; Fri, 15 Oct 2004 12:41:02 -0700 (PDT) Original-To: bug-gnu-emacs@gnu.org X-BeenThere: bug-gnu-emacs@gnu.org X-Mailman-Version: 2.1.5 Precedence: list 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 Xref: main.gmane.org gmane.emacs.bugs:9330 X-Report-Spam: http://spam.gmane.org/gmane.emacs.bugs:9330 When Emacs' frame title format is set to buffer-file-name, and there are chinese characters in it, the title will loss characters. The number of the lossed characters is exactly the number of chinese characters in the title. This is cause by the miscalculated variable `prec' in function `display_mode_element' in xdisp.c. The current source uses function `chars_in_tex' which returns the number of characters in the string, but what we really need is the string's width (you see, that's why), so I think this guy should be replaced with `strwidth'. I've made a test, and then everything is OK. Sun Yijiang