summaryrefslogtreecommitdiff
path: root/lisp
diff options
context:
space:
mode:
Diffstat (limited to 'lisp')
-rw-r--r--lisp/ChangeLog8
-rw-r--r--lisp/buff-menu.el17
2 files changed, 21 insertions, 4 deletions
diff --git a/lisp/ChangeLog b/lisp/ChangeLog
index ccfff545293..9a4468d8b43 100644
--- a/lisp/ChangeLog
+++ b/lisp/ChangeLog
@@ -1,3 +1,11 @@
+2011-06-19 Eli Zaretskii <eliz@gnu.org>
+
+ * buff-menu.el (Buffer-menu-buffer+size): Accept an additional
+ argument LRM; if non-nil, append an invisible LRM character to the
+ buffer name.
+ (list-buffers-noselect): Call Buffer-menu-buffer+size with the
+ last argument non-nil, when formatting buffer names.
+
2011-06-18 Eli Zaretskii <eliz@gnu.org>
* buff-menu.el (Buffer-menu-mode, list-buffers-noselect): Force
diff --git a/lisp/buff-menu.el b/lisp/buff-menu.el
index cd1c8d71243..00340e5937b 100644
--- a/lisp/buff-menu.el
+++ b/lisp/buff-menu.el
@@ -666,7 +666,7 @@ For more information, see the function `buffer-menu'."
":" ;; (if (char-displayable-p ?…) "…" ":")
)
-(defun Buffer-menu-buffer+size (name size &optional name-props size-props)
+(defun Buffer-menu-buffer+size (name size &optional name-props size-props lrm)
(if (> (+ (string-width name) (string-width size) 2)
Buffer-menu-buffer+size-width)
(setq name
@@ -681,9 +681,17 @@ For more information, see the function `buffer-menu'."
(string-width tail)
2))
Buffer-menu-short-ellipsis
- tail)))
+ tail
+ ;; Append an invisible LRM character to the
+ ;; buffer's name to avoid ugly display with the
+ ;; buffer size to the left of the name, when the
+ ;; name begins with R2L character.
+ (if lrm (propertize (string ?\x200e) 'invisible t) ""))))
;; Don't put properties on (buffer-name).
- (setq name (copy-sequence name)))
+ (setq name (concat (copy-sequence name)
+ (if lrm
+ (propertize (string ?\x200e) 'invisible t)
+ ""))))
(add-text-properties 0 (length name) name-props name)
(add-text-properties 0 (length size) size-props size)
(let ((name+space-width (- Buffer-menu-buffer+size-width
@@ -913,7 +921,8 @@ For more information, see the function `buffer-menu'."
(max (length size) 3)
2))
name
- "mouse-2: select this buffer"))))
+ "mouse-2: select this buffer"))
+ nil t))
" "
(if (> (string-width (nth 4 buffer)) Buffer-menu-mode-width)
(truncate-string-to-width (nth 4 buffer)