From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.ciao.gmane.io!not-for-mail From: =?UTF-8?Q?=C5=A0t=C4=9Bp=C3=A1n_?= =?UTF-8?Q?N=C4=9Bmec?= Newsgroups: gmane.emacs.bugs Subject: bug#39980: [PATCH] gnus-shorten-url: Improve and avoid args-out-of-range error Date: Sun, 12 Apr 2020 13:47:20 +0200 Message-ID: <87k12lc4dz.fsf@gmail.com> 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> Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Injection-Info: ciao.gmane.io; posting-host="ciao.gmane.io:159.69.161.202"; logging-data="17340"; mail-complaints-to="usenet@ciao.gmane.io" User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/28.0.50 (gnu/linux) Cc: larsi@gnus.org, 39980@debbugs.gnu.org To: Eli Zaretskii Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Sun Apr 12 13:47:13 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 1jNb4y-0004Oj-QB for geb-bug-gnu-emacs@m.gmane-mx.org; Sun, 12 Apr 2020 13:47:12 +0200 Original-Received: from localhost ([::1]:60930 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1jNb4x-00034g-TF for geb-bug-gnu-emacs@m.gmane-mx.org; Sun, 12 Apr 2020 07:47:11 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:50417) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1jNb4p-00034J-2F for bug-gnu-emacs@gnu.org; Sun, 12 Apr 2020 07:47:04 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1jNb4n-00013x-RS for bug-gnu-emacs@gnu.org; Sun, 12 Apr 2020 07:47:03 -0400 Original-Received: from debbugs.gnu.org ([209.51.188.43]:45918) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1jNb4n-00013p-MP for bug-gnu-emacs@gnu.org; Sun, 12 Apr 2020 07:47:01 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1jNb4n-00064R-Jr for bug-gnu-emacs@gnu.org; Sun, 12 Apr 2020 07:47:01 -0400 X-Loop: help-debbugs@gnu.org Resent-From: =?UTF-8?Q?=C5=A0t=C4=9Bp=C3=A1n_?= =?UTF-8?Q?N=C4=9Bmec?= Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Sun, 12 Apr 2020 11:47:01 +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.158669201323320 (code B ref 39980); Sun, 12 Apr 2020 11:47:01 +0000 Original-Received: (at 39980) by debbugs.gnu.org; 12 Apr 2020 11:46:53 +0000 Original-Received: from localhost ([127.0.0.1]:57464 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1jNb4f-000644-97 for submit@debbugs.gnu.org; Sun, 12 Apr 2020 07:46:53 -0400 Original-Received: from mail-lj1-f196.google.com ([209.85.208.196]:41458) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1jNb4d-00063s-P3 for 39980@debbugs.gnu.org; Sun, 12 Apr 2020 07:46:52 -0400 Original-Received: by mail-lj1-f196.google.com with SMTP id n17so6141293lji.8 for <39980@debbugs.gnu.org>; Sun, 12 Apr 2020 04:46:51 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:in-reply-to:references:user-agent:date :message-id:mime-version:content-transfer-encoding; bh=XPj1wSoNTQMqsOhD+bdcZuj+XEl2hhz1y7CTDeZB2fw=; b=mcQ4Hm1tr3yDbInAz3rxVYUTcCQ8ev/r3E7ndTFYexagMfnRdgh8KqH6qa7rBrbVC0 Lj3XYWVKGaqaXPOEhITrQa4yJIx2r6bcirGxlibARBig3Vgg+VW7inV7GDliNntMAVYt xVGEAzQdPPxEXVaK9VCPXFW1hvOGJQUbaigr2JjbRjTbn/1EOyXYJPI35KHu7OwJSUSZ 4DSRYr385MIuCxwFGuhHtLK+WbXveMO6vamrFO4/TCv6XwMSA4vO5BpKX7hwdoUpcOxs qADxqTxPy9eqgJidySdHX0NpP8OEUmvFq8OCDBWWPX1cTqKBrB9ekEX/v5Egyy6p1e0D ct5w== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:in-reply-to:references :user-agent:date:message-id:mime-version:content-transfer-encoding; bh=XPj1wSoNTQMqsOhD+bdcZuj+XEl2hhz1y7CTDeZB2fw=; b=Pe6YKV736JDTWnsrFA/1EgAQOiCoSFx0kwldLnCC4+eWT98r66H4gUPfqagSmExg8q jX8Bu3amMYr3QWedmTO5pGiz/XMuCwmFP1GEXlNTV1OLG7uqq6Hq0fFIliSPuAzgVEix RdnWIZUxUB1RFRq9KpTKPinWg+3Qz4XYor4+EslDmeiZ3psjygvfGh/WIdfM3OliCmjF QBDtamJ45BzyGZjgVCk/p4lj9ZYqMn69SYbBC2E9bu2JpsvDL19x+9QtvzZSdTeSK8iZ V9cm5eBmfaJEvfELIf3bW45MBBli8X7QJyn6Xhz3WjOlUBM+CA0qx7cfBQw4h0hym6Lw AdFw== X-Gm-Message-State: AGi0PuZ3fDep+6TIch8HmStyYu4utZ88VXAuDu7FiyHaOvfURIEP4Lu2 U0iMUuCfE3Pb85TlMfiY/vQ= X-Google-Smtp-Source: APiQypIgrS6PwUGgyi5beHcJuY2CHJTbzCYYbGweXcVhfe4BxPdnClWwsJDf7JafK1detoi9BYa2SQ== X-Received: by 2002:a2e:908c:: with SMTP id l12mr1901742ljg.40.1586692005635; Sun, 12 Apr 2020 04:46:45 -0700 (PDT) Original-Received: from localhost ([185.112.167.47]) by smtp.gmail.com with ESMTPSA id c22sm5163507ljh.66.2020.04.12.04.46.44 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 12 Apr 2020 04:46:45 -0700 (PDT) In-Reply-To: <83a73hklq3.fsf@gnu.org> (Eli Zaretskii's message of "Sun, 12 Apr 2020 14:05:40 +0300") 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:178236 Archived-At: On Sun, 12 Apr 2020 14:05:40 +0300 Eli Zaretskii wrote: >> The revised patch is upthread >> () > > That's the one I was talking about: it includes changes that aren't > needed to fix the original bug. Those additions make the change > cleaner, but we are way past cleanup time on the release branch. > >> 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? 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? > Btw, this part of the commit log is inaccurate: > > * lisp/vc/ediff-init.el > (ediff-truncate-string-left): Rename to 'string-truncate-left'. > > And this one names the wrong function: > > * lisp/vc/ediff-mult.el (ediff-meta-insert-file-info1) (ediff-draw-dir-= diffs): > 'ediff-draw-dir-diffs' renamed to 'string-truncate-left'. > > And finally, the format of the last entry is slightly off the mark. > It should look like this: > > * lisp/vc/ediff-mult.el (ediff-meta-insert-file-info1) > (ediff-draw-dir-diffs): > > That is, the second parentheses pair should be on a new line. Thank you, how about: * 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. as suggested in https://www.gnu.org/prep/standards/standards.html#Simple-Ch= anges --=20 =C5=A0t=C4=9Bp=C3=A1n