On Thu, 21 Jul 2022 17:10:36 -0500 Stefan Kangas wrote: > Try evaluating: > > (length (string-truncate-left "longstring" 8)) > => 9 > > But the docstring says "Truncate STRING to LENGTH". > This seems like a bug. Yes, and I also think it's counterintuitive that LENGTH includes the length of "...". Worse, if STRING is short enough, the resulting string (with "...") can be longer than LENGTH: (string-truncate-left "band" 3) "...d" (string-truncate-left "band" 2) "...d" (string-truncate-left "band" 1) "...d" (string-truncate-left "and" 2) "...d" (string-truncate-left "and" 1) "...d" Note that with the last two examples, the result is longer than the original string, contradicting the meaning of truncation. I think LENGTH should mean just the numbers of characters in STRING after truncation (excluding "..."), and if the result with the prefix "..." is not shorter than the original string, there should be no truncation. The following patch does this.