diff options
author | Chong Yidong <cyd@stupidchicken.com> | 2011-08-10 15:03:56 -0400 |
---|---|---|
committer | Chong Yidong <cyd@stupidchicken.com> | 2011-08-10 15:03:56 -0400 |
commit | 3e26a4a28c6ad382f3bea07a1a6e0175ed8acdc6 (patch) | |
tree | e5b61892f81417d3af99a4b28e2153e55b0f8b7d /lisp/buff-menu.el | |
parent | ac8cf6e698c4612dc3ed195dbf1348db67f59fe5 (diff) | |
download | emacs-3e26a4a28c6ad382f3bea07a1a6e0175ed8acdc6.tar.gz |
New function `string-mark-left-to-right' for handling LRMs.
* lisp/subr.el (string-mark-left-to-right): New function.
* lisp/buff-menu.el (Buffer-menu-buffer+size): Remove LRM argument.
Use string-mark-left-to-right.
(list-buffers-noselect): Caller changed.
* lisp/emacs-lisp/tabulated-list.el (tabulated-list-print-entry): Use
string-mark-left-to-right.
(tabulated-list-print): Recenter after moving point.
Diffstat (limited to 'lisp/buff-menu.el')
-rw-r--r-- | lisp/buff-menu.el | 17 |
1 files changed, 4 insertions, 13 deletions
diff --git a/lisp/buff-menu.el b/lisp/buff-menu.el index f0a44747378..a5b45921d28 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 lrm) +(defun Buffer-menu-buffer+size (name size &optional name-props size-props) (if (> (+ (string-width name) (string-width size) 2) Buffer-menu-buffer+size-width) (setq name @@ -681,17 +681,9 @@ For more information, see the function `buffer-menu'." (string-width tail) 2)) Buffer-menu-short-ellipsis - 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) "")))) + (string-mark-left-to-right tail)))) ;; Don't put properties on (buffer-name). - (setq name (concat (copy-sequence name) - (if lrm - (propertize (string ?\x200e) 'invisible t) - "")))) + (setq name (string-mark-left-to-right name))) (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 @@ -929,8 +921,7 @@ For more information, see the function `buffer-menu'." (max (length size) 3) 2)) name - "mouse-2: select this buffer")) - nil t)) + "mouse-2: select this buffer")))) " " (if (> (string-width (nth 4 buffer)) Buffer-menu-mode-width) (truncate-string-to-width (nth 4 buffer) |