diff --git a/lisp/international/mule-util.el b/lisp/international/mule-util.el index 660ac58e02..a2bd5802cc 100644 --- a/lisp/international/mule-util.el +++ b/lisp/international/mule-util.el @@ -44,10 +44,16 @@ store-substring (setq i (1+ i))))) string) -(defvar truncate-string-ellipsis "..." ;"…" +(defvar truncate-string-ellipsis nil "String to use to indicate truncation. Serves as default value of ELLIPSIS argument to `truncate-string-to-width'.") +(defun truncate-string-ellipsis () + (cond + (truncate-string-ellipsis) + ((char-displayable-p ?…) "…") + ("..."))) + ;;;###autoload (defun truncate-string-to-width (str end-column &optional start-column padding ellipsis @@ -81,7 +87,7 @@ truncate-string-to-width (or start-column (setq start-column 0)) (when (and ellipsis (not (stringp ellipsis))) - (setq ellipsis truncate-string-ellipsis)) + (setq ellipsis (truncate-string-ellipsis))) (let ((str-len (length str)) (str-width (string-width str)) (ellipsis-width (if ellipsis (string-width ellipsis) 0))