* lisp/mpc.el (mpc-format): Use truncate-string-to-width.

Fixes: debbugs:13143
This commit is contained in:
David Cadé 2012-12-12 09:42:03 -05:00 committed by Stefan Monnier
parent 4a9a8f1387
commit fd49a2185f
2 changed files with 5 additions and 4 deletions

View file

@ -1,3 +1,7 @@
2012-12-12 David Cadé <codename68@gmail.com>
* mpc.el (mpc-format): Use truncate-string-to-width (bug#13143).
2012-12-12 Jonas Bernoulli <jonas@bernoul.li>
* lisp/emacs-lisp/eieio.el: Prettier object pretty-printing (bug#13115).

View file

@ -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.