diff options
| author | Mark Oteiza | 2016-11-21 04:19:51 -0500 |
|---|---|---|
| committer | Mark Oteiza | 2016-11-21 04:19:51 -0500 |
| commit | 209d85fe5691a9334e14bc63b0c836880831a054 (patch) | |
| tree | 3f8d4fea2ee90a7cb624045901da4bb4dad2019b /lisp | |
| parent | b13d6f2c397419688374f95c99a55d077312ca94 (diff) | |
| download | emacs-209d85fe5691a9334e14bc63b0c836880831a054.tar.gz emacs-209d85fe5691a9334e14bc63b0c836880831a054.zip | |
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.
Diffstat (limited to 'lisp')
| -rw-r--r-- | lisp/ibuffer.el | 11 |
1 files 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." | |||
| 1558 | ,(if from-end-p | 1558 | ,(if from-end-p |
| 1559 | `(concat ,ellipsis | 1559 | `(concat ,ellipsis |
| 1560 | (substring ,strvar | 1560 | (substring ,strvar |
| 1561 | (length ibuffer-eliding-string))) | 1561 | (string-width ibuffer-eliding-string))) |
| 1562 | `(concat | 1562 | `(truncate-string-to-width |
| 1563 | (substring ,strvar 0 (- strlen ,(length ellipsis))) | 1563 | ,strvar strlen nil nil |
| 1564 | ,ellipsis)) | 1564 | ,ellipsis)) |
| 1565 | ,strvar) | 1565 | ,strvar) |
| 1566 | strvar))) | 1566 | strvar))) |
| 1567 | 1567 | ||
| 1568 | (defun ibuffer-compile-make-substring-form (strvar maxvar from-end-p) | 1568 | (defun ibuffer-compile-make-substring-form (strvar maxvar from-end-p) |
| 1569 | (if from-end-p | 1569 | (if from-end-p |
| 1570 | `(substring str | 1570 | `(truncate-string-to-width str (string-width str) (- strlen ,maxvar)) |
| 1571 | (- strlen ,maxvar)) | 1571 | `(truncate-string-to-width ,strvar ,maxvar))) |
| 1572 | `(substring ,strvar 0 ,maxvar))) | ||
| 1573 | 1572 | ||
| 1574 | (defun ibuffer-compile-make-format-form (strvar widthform alignment) | 1573 | (defun ibuffer-compile-make-format-form (strvar widthform alignment) |
| 1575 | (let* ((left `(make-string tmp2 ?\s)) | 1574 | (let* ((left `(make-string tmp2 ?\s)) |