[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Emacs-diffs] master 16e705b: Make sure elided long buffer names have el
From: |
Mark Oteiza |
Subject: |
[Emacs-diffs] master 16e705b: Make sure elided long buffer names have ellipses added (Bug#24972) |
Date: |
Tue, 22 Nov 2016 07:48:08 +0000 (UTC) |
branch: master
commit 16e705bb56dc09278cd537a3763d867ab66f20a4
Author: Mark Oteiza <address@hidden>
Commit: Mark Oteiza <address@hidden>
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.
---
lisp/ibuffer.el | 14 +++++++++-----
1 file changed, 9 insertions(+), 5 deletions(-)
diff --git a/lisp/ibuffer.el b/lisp/ibuffer.el
index faadb67..dc5681c 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))
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- [Emacs-diffs] master 16e705b: Make sure elided long buffer names have ellipses added (Bug#24972),
Mark Oteiza <=