GNU bug report logs -
#56685
OBOE in string-truncate-left?
Previous Next
Reported by: Stefan Kangas <stefan <at> marxist.se>
Date: Thu, 21 Jul 2022 22:11:02 UTC
Severity: normal
Fixed in version 29.1
Done: Lars Ingebrigtsen <larsi <at> gnus.org>
Bug is archived. No further changes may be made.
Full log
View this message in rfc822 format
Stephen Berman <stephen.berman <at> 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.
This bug report was last modified 2 years and 300 days ago.
Previous Next
GNU bug tracking system
Copyright (C) 1999 Darren O. Benham,
1997,2003 nCipher Corporation Ltd,
1994-97 Ian Jackson.