Commit f0bcceb9 authored by Chong Yidong's avatar Chong Yidong
Browse files

Improve column width calculation in tabulated-list.el.

* lisp/emacs-lisp/tabulated-list.el (tabulated-list-print-entry): Use
string-width and truncate-string-width to handle arbitrary
characters.
parent 025de85b
2012-03-20 Chong Yidong <cyd@gnu.org>
* emacs-lisp/tabulated-list.el (tabulated-list-print-entry): Use
string-width and truncate-string-width to handle arbitrary
characters.
2012-03-20 Tassilo Horn <tassilo@member.fsf.org>
* textmodes/artist.el (artist-menu-map): Bind Rectangle menu item
......
......@@ -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))
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment