From 13cb067d7f349d5867fab4765f8db888a3768b65 Mon Sep 17 00:00:00 2001 From: Case Duckworth Date: Fri, 31 Dec 2021 15:45:58 -0600 Subject: [PATCH] Use truncate-string-ellipsis by default --- lisp/+util.el | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/lisp/+util.el b/lisp/+util.el index 45d1e6d..a87eae9 100644 --- a/lisp/+util.el +++ b/lisp/+util.el @@ -34,12 +34,12 @@ (defun +string-truncate (s length &optional ellipsis alignment) "Return S, shortened to LENGTH including ELLIPSIS and aligned to ALIGNMENT. -ELLIPSIS defaults to \"...\". +ELLIPSIS defaults to `truncate-string-ellipsis', or \"...\". ALIGNMENT defaults to `+string-default-alignment'." (declare (pure t) (side-effect-free t)) - (let ((ellipsis (or ellipsis "...")) + (let ((ellipsis (or ellipsis truncate-string-ellipsis "...")) (alignment (or alignment +string-default-alignment))) (if (> (length s) length) (format "%s%s" @@ -50,7 +50,7 @@ ALIGNMENT defaults to `+string-default-alignment'." (cl-defun +string-align (s len &key (before "") (after "") (fill " ") - (ellipsis "...") + (ellipsis (or truncate-string-ellipsis "...")) (alignment +string-default-alignment)) "Print S to fit in LEN characters. Optional arguments BEFORE and AFTER specify strings to go on @@ -59,7 +59,8 @@ either side of S. FILL is the string to fill extra space with (default \" \"). ELLIPSIS is the string to show when S is too long to fit (default -\"...\"). If nil, don't truncate the string. +`truncate-string-ellipsis' or \"...\"). If nil, don't truncate +the string. ALIGNMENT can be one of these: - nil: align to `+string-default-alignment'