From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!.POSTED!not-for-mail From: Liu Hui Newsgroups: gmane.emacs.bugs Subject: bug#24972: 26.0.50; Multibyte characters are misaligned in ibuffer Date: Tue, 22 Nov 2016 14:54:06 +0800 Message-ID: <6741c150-d985-26a3-5872-cd25e3b5ce02@gmail.com> References: <87bmxa2d2v.fsf@udel.edu> <39442582-6036-47de-1a7a-4d46e43496c1@gmail.com> <20161121093545.GA1654@holos.localdomain> <1dbeb208-b7b5-e445-1946-c71aec1660da@gmail.com> <20161122051216.GA14073@holos.localdomain> NNTP-Posting-Host: blaine.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 8bit X-Trace: blaine.gmane.org 1479797720 6525 195.159.176.226 (22 Nov 2016 06:55:20 GMT) X-Complaints-To: usenet@blaine.gmane.org NNTP-Posting-Date: Tue, 22 Nov 2016 06:55:20 +0000 (UTC) User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:45.0) Gecko/20100101 Thunderbird/45.3.0 Cc: 24972@debbugs.gnu.org To: Mark Oteiza Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Tue Nov 22 07:55:16 2016 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 1c94yz-0000IT-4Q for geb-bug-gnu-emacs@m.gmane.org; Tue, 22 Nov 2016 07:55:09 +0100 Original-Received: from localhost ([::1]:53570 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1c94z2-0000nk-KD for geb-bug-gnu-emacs@m.gmane.org; Tue, 22 Nov 2016 01:55:12 -0500 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:44367) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1c94yw-0000mB-1q for bug-gnu-emacs@gnu.org; Tue, 22 Nov 2016 01:55:07 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1c94ys-00060v-SD for bug-gnu-emacs@gnu.org; Tue, 22 Nov 2016 01:55:06 -0500 Original-Received: from debbugs.gnu.org ([208.118.235.43]:50560) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1c94ys-00060T-Ov for bug-gnu-emacs@gnu.org; Tue, 22 Nov 2016 01:55:02 -0500 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1c94ys-00044m-FC for bug-gnu-emacs@gnu.org; Tue, 22 Nov 2016 01:55:02 -0500 X-Loop: help-debbugs@gnu.org Resent-From: Liu Hui Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Tue, 22 Nov 2016 06:55:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 24972 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: Original-Received: via spool by 24972-submit@debbugs.gnu.org id=B24972.147979766315616 (code B ref 24972); Tue, 22 Nov 2016 06:55:02 +0000 Original-Received: (at 24972) by debbugs.gnu.org; 22 Nov 2016 06:54:23 +0000 Original-Received: from localhost ([127.0.0.1]:37726 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1c94yE-00043n-TX for submit@debbugs.gnu.org; Tue, 22 Nov 2016 01:54:23 -0500 Original-Received: from mail-pg0-f68.google.com ([74.125.83.68]:33531) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1c94yD-00043a-LK for 24972@debbugs.gnu.org; Tue, 22 Nov 2016 01:54:21 -0500 Original-Received: by mail-pg0-f68.google.com with SMTP id 3so1207138pgd.0 for <24972@debbugs.gnu.org>; Mon, 21 Nov 2016 22:54:21 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=subject:to:references:from:cc:message-id:date:user-agent :mime-version:in-reply-to:content-transfer-encoding; bh=PSU7uQFMs7XMnhJCX+nZ6TNt48xj9FEl9jLEnl6IYKo=; b=0K64V4P199HvZQrcHs60GQ92F6K0jIrurl10sfIG5ATg6U0X7t59/VIi6YUge7XSjD tUS+gTSNL+BVbGvSb5+PBGobkRRvTnS1Y45qdtk7Cug6QUzhm3INAxfEmGQubPEHumKh zuy1ELDI5lL1Khbo34iTR1ht5jfMduozhuKyPMU6lFunLode94nXypsMeLR48kK1QGZo /b2RBcN5Cd9IPo4XtY8g4Uj3mlYC+7gC9gFEgxJyvYB3P+J1164EX6qYvUsgIUy7eoVF whwkqNm6D656+Iq79vlrZ2duG7PZr7oM6a2N2U/++FUGPmTJ7JcRoWSpPLpwanjenO/+ YJ/w== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:subject:to:references:from:cc:message-id:date :user-agent:mime-version:in-reply-to:content-transfer-encoding; bh=PSU7uQFMs7XMnhJCX+nZ6TNt48xj9FEl9jLEnl6IYKo=; b=b7PON8Z+cd6I4lxqsmJRnHAFNq4VnRSdRb9ntm/tiM7xka8aC3RranyDAXQGwNMAtB Rtru5cPNTiPGNWs7wg1ezVjEH0ZDQhiDZt3TLPEViTsLQTgbRx654BLWKEwZ6eEg3VHj YTXmaRK8b30nXIvVijTwmFBXwfRybDGRgzoYkaxzl8z1t36bITvBPeHWFPygjTJ/6Am1 YIDEo/45EFZDOb+1c1P9xnRbQrTGVGuX3x5EpBc7ycN73j/q/EqSu3+oCrVQ8+Ls6T/m h6MwGWojWqfVlYMh+gDlZVUSB8ik3aLEaSovgTgUb9/AnnFf5JNTs6XGcid6b+KIPYxg w7DA== X-Gm-Message-State: AKaTC00bdIu591SBUdZxDZjIdkLViZHUH9kl//B+N8LTWBgBpbOGnlw8nt8Zd7sGDX49SA== X-Received: by 10.98.81.70 with SMTP id f67mr23353233pfb.179.1479797655677; Mon, 21 Nov 2016 22:54:15 -0800 (PST) Original-Received: from [0.0.0.0] ([188.166.240.79]) by smtp.gmail.com with ESMTPSA id y2sm42114254pff.82.2016.11.21.22.54.11 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Mon, 21 Nov 2016 22:54:15 -0800 (PST) In-Reply-To: <20161122051216.GA14073@holos.localdomain> 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:125977 Archived-At: 在 2016年11月22日 13:12, Mark Oteiza 写道: > On 22/11/16 at 11:51am, Liu Hui wrote: >> Thank you, but the trailing "..." is missing for long buffer names, no >> matter whether they contain multibyte characters. For example, >> "01234567890123456789" becomes "012345678901234567". The normal result >> should be "012345678901234...". > > Would you try the following? > > diff --git a/lisp/ibuffer.el b/lisp/ibuffer.el > index faadb67..c550b7d 100644 > --- a/lisp/ibuffer.el > +++ b/lisp/ibuffer.el > @@ -1559,16 +1559,17 @@ ibuffer-compile-make-eliding-form > `(concat ,ellipsis > (substring ,strvar > (string-width ibuffer-eliding-string))) > - `(truncate-string-to-width > - ,strvar strlen nil nil > - ,ellipsis)) > + `(concat > + (truncate-string-to-width > + ,strvar (- strlen (string-width ,ellipsis)) nil ?.) > + ,ellipsis)) > ,strvar) > strvar))) > > (defun ibuffer-compile-make-substring-form (strvar maxvar from-end-p) > (if from-end-p > - `(truncate-string-to-width str (string-width str) (- strlen ,maxvar)) > - `(truncate-string-to-width ,strvar ,maxvar))) > + `(truncate-string-to-width str (string-width str) (- strlen ,maxvar) nil ?\s) > + `(truncate-string-to-width ,strvar ,maxvar nil ?\s))) > > (defun ibuffer-compile-make-format-form (strvar widthform alignment) > (let* ((left `(make-string tmp2 ?\s)) > It works very well. Thank you.