]> git.eshelyaron.com Git - emacs.git/commitdiff
Fix 'dired--get-ellipsis-length'
authorEli Zaretskii <eliz@gnu.org>
Sun, 26 Nov 2023 10:46:53 +0000 (12:46 +0200)
committerEli Zaretskii <eliz@gnu.org>
Sun, 26 Nov 2023 10:46:53 +0000 (12:46 +0200)
* lisp/dired.el (dired--get-ellipsis-length): Handle glyphs with
faces.  (Bug#67161)

lisp/dired.el

index 23a6fc034e18d75d7c266a57a3b0595069b3cd6f..096d6a838f82f902f908b0661b9aa6856ac1c4e0 100644 (file)
@@ -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.