From 209d85fe5691a9334e14bc63b0c836880831a054 Mon Sep 17 00:00:00 2001 From: Mark Oteiza Date: Mon, 21 Nov 2016 04:19:51 -0500 Subject: [PATCH] Add further consideration to string-width (Bug#24972) * lisp/ibuffer.el (ibuffer-compile-make-eliding-form): (ibuffer-compile-make-substring-form): Use truncate-string-to-width. --- lisp/ibuffer.el | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) diff --git a/lisp/ibuffer.el b/lisp/ibuffer.el index 8c641797858..faadb67408a 100644 --- a/lisp/ibuffer.el +++ b/lisp/ibuffer.el @@ -1558,18 +1558,17 @@ If point is on a group name, this function operates on that group." ,(if from-end-p `(concat ,ellipsis (substring ,strvar - (length ibuffer-eliding-string))) - `(concat - (substring ,strvar 0 (- strlen ,(length ellipsis))) + (string-width ibuffer-eliding-string))) + `(truncate-string-to-width + ,strvar strlen nil nil ,ellipsis)) ,strvar) strvar))) (defun ibuffer-compile-make-substring-form (strvar maxvar from-end-p) (if from-end-p - `(substring str - (- strlen ,maxvar)) - `(substring ,strvar 0 ,maxvar))) + `(truncate-string-to-width str (string-width str) (- strlen ,maxvar)) + `(truncate-string-to-width ,strvar ,maxvar))) (defun ibuffer-compile-make-format-form (strvar widthform alignment) (let* ((left `(make-string tmp2 ?\s)) -- 2.11.4.GIT