Subject: Re: bug#39980: [PATCH] gnus-shorten-url: Improve and avoid args-out-of-range error

From: Eli Zaretskii <[email-masked]>
Date: Sun, 12 Apr 2020 16:38:57 +0300

> From: Štěpán Němec <[email-masked]>
> Cc: [email-masked],  [email-masked]
> Date: Sun, 12 Apr 2020 13:47:20 +0200
> 
> >> There are no changes in the patch that are not necessary for fixing the
> >> problem. The ediff changes (only adjusting callers) are necessitated by
> >> moving the helper function to subr-x.el, so that Gnus (or anything else)
> >> can use it, too.
> >
> > The changes in subr-x and in ediff are unnecessary.  Let's make
> > changes only in gnus-summary-browse-url, OK?  The full changeset can
> > go to master.
> 
> You mean instead of reusing an existing function, fix `gnus-shorten-url'
> without using it?

Almost: the "existing function" doesn't really exist, you introduced
it with the same changeset, right?

> I can only see disadvantages here: having to maintain
> two separate versions, reinventing the wheel (and possibly introducing
> bugs that way, which is how all this started)... are you sure you
> couldn't be persuaded otherwise? Surely just renaming a function and
> adjusting callers should be safer for the release branch, too?

It isn't safe enough for my taste, sorry.  It affects every package
that uses subr-x, and it affects Ediff.  I'd like to avoid that for
the release branch, however low risk that is.  Solving it just in
gnus-shorten-url makes the risk of breaking anything else exactly
zero on the release branch.

The change on the release branch should be marked by "don't merge to
master", and the original changeset pushed to master instead.

> * lisp/vc/ediff-init.el (ediff-truncate-string-left): Rename to
> 'string-truncate-left' and move...
> * lisp/emacs-lisp/subr-x.el (string-truncate-left): ...here.
> * lisp/vc/ediff-mult.el (ediff-meta-insert-file-info1)
> (ediff-draw-dir-diffs): Adjust callers.
> * lisp/gnus/gnus-sum.el (gnus-shorten-url): Fix args-out-of-range
> error, don't drop #fragments, use 'string-truncate-left'.
> 
> Or even compacting the first three items to:
> 
> * lisp/vc/ediff-init.el (ediff-truncate-string-left): Rename to
> 'string-truncate-left' and move...
> * lisp/emacs-lisp/subr-x.el (string-truncate-left): ...here.  All callers
> changed.

Both variants of the log message are fine.

Thanks.