diff options
| author | Eli Zaretskii | 2023-11-26 12:46:53 +0200 |
|---|---|---|
| committer | Eli Zaretskii | 2023-11-26 12:46:53 +0200 |
| commit | dd5d2b3d3d28ffe3fdaa2618841b602bf420b17f (patch) | |
| tree | ff788b8d1616d127f56d38138fcd670356bd5a9c | |
| parent | 47e313e9805c527e590df4270062a9185ee9db78 (diff) | |
| download | emacs-dd5d2b3d3d28ffe3fdaa2618841b602bf420b17f.tar.gz emacs-dd5d2b3d3d28ffe3fdaa2618841b602bf420b17f.zip | |
Fix 'dired--get-ellipsis-length'
* lisp/dired.el (dired--get-ellipsis-length): Handle glyphs with
faces. (Bug#67161)
| -rw-r--r-- | lisp/dired.el | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/lisp/dired.el b/lisp/dired.el index 23a6fc034e1..096d6a838f8 100644 --- a/lisp/dired.el +++ b/lisp/dired.el | |||
| @@ -2021,8 +2021,12 @@ mouse-2: visit this file in other window" | |||
| 2021 | (let* ((dt (or (window-display-table) | 2021 | (let* ((dt (or (window-display-table) |
| 2022 | buffer-display-table | 2022 | buffer-display-table |
| 2023 | standard-display-table)) | 2023 | standard-display-table)) |
| 2024 | (glyphs (and dt (display-table-slot dt 'selective-display)))) | 2024 | (glyphs (and dt (display-table-slot dt 'selective-display))) |
| 2025 | (string-width (if glyphs (concat glyphs) "...")))) | 2025 | (vlen (length glyphs)) |
| 2026 | (char-glyphs (make-vector vlen nil))) | ||
| 2027 | (dotimes (i vlen) | ||
| 2028 | (aset char-glyphs i (glyph-char (aref glyphs i)))) | ||
| 2029 | (string-width (if glyphs (concat char-glyphs) "...")))) | ||
| 2026 | 2030 | ||
| 2027 | (defun dired--get-filename-display-length () | 2031 | (defun dired--get-filename-display-length () |
| 2028 | "Return maximum display length of filename. | 2032 | "Return maximum display length of filename. |