GNU bug report logs - #24972
26.0.50; Multibyte characters are misaligned in ibuffer

Previous Next

Package: emacs;

Reported by: Liu Hui <liuhui1610 <at> gmail.com>

Date: Sun, 20 Nov 2016 18:14:02 UTC

Severity: normal

Merged with 18934

Found in versions 24.4, 26.0.50

Done: Mark Oteiza <mvoteiza <at> udel.edu>

Bug is archived. No further changes may be made.

Full log


Message #20 received at 24972 <at> debbugs.gnu.org (full text, mbox):

From: Mark Oteiza <mvoteiza <at> udel.edu>
To: Liu Hui <liuhui1610 <at> gmail.com>
Cc: 24972 <at> debbugs.gnu.org
Subject: Re: bug#24972: 26.0.50; Multibyte characters are misaligned in ibuffer
Date: Tue, 22 Nov 2016 00:12:16 -0500
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))




This bug report was last modified 8 years and 166 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.