From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!.POSTED!not-for-mail From: Mark Oteiza Newsgroups: gmane.emacs.bugs Subject: bug#24972: 26.0.50; Multibyte characters are misaligned in ibuffer Date: Tue, 22 Nov 2016 00:12:16 -0500 Message-ID: <20161122051216.GA14073@holos.localdomain> References: <87bmxa2d2v.fsf@udel.edu> <39442582-6036-47de-1a7a-4d46e43496c1@gmail.com> <20161121093545.GA1654@holos.localdomain> <1dbeb208-b7b5-e445-1946-c71aec1660da@gmail.com> NNTP-Posting-Host: blaine.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Trace: blaine.gmane.org 1479791594 18273 195.159.176.226 (22 Nov 2016 05:13:14 GMT) X-Complaints-To: usenet@blaine.gmane.org NNTP-Posting-Date: Tue, 22 Nov 2016 05:13:14 +0000 (UTC) User-Agent: Mutt/1.7.1+41 (5382e1e4cee1) (2016-10-04) Cc: 24972@debbugs.gnu.org To: Liu Hui Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Tue Nov 22 06:13:10 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 1c93OG-0003z9-Lc for geb-bug-gnu-emacs@m.gmane.org; Tue, 22 Nov 2016 06:13:08 +0100 Original-Received: from localhost ([::1]:53282 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1c93OJ-000196-PB for geb-bug-gnu-emacs@m.gmane.org; Tue, 22 Nov 2016 00:13:11 -0500 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:55777) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1c93OD-000191-LD for bug-gnu-emacs@gnu.org; Tue, 22 Nov 2016 00:13:06 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1c93OA-0006W7-EL for bug-gnu-emacs@gnu.org; Tue, 22 Nov 2016 00:13:05 -0500 Original-Received: from debbugs.gnu.org ([208.118.235.43]:50510) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1c93OA-0006Vz-9H for bug-gnu-emacs@gnu.org; Tue, 22 Nov 2016 00:13:02 -0500 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1c93OA-0001P9-4f for bug-gnu-emacs@gnu.org; Tue, 22 Nov 2016 00:13:02 -0500 X-Loop: help-debbugs@gnu.org Resent-From: Mark Oteiza Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Tue, 22 Nov 2016 05:13: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.14797915465352 (code B ref 24972); Tue, 22 Nov 2016 05:13:02 +0000 Original-Received: (at 24972) by debbugs.gnu.org; 22 Nov 2016 05:12:26 +0000 Original-Received: from localhost ([127.0.0.1]:37676 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1c93NZ-0001OG-Q1 for submit@debbugs.gnu.org; Tue, 22 Nov 2016 00:12:25 -0500 Original-Received: from mail-qk0-f182.google.com ([209.85.220.182]:36562) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1c93NY-0001Nx-05 for 24972@debbugs.gnu.org; Tue, 22 Nov 2016 00:12:24 -0500 Original-Received: by mail-qk0-f182.google.com with SMTP id n21so8720533qka.3 for <24972@debbugs.gnu.org>; Mon, 21 Nov 2016 21:12:23 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=udel-edu.20150623.gappssmtp.com; s=20150623; h=date:from:to:cc:subject:message-id:references:mime-version :content-disposition:in-reply-to:user-agent; bh=lbIJpSDYh761ESIrQYV9fLY8vnJNjvKKpKCqp6T90m0=; b=qmuJ80aAsUCZAlZ19v9q03eLwWBeOIcPRGA4SntEr5o8xjSZFwt7+pPYll5tbbK7+z 7Ilbco996Vf7p7d0vn7JfloIpeQmPgfRzVKmxyQdydTcFcLJBtCGqezkonW5AHPSLWYq Y/6ofE8WVG6XURnncER9B8cgP2PT9QCfDgdOldVaqxAnP7M+L3z4SL+gCsKviHiBhCUE Cfy97T85zVE5BNB9JVJLMm+LcpplJYv6Q99DASkI1xZObT1gTE9r/9XHKTWfFrQV3YI1 NDDCLcQatR1qBxKebGMbaXWEGZQqZF1zKJbuWdMw/Z4ZW9OtL/98eeE2KUWYCdm8ICeI CbSQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-disposition:in-reply-to:user-agent; bh=lbIJpSDYh761ESIrQYV9fLY8vnJNjvKKpKCqp6T90m0=; b=KUfxPU9Gi73T5ldDJQRHUznod355LjUy7JDY736hEDF80wBVO8FbfXBE/rohKpqnE+ zGI4DrnZZec3r4rgBNVGTs1sKfRcPvhxedduJ7Rdt+Qb+GLQ6oH+S2920BOEJ37o7/eC xGUZB2+zJNrnQQvW/LnFTUdbQJW30pJnwu0dPb9WQb1P3kfuEDctDaUROVTFuswn4GRF knPHPbRjRVaL5TpJGnFIGtwfGiOIxB3qixsa/fWVbhh/J5jFkDOeiIivi/sxR45TSd2M SbnYbj5lXpA6z6E7gERHTGCID/eZxNUyvN1gpZ5b/+rGTMNPkN62SsJAixMm/qsFL/mp fouQ== X-Gm-Message-State: AKaTC03oCdh+hSUk4d8Nr9fwGRCN+jSBzTZuEUjZHO9qw7HWbrt5Kgwy8QLCY/2h3LH47wX5 X-Received: by 10.55.3.67 with SMTP id 64mr22973349qkd.257.1479791538597; Mon, 21 Nov 2016 21:12:18 -0800 (PST) Original-Received: from holos.localdomain ([69.250.222.218]) by smtp.gmail.com with ESMTPSA id q128sm12967033qka.1.2016.11.21.21.12.17 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Mon, 21 Nov 2016 21:12:17 -0800 (PST) Original-Received: by holos.localdomain (Postfix, from userid 1000) id D1BD866324; Tue, 22 Nov 2016 00:12:16 -0500 (EST) Content-Disposition: inline In-Reply-To: <1dbeb208-b7b5-e445-1946-c71aec1660da@gmail.com> 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:125974 Archived-At: 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))