summaryrefslogtreecommitdiff
path: root/lisp/ibuffer.el
diff options
context:
space:
mode:
authorMark Oteiza <mvoteiza@udel.edu>2016-11-21 04:19:51 -0500
committerMark Oteiza <mvoteiza@udel.edu>2016-11-21 04:19:51 -0500
commit209d85fe5691a9334e14bc63b0c836880831a054 (patch)
tree3f8d4fea2ee90a7cb624045901da4bb4dad2019b /lisp/ibuffer.el
parentb13d6f2c397419688374f95c99a55d077312ca94 (diff)
downloademacs-209d85fe5691a9334e14bc63b0c836880831a054.tar.gz
emacs-209d85fe5691a9334e14bc63b0c836880831a054.tar.bz2
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/ibuffer.el')
-rw-r--r--lisp/ibuffer.el11
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."
,(if from-end-p
`(concat ,ellipsis
(substring ,strvar
- (length ibuffer-eliding-string)))
- `(concat
- (substring ,strvar 0 (- strlen ,(length ellipsis)))
+ (string-width ibuffer-eliding-string)))
+ `(truncate-string-to-width
+ ,strvar strlen nil nil
,ellipsis))
,strvar)
strvar)))
(defun ibuffer-compile-make-substring-form (strvar maxvar from-end-p)
(if from-end-p
- `(substring str
- (- strlen ,maxvar))
- `(substring ,strvar 0 ,maxvar)))
+ `(truncate-string-to-width str (string-width str) (- strlen ,maxvar))
+ `(truncate-string-to-width ,strvar ,maxvar)))
(defun ibuffer-compile-make-format-form (strvar widthform alignment)
(let* ((left `(make-string tmp2 ?\s))