From dd5d2b3d3d28ffe3fdaa2618841b602bf420b17f Mon Sep 17 00:00:00 2001 From: Eli Zaretskii Date: Sun, 26 Nov 2023 12:46:53 +0200 Subject: [PATCH] Fix 'dired--get-ellipsis-length' * lisp/dired.el (dired--get-ellipsis-length): Handle glyphs with faces. (Bug#67161) --- lisp/dired.el | 8 ++++++-- 1 file 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" (let* ((dt (or (window-display-table) buffer-display-table standard-display-table)) - (glyphs (and dt (display-table-slot dt 'selective-display)))) - (string-width (if glyphs (concat glyphs) "...")))) + (glyphs (and dt (display-table-slot dt 'selective-display))) + (vlen (length glyphs)) + (char-glyphs (make-vector vlen nil))) + (dotimes (i vlen) + (aset char-glyphs i (glyph-char (aref glyphs i)))) + (string-width (if glyphs (concat char-glyphs) "...")))) (defun dired--get-filename-display-length () "Return maximum display length of filename. -- 2.39.5