From fd49a2185ff4f1710bc337168fd15af91064a74e Mon Sep 17 00:00:00 2001 From: =?utf8?q?David=20Cad=C3=A9?= Date: Wed, 12 Dec 2012 09:42:03 -0500 Subject: [PATCH] * lisp/mpc.el (mpc-format): Use truncate-string-to-width. Fixes: debbugs:13143 --- lisp/ChangeLog | 4 ++++ lisp/mpc.el | 5 +---- 2 files changed, 5 insertions(+), 4 deletions(-) diff --git a/lisp/ChangeLog b/lisp/ChangeLog index 49e129cd77..a5fab65b34 100644 --- a/lisp/ChangeLog +++ b/lisp/ChangeLog @@ -1,3 +1,7 @@ +2012-12-12 David Cadé + + * mpc.el (mpc-format): Use truncate-string-to-width (bug#13143). + 2012-12-12 Jonas Bernoulli * lisp/emacs-lisp/eieio.el: Prettier object pretty-printing (bug#13115). diff --git a/lisp/mpc.el b/lisp/mpc.el index e8b5c50e56..65363de40f 100644 --- a/lisp/mpc.el +++ b/lisp/mpc.el @@ -1034,11 +1034,8 @@ If PLAYLIST is t or nil or missing, use the main playlist." (let ((display (if (and size (> (+ postwidth textwidth) size)) - ;; This doesn't even obey double-width chars :-( (propertize - (if (zerop (- size postwidth 1)) - (substring text 0 1) - (concat (substring text 0 (- size postwidth textwidth 1)) "…")) + (truncate-string-to-width text size nil nil "…") 'help-echo text) text))) (when (memq tag '(Artist Album Composer)) ;FIXME: wrong list. -- 2.20.1