summaryrefslogtreecommitdiff
path: root/lisp/buff-menu.el
diff options
context:
space:
mode:
authorChong Yidong <cyd@stupidchicken.com>2009-11-06 19:15:25 +0000
committerChong Yidong <cyd@stupidchicken.com>2009-11-06 19:15:25 +0000
commitd19e23ae10b0740bce35efe761c4267e95030a24 (patch)
tree75b9a2d066dff6100484658219d364fa31b1cde4 /lisp/buff-menu.el
parent0ad57dfdc5c4c7df6800c9b4fe2000f34188a7b4 (diff)
downloademacs-d19e23ae10b0740bce35efe761c4267e95030a24.tar.gz
* buff-menu.el (Buffer-menu-buffer+size): Use display property to
align size column (Bug#4839).
Diffstat (limited to 'lisp/buff-menu.el')
-rw-r--r--lisp/buff-menu.el15
1 files changed, 8 insertions, 7 deletions
diff --git a/lisp/buff-menu.el b/lisp/buff-menu.el
index d838f5ee18f..6ef7195c426 100644
--- a/lisp/buff-menu.el
+++ b/lisp/buff-menu.el
@@ -678,12 +678,13 @@ For more information, see the function `buffer-menu'."
(setq name (copy-sequence name)))
(add-text-properties 0 (length name) name-props name)
(add-text-properties 0 (length size) size-props size)
- (concat name
- (make-string (- Buffer-menu-buffer+size-width
- (string-width name)
- (string-width size))
- ?\s)
- size))
+ (let ((name+space-width (- Buffer-menu-buffer+size-width
+ (string-width size))))
+ (concat name
+ (propertize (make-string (- name+space-width (string-width name))
+ ?\s)
+ 'display `(space :align-to ,(+ 4 name+space-width)))
+ size)))
(defun Buffer-menu-sort (column)
"Sort the buffer menu by COLUMN."
@@ -889,7 +890,7 @@ For more information, see the function `buffer-menu'."
;; This way we avoid problems with unusual buffer names.
(let ((name (nth 2 buffer))
(size (int-to-string (nth 3 buffer))))
- (Buffer-menu-buffer+size name size
+ (Buffer-menu-buffer+size name size
`(buffer-name ,name
buffer ,(car buffer)
font-lock-face buffer-menu-buffer