From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.ciao.gmane.io!not-for-mail From: Eli Zaretskii Newsgroups: gmane.emacs.bugs Subject: bug#39980: [PATCH] gnus-shorten-url: Improve and avoid args-out-of-range error Date: Sun, 12 Apr 2020 16:38:57 +0300 Message-ID: <838sj0lt72.fsf@gnu.org> References: <20200308090630.41238-1-stepnem@gmail.com> <87pndf17v5.fsf@gnus.org> <87zhcinbdl.fsf@gmail.com> <87d09ezudv.fsf@gnus.org> <83zhciby6s.fsf@gnu.org> <87imioo963.fsf@gmail.com> <875zeinoc0.fsf@gnus.org> <87wo6lc9n8.fsf@gmail.com> <83blnxkn7i.fsf@gnu.org> <87o8rxc72a.fsf@gmail.com> <83a73hklq3.fsf@gnu.org> <87k12lc4dz.fsf@gmail.com> Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit Injection-Info: ciao.gmane.io; posting-host="ciao.gmane.io:159.69.161.202"; logging-data="92714"; mail-complaints-to="usenet@ciao.gmane.io" Cc: larsi@gnus.org, 39980@debbugs.gnu.org To: =?UTF-8?Q?=C5=A0t=C4=9Bp=C3=A1n_?= =?UTF-8?Q?N=C4=9Bmec?= Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Sun Apr 12 15:41:20 2020 Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane-mx.org Original-Received: from lists.gnu.org ([209.51.188.17]) by ciao.gmane.io with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1jNcrP-000Nz9-72 for geb-bug-gnu-emacs@m.gmane-mx.org; Sun, 12 Apr 2020 15:41:19 +0200 Original-Received: from localhost ([::1]:33592 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1jNcrO-0003Rs-8y for geb-bug-gnu-emacs@m.gmane-mx.org; Sun, 12 Apr 2020 09:41:18 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:59014) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1jNcqD-0002Ce-Qa for bug-gnu-emacs@gnu.org; Sun, 12 Apr 2020 09:40:06 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1jNcqC-0005dT-Om for bug-gnu-emacs@gnu.org; Sun, 12 Apr 2020 09:40:05 -0400 Original-Received: from debbugs.gnu.org ([209.51.188.43]:45975) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1jNcqC-0005dK-LX for bug-gnu-emacs@gnu.org; Sun, 12 Apr 2020 09:40:04 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1jNcqA-0000Ot-4j for bug-gnu-emacs@gnu.org; Sun, 12 Apr 2020 09:40:02 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Eli Zaretskii Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Sun, 12 Apr 2020 13:40:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 39980 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: patch Original-Received: via spool by 39980-submit@debbugs.gnu.org id=B39980.15866987561468 (code B ref 39980); Sun, 12 Apr 2020 13:40:02 +0000 Original-Received: (at 39980) by debbugs.gnu.org; 12 Apr 2020 13:39:16 +0000 Original-Received: from localhost ([127.0.0.1]:57521 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1jNcpQ-0000Nc-7k for submit@debbugs.gnu.org; Sun, 12 Apr 2020 09:39:16 -0400 Original-Received: from eggs.gnu.org ([209.51.188.92]:43777) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1jNcpO-0000NP-4D for 39980@debbugs.gnu.org; Sun, 12 Apr 2020 09:39:14 -0400 Original-Received: from fencepost.gnu.org ([2001:470:142:3::e]:58587) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1jNcpI-0004vS-Ty; Sun, 12 Apr 2020 09:39:08 -0400 Original-Received: from [176.228.60.248] (port=3339 helo=home-c4e4a596f7) by fencepost.gnu.org with esmtpsa (TLS1.2:RSA_AES_256_CBC_SHA1:256) (Exim 4.82) (envelope-from ) id 1jNcpI-0003fp-BF; Sun, 12 Apr 2020 09:39:08 -0400 In-Reply-To: <87k12lc4dz.fsf@gmail.com> (message from =?UTF-8?Q?=C5=A0t=C4=9Bp=C3=A1n_?= =?UTF-8?Q?N=C4=9Bmec?= on Sun, 12 Apr 2020 13:47:20 +0200) X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 209.51.188.43 X-BeenThere: bug-gnu-emacs@gnu.org List-Id: "Bug reports for GNU Emacs, the Swiss army knife of text editors" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Original-Sender: "bug-gnu-emacs" Xref: news.gmane.io gmane.emacs.bugs:178244 Archived-At: > From: Štěpán Němec > 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.