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 02:49:22 -0500 Message-ID: <20161122074922.GA1616@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> <20161122051216.GA14073@holos.localdomain> <6741c150-d985-26a3-5872-cd25e3b5ce02@gmail.com> NNTP-Posting-Host: blaine.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Trace: blaine.gmane.org 1479801019 9456 195.159.176.226 (22 Nov 2016 07:50:19 GMT) X-Complaints-To: usenet@blaine.gmane.org NNTP-Posting-Date: Tue, 22 Nov 2016 07:50:19 +0000 (UTC) User-Agent: Mutt/1.7.1+41 (5382e1e4cee1) (2016-10-04) Cc: 24972-done@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 08:50: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 1c95qI-0001HO-4m for geb-bug-gnu-emacs@m.gmane.org; Tue, 22 Nov 2016 08:50:14 +0100 Original-Received: from localhost ([::1]:53830 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1c95qL-0005YU-N4 for geb-bug-gnu-emacs@m.gmane.org; Tue, 22 Nov 2016 02:50:17 -0500 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:44708) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1c95q9-0005Va-IK for bug-gnu-emacs@gnu.org; Tue, 22 Nov 2016 02:50:06 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1c95q6-00089g-FZ for bug-gnu-emacs@gnu.org; Tue, 22 Nov 2016 02:50:05 -0500 Original-Received: from debbugs.gnu.org ([208.118.235.43]:50582) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1c95q6-00089S-Bh for bug-gnu-emacs@gnu.org; Tue, 22 Nov 2016 02:50:02 -0500 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1c95q6-0005Px-1a for bug-gnu-emacs@gnu.org; Tue, 22 Nov 2016 02:50:02 -0500 Resent-From: Mark Oteiza Original-Sender: "Debbugs-submit" Resent-To: bug-gnu-emacs@gnu.org Resent-Date: Tue, 22 Nov 2016 07:50:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: cc-closed 24972 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: Mail-Followup-To: 24972@debbugs.gnu.org, mvoteiza@udel.edu, liuhui1610@gmail.com Original-Received: via spool by 24972-done@debbugs.gnu.org id=D24972.147980097220776 (code D ref 24972); Tue, 22 Nov 2016 07:50:01 +0000 Original-Received: (at 24972-done) by debbugs.gnu.org; 22 Nov 2016 07:49:32 +0000 Original-Received: from localhost ([127.0.0.1]:37746 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1c95pc-0005P2-Ci for submit@debbugs.gnu.org; Tue, 22 Nov 2016 02:49:32 -0500 Original-Received: from mail-qt0-f176.google.com ([209.85.216.176]:34530) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1c95pZ-0005Om-MU for 24972-done@debbugs.gnu.org; Tue, 22 Nov 2016 02:49:30 -0500 Original-Received: by mail-qt0-f176.google.com with SMTP id n6so5838412qtd.1 for <24972-done@debbugs.gnu.org>; Mon, 21 Nov 2016 23:49:29 -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:content-transfer-encoding:in-reply-to :user-agent; bh=aV95kBtf0EnmAfGCQn2a+f73qbTHZZq09btfDUKars4=; b=MCXtUknYyJqPlIBL9TYgGMwBDcDG70OsOOsJ3qcPjZXKOIXM0vjC4q4dXa87lKOrST VOcarKNLnAyHkrBr2lAxYYfRgO/35ZezS9afsndoWyUIWmbhnPZZq3oOJ6oJA2IVJf76 nvZpFjQTbhG6tRQLWrGWLsIERUEc1XNKPnIHsQ+jY9ZW4FjkOSRZkM2fFWie2QovxPPS NxYQN7qiDCdqk67FgYWJvBou7Xm53D6kqXOXRxy/rmU3JscJXFAZ2NHG+4bHLezrxv3g 43smEwBfDQcxXxlBFjLR3wzAgymdbYHyu8QcpD+iWg04cklE2YKQUVkvbOgfkFi8m5WH L5ew== 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:content-transfer-encoding :in-reply-to:user-agent; bh=aV95kBtf0EnmAfGCQn2a+f73qbTHZZq09btfDUKars4=; b=dorZFv3xBs2i9c5GrJqOret2H2QxnVN5r7ho5MGRPxc2zrjnXY20BI60XQKh0MR4jH ad6Vvbklfrjg5nq5Q5CpIM5YX2FZO9vYWFzZcrEmNrdrLex+2I99WaXSOlv74b3apTKo hakq2Cv4KNooNbQ5sqNXMkptamuLzEfRPwq9+hUeAuG4eYbVReBTaeNwW+Nb46DeqgxP CYrdhbqG02EvUR0vF63KeRRjA339e2t1mq0ElLVO4m9ZeDnjpjNqHq0KYy34s2t6VRoo v9tiBJclVYwmhxOdv4NoIlJ8rODKkvPmuJZiw3qZ+OpnQu/2RcHrMaZeq5ys5V2N2ls0 9T9Q== X-Gm-Message-State: AKaTC024WsAvVQRq9KnTlngjtu7HNOIAIeCcWgCtH8IKQumbAyVYK9SwBfLpNp99A8exb3Ss X-Received: by 10.200.35.105 with SMTP id b38mr10764522qtb.28.1479800964001; Mon, 21 Nov 2016 23:49:24 -0800 (PST) Original-Received: from holos.localdomain ([69.250.222.218]) by smtp.gmail.com with ESMTPSA id 46sm13184753qtw.6.2016.11.21.23.49.23 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Mon, 21 Nov 2016 23:49:23 -0800 (PST) Original-Received: by holos.localdomain (Postfix, from userid 1000) id AEF7866324; Tue, 22 Nov 2016 02:49:22 -0500 (EST) Content-Disposition: inline In-Reply-To: <6741c150-d985-26a3-5872-cd25e3b5ce02@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:125979 Archived-At: On 22/11/16 at 02:54pm, Liu Hui wrote: > > 在 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. Wahoo! Pushed, thanks.