bug-gnu-emacs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

bug#56685: OBOE in string-truncate-left?


From: Lars Ingebrigtsen
Subject: bug#56685: OBOE in string-truncate-left?
Date: Sat, 23 Jul 2022 08:58:35 +0200
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/29.0.50 (gnu/linux)

Stephen Berman <stephen.berman@gmx.net> writes:

> But if the too-long string is
> "https://cvs.savannah.gnu.org/viewv/emacs/emacs/1/";, then with the
> current string-truncate-left gnus-shorten-url "shortens" it to
> "cvs.savannah.gnu.org...ewv/emacs/emacs/1/".  AFAICS replacing the three
> characters "/vi" by "..." here just loses information.

What's the parameters when that happens?  I get:

(gnus-shorten-url "https://cvs.savannah.gnu.org/viewv/emacs/emacs/1/"; 41)
=> "cvs.savannah.gnu.org/viewv/emacs/emacs/1/"

(gnus-shorten-url "https://cvs.savannah.gnu.org/viewv/emacs/emacs/1/"; 40)
=> "cvs.savannah.gnu.org...wv/emacs/emacs/1/"

Anyway, I think the examples show that this function isn't very useful
if LENGTH is very small -- it really does want to add "..." to signal
that some shortening has happened, and that may make the string longer.
But just returning "d" for (string-truncate-left "and" 1) isn't correct
either.

I've now fixed the originally reported off-by-one error when shortening,
and documented the quirks of the function in Emacs 29.






reply via email to

[Prev in Thread] Current Thread [Next in Thread]