From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: don@donarmstrong.com (Emacs bug Tracking System) Newsgroups: gmane.emacs.bugs Subject: bug#1369: marked as done (string-width problem in buff-menu.el) Date: Thu, 20 Nov 2008 07:30:03 -0800 Message-ID: References: NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="----------=_1227195003-20510-0" X-Trace: ger.gmane.org 1227195033 8258 80.91.229.12 (20 Nov 2008 15:30:33 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Thu, 20 Nov 2008 15:30:33 +0000 (UTC) To: Stefan Monnier Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Thu Nov 20 16:31:37 2008 Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([199.232.76.165]) by lo.gmane.org with esmtp (Exim 4.50) id 1L3BVG-0001jV-OD for geb-bug-gnu-emacs@m.gmane.org; Thu, 20 Nov 2008 16:31:36 +0100 Original-Received: from localhost ([127.0.0.1]:40639 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1L3BU7-0007kg-Bc for geb-bug-gnu-emacs@m.gmane.org; Thu, 20 Nov 2008 10:30:23 -0500 Original-Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1L3BU1-0007kP-UZ for bug-gnu-emacs@gnu.org; Thu, 20 Nov 2008 10:30:17 -0500 Original-Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1L3BU1-0007k5-Ex for bug-gnu-emacs@gnu.org; Thu, 20 Nov 2008 10:30:17 -0500 Original-Received: from [199.232.76.173] (port=34252 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1L3BU1-0007k2-7x for bug-gnu-emacs@gnu.org; Thu, 20 Nov 2008 10:30:17 -0500 Original-Received: from rzlab.ucr.edu ([138.23.92.77]:37009) by monty-python.gnu.org with esmtps (TLS-1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.60) (envelope-from ) id 1L3BU0-0007lV-Ie for bug-gnu-emacs@gnu.org; Thu, 20 Nov 2008 10:30:17 -0500 Original-Received: from rzlab.ucr.edu (rzlab.ucr.edu [127.0.0.1]) by rzlab.ucr.edu (8.13.8/8.13.8/Debian-3) with ESMTP id mAKFU9Bk021076; Thu, 20 Nov 2008 07:30:09 -0800 Original-Received: (from debbugs@localhost) by rzlab.ucr.edu (8.13.8/8.13.8/Submit) id mAKFU329020596; Thu, 20 Nov 2008 07:30:03 -0800 X-Mailer: MIME-tools 5.420 (Entity 5.420) X-Loop: don@donarmstrong.com X-Emacs-PR-Message: closed 1369 X-Emacs-PR-Package: emacs X-detected-operating-system: by monty-python.gnu.org: GNU/Linux 2.6 (newer, 3) 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: , Original-Sender: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Errors-To: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.bugs:22524 Archived-At: This is a multi-part message in MIME format... ------------=_1227195003-20510-0 Content-Disposition: inline Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset=utf-8 Your message dated Thu, 20 Nov 2008 10:22:35 -0500 with message-id and subject line Re: bug#1369: string-width problem in buff-menu.el has caused the Emacs bug report #1369, regarding string-width problem in buff-menu.el to be marked as done. This means that you claim that the problem has been dealt with. If this is not the case it is now your responsibility to reopen the bug report if necessary, and/or fix the problem forthwith. (NB: If you are a system administrator and have no idea what this message is talking about, this may indicate a serious mail system misconfiguration somewhere. Please contact don@donarmstrong.com immediately.) --=20 1369: http://emacsbugs.donarmstrong.com/cgi-bin/bugreport.cgi?bug=3D1369 Emacs Bug Tracking System Contact don@donarmstrong.com with problems ------------=_1227195003-20510-0 Content-Type: message/rfc822 Content-Disposition: inline Content-Transfer-Encoding: 7bit X-Spam-Checker-Version: SpamAssassin 3.2.3-bugs.debian.org_2005_01_02 (2007-08-08) on rzlab.ucr.edu X-Spam-Level: X-Spam-Status: No, score=0.6 required=4.0 tests=AWL,BAYES_50,MIME_QP_LONG_LINE, MURPHY_DRUGS_REL8,NEXTPART,RCVD_IN_DNSWL_MED autolearn=no version=3.2.3-bugs.debian.org_2005_01_02 Received: (at submit) by emacsbugs.donarmstrong.com; 18 Nov 2008 15:48:13 +0000 Received: from lists.gnu.org (lists.gnu.org [199.232.76.165]) by rzlab.ucr.edu (8.13.8/8.13.8/Debian-3) with ESMTP id mAIFmATI029571 for ; Tue, 18 Nov 2008 07:48:11 -0800 Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1L2SoE-000732-9x for bug-gnu-emacs@gnu.org; Tue, 18 Nov 2008 10:48:10 -0500 Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1L2SoC-0006yE-DQ for bug-gnu-emacs@gnu.org; Tue, 18 Nov 2008 10:48:09 -0500 Received: from [199.232.76.173] (port=59930 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1L2SoC-0006xy-2O for bug-gnu-emacs@gnu.org; Tue, 18 Nov 2008 10:48:08 -0500 Received: from bay0-omc3-s26.bay0.hotmail.com ([65.54.246.226]:13272) by monty-python.gnu.org with esmtp (Exim 4.60) (envelope-from ) id 1L2SoC-0006lV-5W for bug-gnu-emacs@gnu.org; Tue, 18 Nov 2008 10:48:08 -0500 Received: from hotmail.com ([207.46.10.21]) by bay0-omc3-s26.bay0.hotmail.com with Microsoft SMTPSVC(6.0.3790.3959); Tue, 18 Nov 2008 07:48:05 -0800 Received: from mail pickup service by hotmail.com with Microsoft SMTPSVC; Tue, 18 Nov 2008 07:48:05 -0800 Message-ID: Received: from 124.155.30.210 by BAY121-DAV11.phx.gbl with DAV; Tue, 18 Nov 2008 15:48:02 +0000 X-Originating-IP: [124.155.30.210] X-Originating-Email: [t_tuneyosi@hotmail.com] X-Sender: t_tuneyosi@hotmail.com From: "Toru TSUNEYOSHI" To: Subject: string-width problem in buff-menu.el Date: Wed, 19 Nov 2008 00:48:02 +0900 MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="----=_NextPart_000_0005_01C949E0.79E7DBF0" X-Priority: 3 X-MSMail-Priority: Normal X-Mailer: Microsoft Outlook Express 6.00.2800.1933 X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2800.1933 X-OriginalArrivalTime: 18 Nov 2008 15:48:05.0504 (UTC) FILETIME=[0BE15000:01C94995] X-detected-operating-system: by monty-python.gnu.org: Windows 2000 SP4, XP SP1+ This is a multi-part message in MIME format. ------=_NextPart_000_0005_01C949E0.79E7DBF0 Content-Type: text/plain; charset="iso-2022-jp" Content-Transfer-Encoding: 7bit hello. I found a problem in buff-menu.el. (I use GNU Emacs 22.3.1 (i386-msvc-nt5.0.2195).) `list-buffers' function can't deal with buffer name in multilingual environment. it can't truncate buffer name properly. example: ======================================================================== CRM Buffer Size Mode File .% あいうえおかきくけこさしすせそ 271 Dired by name ~/temp/あいうえおかきくけこさしすせそ/ % あいう 247 Dired by name ~/temp/あいう/ % *GNU Emacs* 669 Fundamental *scratch* 191 Lisp Interaction * *Messages* 691 Fundamental ======================================================================== i made a patch for this problem. please check it. if ok, please apply. ------=_NextPart_000_0005_01C949E0.79E7DBF0 Content-Type: application/octet-stream; name="buff-menu.el.diff" Content-Transfer-Encoding: quoted-printable Content-Disposition: attachment; filename="buff-menu.el.diff" --- buff-menu.el.original 2008-01-07 11:45:02.000000000 +0900=0A= +++ buff-menu.el 2008-11-19 00:23:38.786576000 +0900=0A= @@ -587,21 +587,24 @@=0A= (display-buffer (list-buffers-noselect files-only)))=0A= =0A= (defun Buffer-menu-buffer+size (name size &optional name-props = size-props)=0A= - (if (> (+ (length name) (length size) 2) = Buffer-menu-buffer+size-width)=0A= + (if (> (+ (string-width name) (string-width size) 2) = Buffer-menu-buffer+size-width)=0A= (setq name=0A= (if (string-match "<[0-9]+>$" name)=0A= - (concat (substring name 0=0A= - (- Buffer-menu-buffer+size-width=0A= - (max (length size) 3)=0A= - (match-end 0)=0A= - (- (match-beginning 0))=0A= - 2))=0A= + (concat (truncate-string-to-width name=0A= + (- Buffer-menu-buffer+size-width=0A= + (max (string-width size) 3)=0A= + (string-width (match-string 0))=0A= + 2)=0A= + 0=0A= + ?\s)=0A= ":" ; narrow ellipsis=0A= (match-string 0 name))=0A= - (concat (substring name 0=0A= - (- Buffer-menu-buffer+size-width=0A= - (max (length size) 3)=0A= - 2))=0A= + (concat (truncate-string-to-width name=0A= + (- Buffer-menu-buffer+size-width=0A= + (max (string-width size) 3)=0A= + 2)=0A= + 0=0A= + ?\s)=0A= ":"))) ; narrow ellipsis=0A= ;; Don't put properties on (buffer-name).=0A= (setq name (copy-sequence name)))=0A= @@ -609,8 +612,8 @@=0A= (add-text-properties 0 (length size) size-props size)=0A= (concat name=0A= (make-string (- Buffer-menu-buffer+size-width=0A= - (length name)=0A= - (length size))=0A= + (string-width name)=0A= + (string-width size))=0A= ?\s)=0A= size))=0A= =0A= @@ -825,8 +828,11 @@=0A= mouse-face highlight=0A= help-echo "mouse-2: select this buffer"))=0A= " "=0A= - (if (> (length (nth 4 buffer)) Buffer-menu-mode-width)=0A= - (substring (nth 4 buffer) 0 Buffer-menu-mode-width)=0A= + (if (> (string-width (nth 4 buffer)) Buffer-menu-mode-width)=0A= + (truncate-string-to-width (nth 4 buffer)=0A= + Buffer-menu-mode-width=0A= + 0=0A= + ?\s)=0A= (nth 4 buffer)))=0A= (when (nth 5 buffer)=0A= (indent-to (+ Buffer-menu-buffer-column Buffer-menu-buffer+size-width=0A= ------=_NextPart_000_0005_01C949E0.79E7DBF0-- ------------=_1227195003-20510-0 Content-Type: message/rfc822 Content-Disposition: inline Content-Transfer-Encoding: 7bit X-Spam-Checker-Version: SpamAssassin 3.2.3-bugs.debian.org_2005_01_02 (2007-08-08) on rzlab.ucr.edu X-Spam-Level: X-Spam-Status: No, score=-6.6 required=4.0 tests=AWL,BAYES_00,HAS_BUG_NUMBER, MURPHY_DRUGS_REL8 autolearn=ham version=3.2.3-bugs.debian.org_2005_01_02 Received: (at 1369-done) by emacsbugs.donarmstrong.com; 20 Nov 2008 15:22:39 +0000 Received: from pruche.dit.umontreal.ca (pruche.dit.umontreal.ca [132.204.246.22]) by rzlab.ucr.edu (8.13.8/8.13.8/Debian-3) with ESMTP id mAKFMaSk019148 for <1369-done@emacsbugs.donarmstrong.com>; Thu, 20 Nov 2008 07:22:37 -0800 Received: from ceviche.home (vpn-132-204-232-86.acd.umontreal.ca [132.204.232.86]) by pruche.dit.umontreal.ca (8.14.1/8.14.1) with ESMTP id mAKFNA4v002380; Thu, 20 Nov 2008 10:23:10 -0500 Received: by ceviche.home (Postfix, from userid 20848) id 0F5D4B40D7; Thu, 20 Nov 2008 10:22:35 -0500 (EST) From: Stefan Monnier To: Toru TSUNEYOSHI Cc: 1369-done@emacsbugs.donarmstrong.com Subject: Re: bug#1369: string-width problem in buff-menu.el Message-ID: References: Date: Thu, 20 Nov 2008 10:22:35 -0500 In-Reply-To: (Toru TSUNEYOSHI's message of "Wed, 19 Nov 2008 00:48:02 +0900") User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/23.0.60 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-NAI-Spam-Score: 0 X-NAI-Spam-Rules: 1 Rules triggered RV3151=0 > I found a problem in buff-menu.el. > (I use GNU Emacs 22.3.1 (i386-msvc-nt5.0.2195).) > `list-buffers' function can't deal with buffer name in multilingual > environment. it can't truncate buffer name properly. > i made a patch for this problem. please check it. if ok, please apply. Thank you, applied, Stefan ------------=_1227195003-20510-0--