summaryrefslogtreecommitdiff
path: root/lisp/emacs-lisp/tabulated-list.el
diff options
context:
space:
mode:
authorPaul Eggert <eggert@cs.ucla.edu>2012-04-09 15:54:59 -0700
committerPaul Eggert <eggert@cs.ucla.edu>2012-04-09 15:54:59 -0700
commit45e9f7da84c1bd3fc0d36d05c5708ed3b2d3a193 (patch)
tree5bc87a8b5a3c754b8eb44a612cc6c03561d6b968 /lisp/emacs-lisp/tabulated-list.el
parent9d6b4d53469a9ffd67bd770fabc6fe254e35c21d (diff)
parent05920a43fc18e696b464387e781e7cfdcea5b5af (diff)
downloademacs-45e9f7da84c1bd3fc0d36d05c5708ed3b2d3a193.tar.gz
emacs-45e9f7da84c1bd3fc0d36d05c5708ed3b2d3a193.tar.bz2
emacs-45e9f7da84c1bd3fc0d36d05c5708ed3b2d3a193.zip
Merge from trunk.
Diffstat (limited to 'lisp/emacs-lisp/tabulated-list.el')
-rw-r--r--lisp/emacs-lisp/tabulated-list.el9
1 files changed, 4 insertions, 5 deletions
diff --git a/lisp/emacs-lisp/tabulated-list.el b/lisp/emacs-lisp/tabulated-list.el
index 8fe514ab551..f17b12da6a0 100644
--- a/lisp/emacs-lisp/tabulated-list.el
+++ b/lisp/emacs-lisp/tabulated-list.el
@@ -278,11 +278,10 @@ of column descriptors."
(width (nth 1 format))
(label (if (stringp desc) desc (car desc)))
(help-echo (concat (car format) ": " label)))
- ;; Truncate labels if necessary.
- (and (> width 6)
- (> (length label) width)
- (setq label (concat (substring label 0 (- width 3))
- "...")))
+ ;; Truncate labels if necessary (except last column).
+ (and (< (1+ n) len)
+ (> (string-width label) width)
+ (setq label (truncate-string-to-width label width nil nil t)))
(setq label (bidi-string-mark-left-to-right label))
(if (stringp desc)
(insert (propertize label 'help-echo help-echo))