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

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

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


From: Eli Zaretskii
Subject: bug#39980: [PATCH] gnus-shorten-url: Improve and avoid args-out-of-range error
Date: Sun, 12 Apr 2020 16:38:57 +0300

> From: Štěpán Němec <stepnem@gmail.com>
> Cc: larsi@gnus.org,  39980@debbugs.gnu.org
> 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.





reply via email to

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