diff options
author | Mark Oteiza <mvoteiza@udel.edu> | 2016-11-22 02:42:47 -0500 |
---|---|---|
committer | Mark Oteiza <mvoteiza@udel.edu> | 2016-11-22 02:42:47 -0500 |
commit | 16e705bb56dc09278cd537a3763d867ab66f20a4 (patch) | |
tree | 148e2ef88b4e6a003ce64418d942f8e5e51e923a /lisp/ibuffer.el | |
parent | 4940e0f9111731d8917bd98f885c34291cea04eb (diff) | |
download | emacs-16e705bb56dc09278cd537a3763d867ab66f20a4.tar.gz |
Make sure elided long buffer names have ellipses added (Bug#24972)
* lisp/ibuffer.el (ibuffer-compile-make-eliding-form): Restore the
string concat, and chop "strvar" less the width of the ellipsis.
(ibuffer-compile-make-substring-form): Add space as padding, to fix
off-by-one in alignment.
Diffstat (limited to 'lisp/ibuffer.el')
-rw-r--r-- | lisp/ibuffer.el | 14 |
1 files changed, 9 insertions, 5 deletions
diff --git a/lisp/ibuffer.el b/lisp/ibuffer.el index faadb67408a..dc5681c4659 100644 --- a/lisp/ibuffer.el +++ b/lisp/ibuffer.el @@ -1556,19 +1556,23 @@ If point is on a group name, this function operates on that group." (if (or elide (with-no-warnings ibuffer-elide-long-columns)) `(if (> strlen 5) ,(if from-end-p + ;; FIXME: this should probably also be using + ;; `truncate-string-to-width' (Bug#24972) `(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))) + ;; FIXME: not sure if this case is correct (Bug#24972) + `(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)) |