From unknown Sat Jun 21 10:20:48 2025 Content-Disposition: inline Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 X-Mailer: MIME-tools 5.509 (Entity 5.509) Content-Type: text/plain; charset=utf-8 From: bug#39980 <39980@debbugs.gnu.org> To: bug#39980 <39980@debbugs.gnu.org> Subject: Status: [PATCH] gnus-shorten-url: Improve and avoid args-out-of-range error Reply-To: bug#39980 <39980@debbugs.gnu.org> Date: Sat, 21 Jun 2025 17:20:48 +0000 retitle 39980 [PATCH] gnus-shorten-url: Improve and avoid args-out-of-range= error reassign 39980 emacs submitter 39980 =C5=A0t=C4=9Bp=C3=A1n N=C4=9Bmec severity 39980 normal tag 39980 patch thanks From debbugs-submit-bounces@debbugs.gnu.org Sun Mar 08 05:06:22 2020 Received: (at submit) by debbugs.gnu.org; 8 Mar 2020 09:06:22 +0000 Received: from localhost ([127.0.0.1]:47887 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1jArt7-0000tf-N9 for submit@debbugs.gnu.org; Sun, 08 Mar 2020 05:06:22 -0400 Received: from lists.gnu.org ([209.51.188.17]:59034) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1jArt6-0000tW-9V for submit@debbugs.gnu.org; Sun, 08 Mar 2020 05:06:20 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:54039) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1jArt4-0008F3-L0 for bug-gnu-emacs@gnu.org; Sun, 08 Mar 2020 05:06:20 -0400 X-Spam-Checker-Version: SpamAssassin 3.3.2 (2011-06-06) on eggs.gnu.org X-Spam-Level: X-Spam-Status: No, score=0.8 required=5.0 tests=BAYES_50,FREEMAIL_FROM autolearn=disabled version=3.3.2 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1jArt3-0006J7-2R for bug-gnu-emacs@gnu.org; Sun, 08 Mar 2020 05:06:18 -0400 Received: from mail-lf1-x131.google.com ([2a00:1450:4864:20::131]:34882) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1jArt2-0006Ho-PN for bug-gnu-emacs@gnu.org; Sun, 08 Mar 2020 05:06:17 -0400 Received: by mail-lf1-x131.google.com with SMTP id z9so5211834lfa.2 for ; Sun, 08 Mar 2020 01:06:16 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:subject:date:message-id:mime-version :content-transfer-encoding; bh=QBAg1mBDZdRKohkxr6fHtzCzENWNWvydgjdbeAEQAmw=; b=npWb6I0ShyNRti3yz8cfXQycSITs4E8pJK+H14SI31INCPzfPJaL2Xzu2fhROmFzIY vpGYI6hO8WFbU6M8adLrM5aP9F3ZHr1VlAXcVgrzZ4eLeLcG6QvWSD9091FuUTDHEXQn o+hLyB8gEke4HuaibpzhEaIG0SI92CKzP6gE9rQWBJuK7HD4n/AMnDwuUkzGEwQd6o8R iiMa76whfUaWR4HylzwWcYY5AS6JBzFsBsfLMWGtucTlp+/sYOaYRdHpECivBKslQAUs v+9qYNv/7fMmZwg2WixUwk4RIgOUiTE8lgcVe91p1QR2vYgc0QYwM8ndeE/iDorPUTjZ UdFQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:subject:date:message-id:mime-version :content-transfer-encoding; bh=QBAg1mBDZdRKohkxr6fHtzCzENWNWvydgjdbeAEQAmw=; b=SBsPlksSlx2CgSM5qzmXyRH9IdlMM1KiCu8bnanZABeH5uOl4sJ2pDRsVevHIMbpCL dAnOgZSkxUKqSrydgbx+RuWJd3CZztFyo1tcU+YUIaRPfYMMnLeeR5wW1a76zkpx9+MQ W9D3Re4uRg+bllsNiW24QTPl3uAuhgGFyfLfJhwFMEtDw8BgG96fVnyFgVGsZdxFsCm5 W8/sozfTntHfbgfDr6mH6nMct7yuttPMYy3CWvKUC4nYtTIZ+ZVa9nsBeisX/i1GOhNf tg0ZeewYVaD3z24aMDYVOTzNgIzrbI9uGk6IIy5q48I1v+LxBJmNdxuio1nm2zxosS9n v1tQ== X-Gm-Message-State: ANhLgQ2mq/XJjcR5uYJElWNcY45M+UwGsPrmS/Y87O8ZEQW5EKVxZHgF UkkNd96LpmPVNovTtEw7bYtuSHQV X-Google-Smtp-Source: ADFU+vvHihZ4CkDX2CUP/ldHo5OWDj16yuWMgBZpY6BUC0pexC8/fjPq2SWPyYDOWh9kgcNEwXU89A== X-Received: by 2002:ac2:43c8:: with SMTP id u8mr6395043lfl.180.1583658374350; Sun, 08 Mar 2020 01:06:14 -0800 (PST) Received: from localhost ([185.112.167.59]) by smtp.gmail.com with ESMTPSA id s16sm10281088ljs.65.2020.03.08.01.06.13 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 08 Mar 2020 01:06:13 -0800 (PST) From: =?UTF-8?q?=C5=A0t=C4=9Bp=C3=A1n=20N=C4=9Bmec?= To: bug-gnu-emacs@gnu.org Subject: [PATCH] gnus-shorten-url: Improve and avoid args-out-of-range error Date: Sun, 8 Mar 2020 10:06:30 +0100 Message-Id: <20200308090630.41238-1-stepnem@gmail.com> X-Mailer: git-send-email 2.25.1 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 2a00:1450:4864:20::131 X-Spam-Score: 0.3 (/) X-Debbugs-Envelope-To: submit X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -0.7 (/) 'gnus-shorten-url' (used by 'gnus-summary-browse-url') ignored fragment identifiers and didn't check substring bounds, in some cases leading to runtime errors, e.g.: (gnus-shorten-url "https://some.url.with/path/and#also_a_long_target" 40) ;; => Lisp error: (args-out-of-range "/path/and" -18 nil) This commit makes it account for #fragments and fixes faulty string computation, reusing existing helper function. * lisp/vc/ediff-init.el (ediff-truncate-string-left): Rename to 'string-truncate-left'. * lisp/emacs-lisp/subr-x.el (string-truncate-left): Move here. * lisp/vc/ediff-mult.el (ediff-meta-insert-file-info1) (ediff-draw-dir-diffs): 'ediff-draw-dir-diffs' renamed to 'string-truncate-left'. * lisp/gnus/gnus-sum.el (gnus-shorten-url): Fix args-out-of-range error, don't drop #fragments, use 'string-truncate-left'. --- lisp/emacs-lisp/subr-x.el | 8 ++++++++ lisp/gnus/gnus-sum.el | 14 +++++++------- lisp/vc/ediff-init.el | 10 ---------- lisp/vc/ediff-mult.el | 10 ++++++---- 4 files changed, 21 insertions(+), 21 deletions(-) diff --git a/lisp/emacs-lisp/subr-x.el b/lisp/emacs-lisp/subr-x.el index 044c9aada0..baf20131cc 100644 --- a/lisp/emacs-lisp/subr-x.el +++ b/lisp/emacs-lisp/subr-x.el @@ -236,6 +236,14 @@ string-trim TRIM-LEFT and TRIM-RIGHT default to \"[ \\t\\n\\r]+\"." (string-trim-left (string-trim-right string trim-right) trim-left)) +(defsubst string-truncate-left (string length) + "Truncate STRING to LENGTH, replacing initial surplus with \"...\"." + (let ((strlen (length string))) + (if (<= strlen length) + string + (setq length (max 0 (- length 3))) + (concat "..." (substring string (max 0 (- strlen 1 length))))))) + (defsubst string-blank-p (string) "Check whether STRING is either empty or only whitespace. The following characters count as whitespace here: space, tab, newline and diff --git a/lisp/gnus/gnus-sum.el b/lisp/gnus/gnus-sum.el index a47e657623..6f367692dd 100644 --- a/lisp/gnus/gnus-sum.el +++ b/lisp/gnus/gnus-sum.el @@ -9494,15 +9494,15 @@ gnus-collect-urls (delete-dups urls))) (defun gnus-shorten-url (url max) - "Return an excerpt from URL." + "Return an excerpt from URL not exceeding MAX characters." (if (<= (length url) max) url - (let ((parsed (url-generic-parse-url url))) - (concat (url-host parsed) - "..." - (substring (url-filename parsed) - (- (length (url-filename parsed)) - (max (- max (length (url-host parsed))) 0))))))) + (let* ((parsed (url-generic-parse-url url)) + (host (url-host parsed)) + (rest (concat (url-filename parsed) + (when-let ((target (url-target parsed))) + (concat "#" target))))) + (concat host (string-truncate-left rest (- max (length host))))))) (defun gnus-summary-browse-url (&optional external) "Scan the current article body for links, and offer to browse them. diff --git a/lisp/vc/ediff-init.el b/lisp/vc/ediff-init.el index cbd8c0d322..c7498064dc 100644 --- a/lisp/vc/ediff-init.el +++ b/lisp/vc/ediff-init.el @@ -1524,16 +1524,6 @@ ediff-strip-last-dir (setq dir (substring dir 0 pos))) (ediff-abbreviate-file-name (file-name-directory dir)))) -(defun ediff-truncate-string-left (str newlen) - ;; leave space for ... on the left - (let ((len (length str)) - substr) - (if (<= len newlen) - str - (setq newlen (max 0 (- newlen 3))) - (setq substr (substring str (max 0 (- len 1 newlen)))) - (concat "..." substr)))) - (defsubst ediff-nonempty-string-p (string) (and (stringp string) (not (string= string "")))) diff --git a/lisp/vc/ediff-mult.el b/lisp/vc/ediff-mult.el index fee87e8352..5dcb42eb64 100644 --- a/lisp/vc/ediff-mult.el +++ b/lisp/vc/ediff-mult.el @@ -113,6 +113,8 @@ ediff-mult (require 'ediff-wind) (require 'ediff-util) +(eval-when-compile + (require 'subr-x)) ; string-truncate-left ;; meta-buffer (ediff-defvar-local ediff-meta-buffer nil "") @@ -1172,7 +1174,7 @@ ediff-meta-insert-file-info1 ;; abbreviate the file name, if file exists (if (and (not (stringp fname)) (< file-size -1)) "-------" ; file doesn't exist - (ediff-truncate-string-left + (string-truncate-left (ediff-abbreviate-file-name fname) max-filename-width))))))) @@ -1266,7 +1268,7 @@ ediff-draw-dir-diffs (if (= (mod membership-code ediff-membership-code1) 0) ; dir1 (let ((beg (point))) (insert (format "%-27s" - (ediff-truncate-string-left + (string-truncate-left (ediff-abbreviate-file-name (if (file-directory-p (concat dir1 file)) (file-name-as-directory file) @@ -1281,7 +1283,7 @@ ediff-draw-dir-diffs (if (= (mod membership-code ediff-membership-code2) 0) ; dir2 (let ((beg (point))) (insert (format "%-26s" - (ediff-truncate-string-left + (string-truncate-left (ediff-abbreviate-file-name (if (file-directory-p (concat dir2 file)) (file-name-as-directory file) @@ -1295,7 +1297,7 @@ ediff-draw-dir-diffs (if (= (mod membership-code ediff-membership-code3) 0) ; dir3 (let ((beg (point))) (insert (format " %-25s" - (ediff-truncate-string-left + (string-truncate-left (ediff-abbreviate-file-name (if (file-directory-p (concat dir3 file)) (file-name-as-directory file) -- 2.25.1 From debbugs-submit-bounces@debbugs.gnu.org Sat Mar 14 07:41:44 2020 Received: (at 39980) by debbugs.gnu.org; 14 Mar 2020 11:41:44 +0000 Received: from localhost ([127.0.0.1]:60666 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1jD5Am-0008IW-8W for submit@debbugs.gnu.org; Sat, 14 Mar 2020 07:41:44 -0400 Received: from quimby.gnus.org ([95.216.78.240]:56224) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1jD5Al-0008IJ-38 for 39980@debbugs.gnu.org; Sat, 14 Mar 2020 07:41:43 -0400 Received: from cm-84.212.202.86.getinternet.no ([84.212.202.86] helo=marnie) by quimby.gnus.org with esmtpsa (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1jD5Ad-0001Lt-8F; Sat, 14 Mar 2020 12:41:37 +0100 From: Lars Ingebrigtsen To: =?utf-8?B?xaB0xJtww6FuIE7Em21lYw==?= Subject: Re: bug#39980: [PATCH] gnus-shorten-url: Improve and avoid args-out-of-range error References: <20200308090630.41238-1-stepnem@gmail.com> Date: Sat, 14 Mar 2020 12:41:34 +0100 In-Reply-To: <20200308090630.41238-1-stepnem@gmail.com> (=?utf-8?B?IsWg?= =?utf-8?B?dMSbcMOhbiBOxJttZWMiJ3M=?= message of "Sun, 8 Mar 2020 10:06:30 +0100") Message-ID: <87pndf17v5.fsf@gnus.org> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/28.0.50 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable X-Spam-Report: Spam detection software, running on the system "quimby.gnus.org", has NOT identified this incoming email as spam. The original message has been attached to this so you can view it or label similar future email. If you have any questions, see @@CONTACT_ADDRESS@@ for details. Content preview: Štěpán Němec writes: > 'gnus-shorten-url' (used by 'gnus-summary-browse-url') ignored > fragment identifiers and didn't check substring bounds, in some cases > leading to runtime errors, e.g.: > > (gnus-shorten-url "https [...] Content analysis details: (-2.9 points, 5.0 required) pts rule name description ---- ---------------------- -------------------------------------------------- 0.0 URIBL_BLOCKED ADMINISTRATOR NOTICE: The query to URIBL was blocked. See http://wiki.apache.org/spamassassin/DnsBlocklists#dnsbl-block for more information. [URIs: ingebrigtsen.no] -1.0 ALL_TRUSTED Passed through trusted hosts only via SMTP -1.9 BAYES_00 BODY: Bayes spam probability is 0 to 1% [score: 0.0000] X-Spam-Score: 0.0 (/) X-Debbugs-Envelope-To: 39980 Cc: 39980@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.0 (-) =C5=A0t=C4=9Bp=C3=A1n N=C4=9Bmec writes: > 'gnus-shorten-url' (used by 'gnus-summary-browse-url') ignored > fragment identifiers and didn't check substring bounds, in some cases > leading to runtime errors, e.g.: > > (gnus-shorten-url "https://some.url.with/path/and#also_a_long_target" 4= 0) > ;; =3D> Lisp error: (args-out-of-range "/path/and" -18 nil) > > This commit makes it account for #fragments and fixes faulty string > computation, reusing existing helper function. Looks like a good fix to me, but is there a reason this is a defsubst instead of a defun? +(defsubst string-truncate-left (string length) --=20 (domestic pets only, the antidote for overdose, milk.) bloggy blog: http://lars.ingebrigtsen.no From debbugs-submit-bounces@debbugs.gnu.org Sat Mar 14 12:34:36 2020 Received: (at 39980) by debbugs.gnu.org; 14 Mar 2020 16:34:36 +0000 Received: from localhost ([127.0.0.1]:33865 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1jD9kB-0004Ox-Nr for submit@debbugs.gnu.org; Sat, 14 Mar 2020 12:34:35 -0400 Received: from mail-lj1-f174.google.com ([209.85.208.174]:38707) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1jD9k9-0004Ok-PR for 39980@debbugs.gnu.org; Sat, 14 Mar 2020 12:34:34 -0400 Received: by mail-lj1-f174.google.com with SMTP id w1so13987626ljh.5 for <39980@debbugs.gnu.org>; Sat, 14 Mar 2020 09:34:33 -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=SAqdCxT/0MxZRAleo+N+la2K3/l9RMT5Rmvbvph8KYY=; b=PI9eSXekaU4a8HYmckycJoqA4+HJNrD7zBWhFKCYqjiF2hAft7oRzEDqtQ+pAuJ98R RNTSdL2kzCBupXfOBdLoOkxskZl1vkQCkAYhOsupXMKwMXqCXE26OHsk4BBywwtK4I8E YoeFlpqoop5ZdWavo+VjHSQEODmZzAajehc6F0iZ+62DcO/YlLMARJgprHJyX3wFPpEe 9QH9gwJNgdjqDbfvcnvIpCnjXjRNEj3Bb8maTPiA5A/NQALRZ1mPWBdXb4SBIoiHov1m +2ed5YzFc4v/BFQOyb7E74UOXtKIMwRd0Lj13cnBTji0QTbCPreaPrDNPyELKxw4UMMM 8UVw== 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=SAqdCxT/0MxZRAleo+N+la2K3/l9RMT5Rmvbvph8KYY=; b=DSQL7TbPIXcTVfVt74RTdsEP2wu9YXj+jJxHjupI2fmdzj0E9whIG9Uo0f9jNPibkE 4JfZpSZIFhRLAo1Rs9+hVPE+GkUezZ/F4mTk8XthcisoZLEYSZCjP+093o/oLdjslXWo cZQAySpjwy/vgXtCtoh0XtSpc78s1Sx3nkXrBTHEoi/fveAlXtH8O3P4BQ1mzG1CM+Av 4ZNtgTbzGd1f25TJorYk92ctA7tfkNCvEtwW8yS2WlwrzsSTzUBDGnbroWB7xVFjT4NO e0Z+M0uZ7ueXY/3ioCt0OfE+vDD1kNg7xTFFM6R/QgiuyllG9qdCb5HHBzyeads0tCbL RZXQ== X-Gm-Message-State: ANhLgQ1GgSjBrsbYMRyA8xko5FxnDj26TL48Pb2ETb5GSm7pqeVfMRpC uIRiyCA05Y8ABsiJkI8+i2Y= X-Google-Smtp-Source: ADFU+vukzzkAOG0QRxpIhmrZsxjQeXiUrat/HTovBPGQVyG14DgbWbfTeRh/WmiE0Ueq27IG6O887A== X-Received: by 2002:a2e:3a11:: with SMTP id h17mr4073368lja.110.1584203667709; Sat, 14 Mar 2020 09:34:27 -0700 (PDT) Received: from localhost ([185.112.167.59]) by smtp.gmail.com with ESMTPSA id h14sm1055105lfc.24.2020.03.14.09.34.26 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 14 Mar 2020 09:34:26 -0700 (PDT) From: =?utf-8?B?xaB0xJtww6FuIE7Em21lYw==?= To: Lars Ingebrigtsen Subject: Re: bug#39980: [PATCH] gnus-shorten-url: Improve and avoid args-out-of-range error In-Reply-To: <87pndf17v5.fsf@gnus.org> (Lars Ingebrigtsen's message of "Sat, 14 Mar 2020 12:41:34 +0100") References: <20200308090630.41238-1-stepnem@gmail.com> <87pndf17v5.fsf@gnus.org> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/28.0.50 (gnu/linux) Date: Sat, 14 Mar 2020 17:34:46 +0100 Message-ID: <87zhcinbdl.fsf@gmail.com> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable X-Spam-Score: 3.6 (+++) X-Spam-Report: Spam detection software, running on the system "debbugs.gnu.org", has NOT identified this incoming email as spam. The original message has been attached to this so you can view it or label similar future email. If you have any questions, see the administrator of that system for details. Content preview: On Sat, 14 Mar 2020 12:41:34 +0100 Lars Ingebrigtsen wrote: > Looks like a good fix to me, but is there a reason this is a defsubst > instead of a defun? > > +(defsubst string-truncate-left (string length) Content analysis details: (3.6 points, 10.0 required) pts rule name description ---- ---------------------- -------------------------------------------------- -0.0 SPF_PASS SPF: sender matches SPF record 3.6 RCVD_IN_SBL_CSS RBL: Received via a relay in Spamhaus SBL-CSS [185.112.167.59 listed in zen.spamhaus.org] 0.0 SPF_HELO_NONE SPF: HELO does not publish an SPF Record 0.0 FREEMAIL_FROM Sender email is commonly abused enduser mail provider (stepnem[at]gmail.com) -0.0 RCVD_IN_DNSWL_NONE RBL: Sender listed at https://www.dnswl.org/, no trust [209.85.208.174 listed in list.dnswl.org] -0.0 RCVD_IN_MSPIKE_H2 RBL: Average reputation (+2) [209.85.208.174 listed in wl.mailspike.net] X-Debbugs-Envelope-To: 39980 Cc: 39980@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: 2.6 (++) X-Spam-Report: Spam detection software, running on the system "debbugs.gnu.org", has NOT identified this incoming email as spam. The original message has been attached to this so you can view it or label similar future email. If you have any questions, see the administrator of that system for details. Content preview: On Sat, 14 Mar 2020 12:41:34 +0100 Lars Ingebrigtsen wrote: > Looks like a good fix to me, but is there a reason this is a defsubst > instead of a defun? > > +(defsubst string-truncate-left (string length) Content analysis details: (2.6 points, 10.0 required) pts rule name description ---- ---------------------- -------------------------------------------------- -0.0 RCVD_IN_MSPIKE_H2 RBL: Average reputation (+2) [209.85.208.174 listed in wl.mailspike.net] -0.0 RCVD_IN_DNSWL_NONE RBL: Sender listed at https://www.dnswl.org/, no trust [209.85.208.174 listed in list.dnswl.org] 3.6 RCVD_IN_SBL_CSS RBL: Received via a relay in Spamhaus SBL-CSS [185.112.167.59 listed in zen.spamhaus.org] -0.0 SPF_PASS SPF: sender matches SPF record 0.0 SPF_HELO_NONE SPF: HELO does not publish an SPF Record 0.0 FREEMAIL_FROM Sender email is commonly abused enduser mail provider (stepnem[at]gmail.com) -1.0 MAILING_LIST_MULTI Multiple indicators imply a widely-seen list manager On Sat, 14 Mar 2020 12:41:34 +0100 Lars Ingebrigtsen wrote: > Looks like a good fix to me, but is there a reason this is a defsubst > instead of a defun? > > +(defsubst string-truncate-left (string length) subr-x is supposed to be loaded at compile time (see the file's Commentary), so, with the single exception of `replace-region-contents' (I wonder how that happened...), everything in there is either a macro or a defsubst. I would personally welcome lifting that limitation (again, what about that one exception which needs to load it at run time, anyway?) as IME it causes confusion with some users and package developers, too, but I'm not sure that's an option. --=20 =C5=A0t=C4=9Bp=C3=A1n From debbugs-submit-bounces@debbugs.gnu.org Sat Mar 14 14:03:36 2020 Received: (at 39980) by debbugs.gnu.org; 14 Mar 2020 18:03:36 +0000 Received: from localhost ([127.0.0.1]:33962 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1jDB8K-0008W4-3f for submit@debbugs.gnu.org; Sat, 14 Mar 2020 14:03:36 -0400 Received: from quimby.gnus.org ([95.216.78.240]:59652) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1jDB8I-0008Vr-MC for 39980@debbugs.gnu.org; Sat, 14 Mar 2020 14:03:35 -0400 Received: from cm-84.212.202.86.getinternet.no ([84.212.202.86] helo=marnie) by quimby.gnus.org with esmtpsa (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1jDB89-0004Xc-Rb; Sat, 14 Mar 2020 19:03:28 +0100 From: Lars Ingebrigtsen To: =?utf-8?B?xaB0xJtww6FuIE7Em21lYw==?= Subject: Re: bug#39980: [PATCH] gnus-shorten-url: Improve and avoid args-out-of-range error References: <20200308090630.41238-1-stepnem@gmail.com> <87pndf17v5.fsf@gnus.org> <87zhcinbdl.fsf@gmail.com> Date: Sat, 14 Mar 2020 19:03:24 +0100 In-Reply-To: <87zhcinbdl.fsf@gmail.com> (=?utf-8?B?IsWgdMSbcMOhbiBOxJtt?= =?utf-8?B?ZWMiJ3M=?= message of "Sat, 14 Mar 2020 17:34:46 +0100") Message-ID: <87d09ezudv.fsf@gnus.org> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/28.0.50 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable X-Spam-Report: Spam detection software, running on the system "quimby.gnus.org", has NOT identified this incoming email as spam. The original message has been attached to this so you can view it or label similar future email. If you have any questions, see @@CONTACT_ADDRESS@@ for details. Content preview: Štěpán Němec writes: > subr-x is supposed to be loaded at compile time (see the file's > Commentary), so, with the single exception of `replace-region-contents' > (I wonder how that happened...), everything in there is ei [...] Content analysis details: (-2.9 points, 5.0 required) pts rule name description ---- ---------------------- -------------------------------------------------- 0.0 URIBL_BLOCKED ADMINISTRATOR NOTICE: The query to URIBL was blocked. See http://wiki.apache.org/spamassassin/DnsBlocklists#dnsbl-block for more information. [URIs: gnu.org] -1.0 ALL_TRUSTED Passed through trusted hosts only via SMTP -1.9 BAYES_00 BODY: Bayes spam probability is 0 to 1% [score: 0.0000] X-Spam-Score: 0.0 (/) X-Debbugs-Envelope-To: 39980 Cc: 39980@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.0 (-) =C5=A0t=C4=9Bp=C3=A1n N=C4=9Bmec writes: > subr-x is supposed to be loaded at compile time (see the file's > Commentary), so, with the single exception of `replace-region-contents' > (I wonder how that happened...), everything in there is either a macro > or a defsubst. The commentary is: ;; Less commonly used functions that complement basic APIs, often implement= ed in ;; C code (like hash-tables and strings), and are not eligible for inclusion ;; in subr.el. ;; Do not document these functions in the lispref. ;; https://lists.gnu.org/r/emacs-devel/2014-01/msg01006.html ;; NB If you want to use this library, it's almost always correct to use: ;; (eval-when-compile (require 'subr-x)) So it's just stuff that's not supposed to be in subr.el but is otherwise subr-ey? I don't know why it's become almost all substs and macros, but it seems odd to decide to make things that look like a perfectly good defun into a defsubst just because we're sticking it in subr-x. --=20 (domestic pets only, the antidote for overdose, milk.) bloggy blog: http://lars.ingebrigtsen.no From debbugs-submit-bounces@debbugs.gnu.org Sat Mar 14 14:12:40 2020 Received: (at 39980) by debbugs.gnu.org; 14 Mar 2020 18:12:40 +0000 Received: from localhost ([127.0.0.1]:33967 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1jDBH6-0000Gu-1B for submit@debbugs.gnu.org; Sat, 14 Mar 2020 14:12:40 -0400 Received: from mail-wr1-f68.google.com ([209.85.221.68]:38177) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1jDBH4-0000Gi-8f for 39980@debbugs.gnu.org; Sat, 14 Mar 2020 14:12:38 -0400 Received: by mail-wr1-f68.google.com with SMTP id x11so11436596wrv.5 for <39980@debbugs.gnu.org>; Sat, 14 Mar 2020 11:12:38 -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=/BuLUL9r3aHo9SuHJ8HowT4FWxI/q9F0MWvS/QnKcLY=; b=Hd4TIw630g/1hDT0jEE7i/dYptXq8KY8au+5iRR6c0wO1FNG63ZhqycxBM/xFarqPz UX47cieJHekrvGnIRR2OSTjpGaGVWPHvOnkSvBWKmA4LhTozPleUoCFHOnpBaLxcI8F4 Jx6kjDg5Pv8RtPBun4nkSbQ0zM8X0BHOKGBZL8BcpGu+J3Q2qhqYwLCsVMA5u+31d6ab 1GqvUl9S6NQlrZogw9A7V2768tkVwcrg2Mzz8Jja/q/CfOYW8by+ncxHvfj/DXabp+rA +22XkZvRvJxrtR/8S+ZqPZd9Z737lMtTFCzDJBIidu5VE6VQu5xIB1OMssuv7VJRukuC 8xEw== 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=/BuLUL9r3aHo9SuHJ8HowT4FWxI/q9F0MWvS/QnKcLY=; b=ZaA1o/gWXJmuzugCr9FPcGZLbuthoj4gImBDJ61xZvcm5sYl7omNkOq+5NLOvZos9i FgKUT6rZTmcMcy5MHh9MSuNdblFYDod2xTw8aVIM/n0yCJNpVuRftPDkdPp2D6LPF9cJ D42xrtUrrSZ4N1+15ZqMrHf8eblXbPaueDzh8x4fC/9s6QMXyLQ/p08WDHXF2oixblIL 3VecNmiE3K5996YG5GguuTaC90ftopmphH9zhol+cZ2pJl1FXFBENurBG7YkPxQD8mtT rKSodkJbvP9rvcYBqS7WJ/KV29ulVzlgIQUlEZDJfHGDNL2pa0ReMiW1ABEU5yOureri TRpQ== X-Gm-Message-State: ANhLgQ2jUKzo0xRhtunDA8vaVOzFFOfXtf8IVYOEiiTbbS6Fb2ppFskI DbxTp6mqmb/RSqr/ixERMmM= X-Google-Smtp-Source: ADFU+vs+Iujv49dz5LvqFBwdIGDC8gG3Be+EcFg0hfFbpzdrxcvsS0fYZQvgusNFHXzEajVkdS8rYQ== X-Received: by 2002:adf:f14a:: with SMTP id y10mr24632641wro.325.1584209552491; Sat, 14 Mar 2020 11:12:32 -0700 (PDT) Received: from localhost ([185.112.167.59]) by smtp.gmail.com with ESMTPSA id 96sm5123492wrm.63.2020.03.14.11.12.31 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 14 Mar 2020 11:12:31 -0700 (PDT) From: =?utf-8?B?xaB0xJtww6FuIE7Em21lYw==?= To: Lars Ingebrigtsen Subject: Re: bug#39980: [PATCH] gnus-shorten-url: Improve and avoid args-out-of-range error In-Reply-To: <87d09ezudv.fsf@gnus.org> References: <20200308090630.41238-1-stepnem@gmail.com> <87pndf17v5.fsf@gnus.org> <87zhcinbdl.fsf@gmail.com> <87d09ezudv.fsf@gnus.org> User-Agent: Notmuch/0.29.3 (https://notmuchmail.org) Emacs/28.0.50 (x86_64-pc-linux-gnu) Date: Sat, 14 Mar 2020 19:12:51 +0100 Message-ID: <87v9n6n6u4.fsf@gmail.com> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable X-Spam-Score: 3.6 (+++) X-Spam-Report: Spam detection software, running on the system "debbugs.gnu.org", has NOT identified this incoming email as spam. The original message has been attached to this so you can view it or label similar future email. If you have any questions, see the administrator of that system for details. Content preview: On Sat, 14 Mar 2020 19:03:24 +0100 Lars Ingebrigtsen wrote: > I don't know why it's become almost all substs and macros, but it > seems odd to decide to make things that look like a perfectly good > defun into a defsubst just because we're sticking it in subr- [...] Content analysis details: (3.6 points, 10.0 required) pts rule name description ---- ---------------------- -------------------------------------------------- -0.0 SPF_PASS SPF: sender matches SPF record 3.6 RCVD_IN_SBL_CSS RBL: Received via a relay in Spamhaus SBL-CSS [185.112.167.59 listed in zen.spamhaus.org] 0.0 SPF_HELO_NONE SPF: HELO does not publish an SPF Record 0.0 FREEMAIL_FROM Sender email is commonly abused enduser mail provider (stepnem[at]gmail.com) -0.0 RCVD_IN_DNSWL_NONE RBL: Sender listed at https://www.dnswl.org/, no trust [209.85.221.68 listed in list.dnswl.org] -0.0 RCVD_IN_MSPIKE_H2 RBL: Average reputation (+2) [209.85.221.68 listed in wl.mailspike.net] X-Debbugs-Envelope-To: 39980 Cc: 39980@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: 2.6 (++) X-Spam-Report: Spam detection software, running on the system "debbugs.gnu.org", has NOT identified this incoming email as spam. The original message has been attached to this so you can view it or label similar future email. If you have any questions, see the administrator of that system for details. Content preview: On Sat, 14 Mar 2020 19:03:24 +0100 Lars Ingebrigtsen wrote: > I don't know why it's become almost all substs and macros, but it > seems odd to decide to make things that look like a perfectly good > defun into a defsubst just because we're sticking it in subr- [...] Content analysis details: (2.6 points, 10.0 required) pts rule name description ---- ---------------------- -------------------------------------------------- -0.0 RCVD_IN_MSPIKE_H2 RBL: Average reputation (+2) [209.85.221.68 listed in wl.mailspike.net] -0.0 RCVD_IN_DNSWL_NONE RBL: Sender listed at https://www.dnswl.org/, no trust [209.85.221.68 listed in list.dnswl.org] 3.6 RCVD_IN_SBL_CSS RBL: Received via a relay in Spamhaus SBL-CSS [185.112.167.59 listed in zen.spamhaus.org] -0.0 SPF_PASS SPF: sender matches SPF record 0.0 SPF_HELO_NONE SPF: HELO does not publish an SPF Record 0.0 FREEMAIL_FROM Sender email is commonly abused enduser mail provider (stepnem[at]gmail.com) -1.0 MAILING_LIST_MULTI Multiple indicators imply a widely-seen list manager On Sat, 14 Mar 2020 19:03:24 +0100 Lars Ingebrigtsen wrote: > I don't know why it's become almost all substs and macros, but it > seems odd to decide to make things that look like a perfectly good > defun into a defsubst just because we're sticking it in subr-x. Indeed, but the same could be said about all the other string functions already in there, so I can't think of any other reason for them being defsubsts than avoiding runtime loading of the library, and the commentary seems to kinda imply that, too, doesn't it? --=20 =C5=A0t=C4=9Bp=C3=A1n From debbugs-submit-bounces@debbugs.gnu.org Sat Mar 14 14:15:23 2020 Received: (at 39980) by debbugs.gnu.org; 14 Mar 2020 18:15:23 +0000 Received: from localhost ([127.0.0.1]:33977 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1jDBJj-0000M4-LB for submit@debbugs.gnu.org; Sat, 14 Mar 2020 14:15:23 -0400 Received: from eggs.gnu.org ([209.51.188.92]:46842) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1jDBJh-0000Lp-0S for 39980@debbugs.gnu.org; Sat, 14 Mar 2020 14:15:22 -0400 Received: from fencepost.gnu.org ([2001:470:142:3::e]:42308) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1jDBJb-0003xX-TQ; Sat, 14 Mar 2020 14:15:15 -0400 Received: from [176.228.60.248] (port=2761 helo=home-c4e4a596f7) by fencepost.gnu.org with esmtpsa (TLS1.2:RSA_AES_256_CBC_SHA1:256) (Exim 4.82) (envelope-from ) id 1jDBJa-0004Ci-4C; Sat, 14 Mar 2020 14:15:15 -0400 Date: Sat, 14 Mar 2020 20:15:07 +0200 Message-Id: <83zhciby6s.fsf@gnu.org> From: Eli Zaretskii To: Lars Ingebrigtsen In-Reply-To: <87d09ezudv.fsf@gnus.org> (message from Lars Ingebrigtsen on Sat, 14 Mar 2020 19:03:24 +0100) Subject: Re: bug#39980: [PATCH] gnus-shorten-url: Improve and avoid args-out-of-range error References: <20200308090630.41238-1-stepnem@gmail.com> <87pndf17v5.fsf@gnus.org> <87zhcinbdl.fsf@gmail.com> <87d09ezudv.fsf@gnus.org> X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Spam-Score: -0.7 (/) X-Debbugs-Envelope-To: 39980 Cc: stepnem@gmail.com, 39980@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.7 (-) > From: Lars Ingebrigtsen > Date: Sat, 14 Mar 2020 19:03:24 +0100 > Cc: 39980@debbugs.gnu.org > > I don't know why it's become almost all substs and macros, but it > seems odd to decide to make things that look like a perfectly good > defun into a defsubst just because we're sticking it in subr-x. I tend to agree, FWIW. From debbugs-submit-bounces@debbugs.gnu.org Sat Mar 28 10:17:38 2020 Received: (at 39980) by debbugs.gnu.org; 28 Mar 2020 14:17:38 +0000 Received: from localhost ([127.0.0.1]:34911 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1jICHK-0006b7-5P for submit@debbugs.gnu.org; Sat, 28 Mar 2020 10:17:38 -0400 Received: from mail-lf1-f43.google.com ([209.85.167.43]:33911) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1jICHI-0006as-00 for 39980@debbugs.gnu.org; Sat, 28 Mar 2020 10:17:36 -0400 Received: by mail-lf1-f43.google.com with SMTP id e7so10219771lfq.1 for <39980@debbugs.gnu.org>; Sat, 28 Mar 2020 07:17:35 -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; bh=rur5Sh1NPqixPwS88F5ICrMw+X1IkvZM1vb+A0e00yA=; b=QgsAhpO5WvYC6fKJuxzyaPAOlhSqQi1iY+wfxJfxgRBDax48i0+C3qZF8Z8UMTh73i 8dOmyIV1xro4EpiZGq1gajhx4x3IOG8MPik2CP86aaGiT84y5XGqXvpvDKq95rK+9rAQ TZX+y6py4u/d8hmUWtBzrYUvRSEJyKac4Rafj4jrdrRh0nFqlwn1Vtkq30HjrH+CPJX1 pg4LrpLlx+/cmbwnNV4hnKepw1aZ83k0nPLx5osm+q+K0mizBB+HZfPNxebSjqO4mz3q Rb0evS1dw7F7FGEnpARXXf6Dx6LHUThIcwXFEvQKFphqo7lJ5UiZS66MjWAdhovTyfwM MHQA== 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; bh=rur5Sh1NPqixPwS88F5ICrMw+X1IkvZM1vb+A0e00yA=; b=mdEU5h/gbpGwpVSgyS4WGtKCalUe71nazK1ndI/OvRcEVbSvv2yYKNCMVtbI6HkJd2 p3G+aGmBChcqAZnBjoxEM3dDzdFdenNyCZuhhzx7zj4zqeWaLcJuM4TtREn/CcDr6Y0X QsfJTBUl4BfvM/AccVKKsTWC5iCpeVJeJDZ2x7iF4B6HqWHnR9Ni4uK47J5axRTcCyYV z74HvUNWJvckRfOMUJLXuAanWa0zwV4LS5sJiGvT2w2fxHhsvweG+3K3oYBise6ZXIbw LkeuJgXPLFXyPlBf0kJUQZNdEU2Al4lAmRZsg/J5XZPd280ma2x2St75rbMWJoR5gApA jENw== X-Gm-Message-State: AGi0PuZu4PYfAmkkH3JgNXmt6srqZpxybx9Sv9snjidJTM8oX391fIuD wgU0OSdZl28ziK2zbHbdTvU= X-Google-Smtp-Source: APiQypJ1UveEarB6blVXaT5h1CFcNY8c8mykWMyi52pNvnEs7yrpb4Gj3cxO05ZeegGy2A0R6zVruQ== X-Received: by 2002:a05:6512:3195:: with SMTP id i21mr2822352lfe.186.1585405049970; Sat, 28 Mar 2020 07:17:29 -0700 (PDT) Received: from localhost ([185.112.167.47]) by smtp.gmail.com with ESMTPSA id i18sm4564334lfe.15.2020.03.28.07.17.28 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 28 Mar 2020 07:17:29 -0700 (PDT) From: =?utf-8?B?xaB0xJtww6FuIE7Em21lYw==?= To: Eli Zaretskii , Lars Ingebrigtsen Subject: Re: bug#39980: [PATCH] gnus-shorten-url: Improve and avoid args-out-of-range error In-Reply-To: <83zhciby6s.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> User-Agent: Notmuch/0.29.3 (https://notmuchmail.org) Emacs/28.0.50 (x86_64-pc-linux-gnu) Date: Sat, 28 Mar 2020 15:17:56 +0100 Message-ID: <87imioo963.fsf@gmail.com> MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="=-=-=" X-Spam-Score: 0.0 (/) X-Debbugs-Envelope-To: 39980 Cc: 39980@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.0 (-) --=-=-= Content-Type: text/plain Considering the opinions expressed here and in https://lists.gnu.org/archive/html/emacs-devel/2020-03/msg00541.html I have reverted to defun and autoload the function instead to prevent having to load subr-x at runtime whenever gnus-sum is loaded, as it is currently only used there by `gnus-summary-browse-url'. Revised patch attached. --=-=-= Content-Type: text/x-patch Content-Disposition: inline; filename=0001-gnus-shorten-url-Improve-and-avoid-args-out-of-range.patch >From b6a2daee2e5be0c4aec6d13fe55b6d9df343a07a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=C5=A0t=C4=9Bp=C3=A1n=20N=C4=9Bmec?= Date: Sat, 7 Mar 2020 18:26:44 +0100 Subject: [PATCH] gnus-shorten-url: Improve and avoid args-out-of-range error 'gnus-shorten-url' (used by 'gnus-summary-browse-url') ignored fragment identifiers and didn't check substring bounds, in some cases leading to runtime errors, e.g.: (gnus-shorten-url "https://some.url.with/path/and#also_a_long_target" 40) ;; => Lisp error: (args-out-of-range "/path/and" -18 nil) This commit makes it account for #fragments and fixes faulty string computation, reusing existing helper function. (bug#39980) * lisp/vc/ediff-init.el (ediff-truncate-string-left): Rename to 'string-truncate-left'. * lisp/emacs-lisp/subr-x.el (string-truncate-left): Move here. * lisp/vc/ediff-mult.el (ediff-meta-insert-file-info1) (ediff-draw-dir-diffs): 'ediff-draw-dir-diffs' renamed to 'string-truncate-left'. * lisp/gnus/gnus-sum.el (gnus-shorten-url): Fix args-out-of-range error, don't drop #fragments, use 'string-truncate-left'. --- lisp/emacs-lisp/subr-x.el | 9 +++++++++ lisp/gnus/gnus-sum.el | 14 +++++++------- lisp/vc/ediff-init.el | 10 ---------- lisp/vc/ediff-mult.el | 9 ++++----- 4 files changed, 20 insertions(+), 22 deletions(-) diff --git a/lisp/emacs-lisp/subr-x.el b/lisp/emacs-lisp/subr-x.el index 044c9aada0..9f96ac50d1 100644 --- a/lisp/emacs-lisp/subr-x.el +++ b/lisp/emacs-lisp/subr-x.el @@ -236,6 +236,15 @@ string-trim TRIM-LEFT and TRIM-RIGHT default to \"[ \\t\\n\\r]+\"." (string-trim-left (string-trim-right string trim-right) trim-left)) +;;;###autoload +(defun string-truncate-left (string length) + "Truncate STRING to LENGTH, replacing initial surplus with \"...\"." + (let ((strlen (length string))) + (if (<= strlen length) + string + (setq length (max 0 (- length 3))) + (concat "..." (substring string (max 0 (- strlen 1 length))))))) + (defsubst string-blank-p (string) "Check whether STRING is either empty or only whitespace. The following characters count as whitespace here: space, tab, newline and diff --git a/lisp/gnus/gnus-sum.el b/lisp/gnus/gnus-sum.el index a47e657623..6f367692dd 100644 --- a/lisp/gnus/gnus-sum.el +++ b/lisp/gnus/gnus-sum.el @@ -9494,15 +9494,15 @@ gnus-collect-urls (delete-dups urls))) (defun gnus-shorten-url (url max) - "Return an excerpt from URL." + "Return an excerpt from URL not exceeding MAX characters." (if (<= (length url) max) url - (let ((parsed (url-generic-parse-url url))) - (concat (url-host parsed) - "..." - (substring (url-filename parsed) - (- (length (url-filename parsed)) - (max (- max (length (url-host parsed))) 0))))))) + (let* ((parsed (url-generic-parse-url url)) + (host (url-host parsed)) + (rest (concat (url-filename parsed) + (when-let ((target (url-target parsed))) + (concat "#" target))))) + (concat host (string-truncate-left rest (- max (length host))))))) (defun gnus-summary-browse-url (&optional external) "Scan the current article body for links, and offer to browse them. diff --git a/lisp/vc/ediff-init.el b/lisp/vc/ediff-init.el index e59d4b57b5..da6509b7cb 100644 --- a/lisp/vc/ediff-init.el +++ b/lisp/vc/ediff-init.el @@ -1510,16 +1510,6 @@ ediff-strip-last-dir (setq dir (substring dir 0 pos))) (ediff-abbreviate-file-name (file-name-directory dir)))) -(defun ediff-truncate-string-left (str newlen) - ;; leave space for ... on the left - (let ((len (length str)) - substr) - (if (<= len newlen) - str - (setq newlen (max 0 (- newlen 3))) - (setq substr (substring str (max 0 (- len 1 newlen)))) - (concat "..." substr)))) - (defsubst ediff-nonempty-string-p (string) (and (stringp string) (not (string= string "")))) diff --git a/lisp/vc/ediff-mult.el b/lisp/vc/ediff-mult.el index fee87e8352..2b1b07927f 100644 --- a/lisp/vc/ediff-mult.el +++ b/lisp/vc/ediff-mult.el @@ -113,7 +113,6 @@ ediff-mult (require 'ediff-wind) (require 'ediff-util) - ;; meta-buffer (ediff-defvar-local ediff-meta-buffer nil "") (ediff-defvar-local ediff-parent-meta-buffer nil "") @@ -1172,7 +1171,7 @@ ediff-meta-insert-file-info1 ;; abbreviate the file name, if file exists (if (and (not (stringp fname)) (< file-size -1)) "-------" ; file doesn't exist - (ediff-truncate-string-left + (string-truncate-left (ediff-abbreviate-file-name fname) max-filename-width))))))) @@ -1266,7 +1265,7 @@ ediff-draw-dir-diffs (if (= (mod membership-code ediff-membership-code1) 0) ; dir1 (let ((beg (point))) (insert (format "%-27s" - (ediff-truncate-string-left + (string-truncate-left (ediff-abbreviate-file-name (if (file-directory-p (concat dir1 file)) (file-name-as-directory file) @@ -1281,7 +1280,7 @@ ediff-draw-dir-diffs (if (= (mod membership-code ediff-membership-code2) 0) ; dir2 (let ((beg (point))) (insert (format "%-26s" - (ediff-truncate-string-left + (string-truncate-left (ediff-abbreviate-file-name (if (file-directory-p (concat dir2 file)) (file-name-as-directory file) @@ -1295,7 +1294,7 @@ ediff-draw-dir-diffs (if (= (mod membership-code ediff-membership-code3) 0) ; dir3 (let ((beg (point))) (insert (format " %-25s" - (ediff-truncate-string-left + (string-truncate-left (ediff-abbreviate-file-name (if (file-directory-p (concat dir3 file)) (file-name-as-directory file) -- 2.26.0 --=-=-=-- From debbugs-submit-bounces@debbugs.gnu.org Thu Apr 02 07:01:50 2020 Received: (at 39980) by debbugs.gnu.org; 2 Apr 2020 11:01:50 +0000 Received: from localhost ([127.0.0.1]:39276 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1jJxbZ-0000O5-VD for submit@debbugs.gnu.org; Thu, 02 Apr 2020 07:01:50 -0400 Received: from quimby.gnus.org ([95.216.78.240]:40816) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1jJxbY-0000Ne-M5 for 39980@debbugs.gnu.org; Thu, 02 Apr 2020 07:01:49 -0400 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=gnus.org; s=20200322; h=Content-Transfer-Encoding:Content-Type:MIME-Version:Message-ID :In-Reply-To:Date:References:Subject:Cc:To:From:Sender:Reply-To:Content-ID: Content-Description:Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc :Resent-Message-ID:List-Id:List-Help:List-Unsubscribe:List-Subscribe: List-Post:List-Owner:List-Archive; bh=xhLw+V0WskYkx1CzbXNUi3fM7KBEAhqUQsLlkA03G+E=; b=vFozenBO8jDpy4az25zrtjcMHL hnz4zQjl9tBxczBFy3sXizb2u4adtpP43W/49o3oqBdYZt0jB/H/bu7cFMdNlBPHABJDLSYhE0ReC FM0OGQW6CZAwiSg7BqUkM1EtvKLjBRjUttdFz9aro38fKS1TbR6CBg/TylnyWWjLBRjM=; Received: from cm-84.212.202.86.getinternet.no ([84.212.202.86] helo=marnie) by quimby.gnus.org with esmtpsa (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1jJxbM-00056U-OQ; Thu, 02 Apr 2020 13:01:42 +0200 From: Lars Ingebrigtsen To: =?utf-8?B?xaB0xJtww6FuIE7Em21lYw==?= Subject: Re: bug#39980: [PATCH] gnus-shorten-url: Improve and avoid args-out-of-range error 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> Date: Thu, 02 Apr 2020 13:01:35 +0200 In-Reply-To: <87imioo963.fsf@gmail.com> (=?utf-8?B?IsWgdMSbcMOhbiBOxJtt?= =?utf-8?B?ZWMiJ3M=?= message of "Sat, 28 Mar 2020 15:17:56 +0100") Message-ID: <875zeinoc0.fsf@gnus.org> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/28.0.50 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable X-Spam-Report: Spam detection software, running on the system "quimby.gnus.org", has NOT identified this incoming email as spam. The original message has been attached to this so you can view it or label similar future email. If you have any questions, see @@CONTACT_ADDRESS@@ for details. Content preview: Štěpán Němec writes: > Considering the opinions expressed here and in > https://lists.gnu.org/archive/html/emacs-devel/2020-03/msg00541.html I > have reverted to defun and autoload the function instead to prevent > having [...] Content analysis details: (-2.9 points, 5.0 required) pts rule name description ---- ---------------------- -------------------------------------------------- -1.0 ALL_TRUSTED Passed through trusted hosts only via SMTP -1.9 BAYES_00 BODY: Bayes spam probability is 0 to 1% [score: 0.0000] X-Spam-Score: 0.0 (/) X-Debbugs-Envelope-To: 39980 Cc: Eli Zaretskii , 39980@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.0 (-) =C5=A0t=C4=9Bp=C3=A1n N=C4=9Bmec writes: > Considering the opinions expressed here and in > https://lists.gnu.org/archive/html/emacs-devel/2020-03/msg00541.html I > have reverted to defun and autoload the function instead to prevent > having to load subr-x at runtime whenever gnus-sum is loaded, as it is > currently only used there by `gnus-summary-browse-url'. > > Revised patch attached. Looks good to me. --=20 (domestic pets only, the antidote for overdose, milk.) bloggy blog: http://lars.ingebrigtsen.no From debbugs-submit-bounces@debbugs.gnu.org Sun Apr 12 05:53:21 2020 Received: (at 39980) by debbugs.gnu.org; 12 Apr 2020 09:53:22 +0000 Received: from localhost ([127.0.0.1]:57386 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1jNZIn-00013w-12 for submit@debbugs.gnu.org; Sun, 12 Apr 2020 05:53:21 -0400 Received: from mail-lj1-f173.google.com ([209.85.208.173]:35541) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1jNZIl-00013k-D8 for 39980@debbugs.gnu.org; Sun, 12 Apr 2020 05:53:19 -0400 Received: by mail-lj1-f173.google.com with SMTP id k21so6047268ljh.2 for <39980@debbugs.gnu.org>; Sun, 12 Apr 2020 02:53:19 -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=3WCuupUelJ1sgPE2micMjhu17V0FQvAjEvDhyaZTThc=; b=Dcea/6FBP6dUsQmn9U/A7MhU+3tNX6unxHRBm9nw/vbDuFHYmmmgTxysRAP4KpjDAK g9No5N7xMJhfnksdJ6zoITRxq0pLBi5b13H48aoHUM7QQBWzBbfgEtJ0RYAtL1e71fYG JRRbWeEQRM/0UHV6XowBsFbeBDNZ8BtNK6NGyqIn9fBbllQULahms+GgRyUC9nHO+DNO LGehFJWl/gWk1S2wwRd45jY8OJRQZMlwgLitfIOUXfmdija5NxhJMPTWJ/EYCpQ6K3ll DSLPEfSQVb6oYqhQqbn5bqrafCHVoh7jDPAmVHLkhAdtDltl1AejZabB1zXkTsjEiBQW Q0Qw== 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=3WCuupUelJ1sgPE2micMjhu17V0FQvAjEvDhyaZTThc=; b=di94RVm+ys4bGWD3pyDSC5xKdaI6rqxiwwPxV62xjlrIRIP1LqRs3jP93aa3bH6r9L KhVP5/EyIl5AcuUwJr6Ho+pAty0GZYlb3pEuCjAwXYby2J+5RKjHypK3PZapURxjs/I5 6l8ese8ekUzyivyyeYmFdOBZjGOH2MWwVZxUAo1mnBlXHRP9JVLgHKU8AWgu4tFGGAiE NKNKAQU37RMLebORYrHL94/XAWvE+YW6sq4KDQ6rvJj6bqqDA+qNyOsXNXseenkGHi52 JradTDfKO0gJo1JwzecNtOY4OEmZDTVlMbnnznYd1EA7ShjdXESK89N3G+5PlsOxJ2YU tDgg== X-Gm-Message-State: AGi0PuaTnpvNSMh9m0hDZABv7TBxT7gzt2kiAsVInDn3dVMKaoqm8K8Q d2ZJSEqX6TVrLLGeRw/CP7c= X-Google-Smtp-Source: APiQypKQW4p/rRjHmYcsHu6WnI4D+fc2fllDU2DqUpq9WJy8Vv+YMNbR/8okThx79dxFhTSDJ4eslw== X-Received: by 2002:a2e:3612:: with SMTP id d18mr7878055lja.97.1586685193271; Sun, 12 Apr 2020 02:53:13 -0700 (PDT) Received: from localhost ([185.112.167.47]) by smtp.gmail.com with ESMTPSA id p21sm5051890ljg.5.2020.04.12.02.53.12 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 12 Apr 2020 02:53:12 -0700 (PDT) From: =?utf-8?B?xaB0xJtww6FuIE7Em21lYw==?= To: Eli Zaretskii Subject: Re: bug#39980: [PATCH] gnus-shorten-url: Improve and avoid args-out-of-range error In-Reply-To: <875zeinoc0.fsf@gnus.org> (Lars Ingebrigtsen's message of "Thu, 02 Apr 2020 13:01:35 +0200") 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> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/28.0.50 (gnu/linux) Date: Sun, 12 Apr 2020 11:53:47 +0200 Message-ID: <87wo6lc9n8.fsf@gmail.com> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable X-Spam-Score: 0.0 (/) X-Debbugs-Envelope-To: 39980 Cc: Lars Ingebrigtsen , 39980@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.0 (-) On Thu, 02 Apr 2020 13:01:35 +0200 Lars Ingebrigtsen wrote: > =C5=A0t=C4=9Bp=C3=A1n N=C4=9Bmec writes: > >> Considering the opinions expressed here and in >> https://lists.gnu.org/archive/html/emacs-devel/2020-03/msg00541.html I >> have reverted to defun and autoload the function instead to prevent >> having to load subr-x at runtime whenever gnus-sum is loaded, as it is >> currently only used there by `gnus-summary-browse-url'. >> >> Revised patch attached. > > Looks good to me. This can go to emacs-27, right? `gnus-summary-browse-url' is new in Emacs 27, it would seem a shame to ship it with this bug. --=20 =C5=A0t=C4=9Bp=C3=A1n From debbugs-submit-bounces@debbugs.gnu.org Sun Apr 12 06:33:58 2020 Received: (at 39980) by debbugs.gnu.org; 12 Apr 2020 10:33:58 +0000 Received: from localhost ([127.0.0.1]:57415 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1jNZw5-0002CD-Tc for submit@debbugs.gnu.org; Sun, 12 Apr 2020 06:33:58 -0400 Received: from eggs.gnu.org ([209.51.188.92]:58640) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1jNZw3-0002C0-BO for 39980@debbugs.gnu.org; Sun, 12 Apr 2020 06:33:56 -0400 Received: from fencepost.gnu.org ([2001:470:142:3::e]:57153) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1jNZvy-0006Fl-6E; Sun, 12 Apr 2020 06:33:50 -0400 Received: from [176.228.60.248] (port=4024 helo=home-c4e4a596f7) by fencepost.gnu.org with esmtpsa (TLS1.2:RSA_AES_256_CBC_SHA1:256) (Exim 4.82) (envelope-from ) id 1jNZvx-00029s-A0; Sun, 12 Apr 2020 06:33:49 -0400 Date: Sun, 12 Apr 2020 13:33:37 +0300 Message-Id: <83blnxkn7i.fsf@gnu.org> From: Eli Zaretskii To: =?utf-8?B?xaB0xJtww6FuIE7Em21lYw==?= In-Reply-To: <87wo6lc9n8.fsf@gmail.com> (message from =?utf-8?B?xaB0xJtw?= =?utf-8?B?w6FuIE7Em21lYw==?= on Sun, 12 Apr 2020 11:53:47 +0200) Subject: Re: bug#39980: [PATCH] gnus-shorten-url: Improve and avoid args-out-of-range error 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> MIME-version: 1.0 Content-type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Spam-Score: -0.7 (/) X-Debbugs-Envelope-To: 39980 Cc: larsi@gnus.org, 39980@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.7 (-) > From: Štěpán Němec > Cc: 39980@debbugs.gnu.org, Lars Ingebrigtsen > Date: Sun, 12 Apr 2020 11:53:47 +0200 > > On Thu, 02 Apr 2020 13:01:35 +0200 > Lars Ingebrigtsen wrote: > > > Štěpán Němec writes: > > > >> Considering the opinions expressed here and in > >> https://lists.gnu.org/archive/html/emacs-devel/2020-03/msg00541.html I > >> have reverted to defun and autoload the function instead to prevent > >> having to load subr-x at runtime whenever gnus-sum is loaded, as it is > >> currently only used there by `gnus-summary-browse-url'. > >> > >> Revised patch attached. > > > > Looks good to me. > > This can go to emacs-27, right? `gnus-summary-browse-url' is new in > Emacs 27, it would seem a shame to ship it with this bug. OK for the change in gnus-summary-browse-url, but let's please leave out of emacs-27 changes that aren't necessarily needed to fix the original problem; cleanups are for master. On emacs-27, let's just fix the original problem locally. Thanks. From debbugs-submit-bounces@debbugs.gnu.org Sun Apr 12 06:49:06 2020 Received: (at 39980) by debbugs.gnu.org; 12 Apr 2020 10:49:06 +0000 Received: from localhost ([127.0.0.1]:57438 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1jNaAk-0002aV-9a for submit@debbugs.gnu.org; Sun, 12 Apr 2020 06:49:06 -0400 Received: from mail-lj1-f194.google.com ([209.85.208.194]:37166) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1jNaAi-0002ZU-KY for 39980@debbugs.gnu.org; Sun, 12 Apr 2020 06:49:05 -0400 Received: by mail-lj1-f194.google.com with SMTP id r24so6098985ljd.4 for <39980@debbugs.gnu.org>; Sun, 12 Apr 2020 03:49:04 -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=ESCM9Mw/56R0lb+vwOcq4kvYWvG5KkrYeoXHk5trNkg=; b=YKklwIrU9yryG+wAPyawTMiVodyfCAr6aoW3ZlZEgsIVuFkRmSCFg+gwB/T7YBdWJg GIqrF08eHn+M8462UHprWq19djTvIGBZMrdK3M16I0SeACG5wSzoj5lCNTbkdeqwWuxR keS4UziAEAYr7HtwxwewDHlQUCtGn3+x13rdnwmXaGfm+n0RaMueZRoKz5TVGDPglNk6 jyu0x5KmRktS7lbiw8I1rkOHh+KvVqHDR8k5Si39q19USiJLHe8keptSebKcSyQFK17A o5/wYuKWrCAz5IsBKvKbkDgInMeqBkt+qAohOHK63yeyDJjcSaqHlJqG5lsd81MW1alc c7PQ== 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=ESCM9Mw/56R0lb+vwOcq4kvYWvG5KkrYeoXHk5trNkg=; b=H6ll29ziT2bypONm4TcVX/sVs9YkUjw5/aP9Q/LYudIK2tAmVrzhGOzJ8ItSosBuZy E6ENQ2qc4+HGjLqnoDcbmvQmVzTGaN5Bxm93MwUOq0Rfcrpc1zn0KUOCr6/od5+NxURI T3W/UHwpYQJBgymmnwiiYzN06bI5AGGaBoVQkz6EHvCii3K+0mNz6MZAUlG9Q0tQLaDS h1FgKKVNVCmDdqzeU1wypVeyZA1WQSLG8+DAmf+XLbl1Yx5nb31XZseH0b4VCeqeNsTN P23mK5cg1woLSzfFuXeIivSmXTyPGR7noHeZKaVut0WV9HDX/1v2+xN1ubWA9EvuCc+y IFHg== X-Gm-Message-State: AGi0Pua+2jl3W1Kkm/gEAVNR1pk54Z7GD3HsklQLORZQk8J2XKmlbnCz YeOjEz4CE1jOL0kQD8clSvw= X-Google-Smtp-Source: APiQypKfkY4tzG8rhhrv6lGkDDJlOOS1f4/kTDE9zbvt+pOzfF8gxEyHMDLPe6yA+HuK9vtRLrBh4Q== X-Received: by 2002:a05:651c:287:: with SMTP id b7mr7903325ljo.73.1586688538518; Sun, 12 Apr 2020 03:48:58 -0700 (PDT) Received: from localhost ([185.112.167.47]) by smtp.gmail.com with ESMTPSA id k6sm5686450lfm.91.2020.04.12.03.48.57 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 12 Apr 2020 03:48:57 -0700 (PDT) From: =?utf-8?B?xaB0xJtww6FuIE7Em21lYw==?= To: Eli Zaretskii Subject: Re: bug#39980: [PATCH] gnus-shorten-url: Improve and avoid args-out-of-range error In-Reply-To: <83blnxkn7i.fsf@gnu.org> (Eli Zaretskii's message of "Sun, 12 Apr 2020 13:33:37 +0300") 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> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/28.0.50 (gnu/linux) Date: Sun, 12 Apr 2020 12:49:33 +0200 Message-ID: <87o8rxc72a.fsf@gmail.com> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable X-Spam-Score: 0.0 (/) X-Debbugs-Envelope-To: 39980 Cc: larsi@gnus.org, 39980@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.0 (-) On Sun, 12 Apr 2020 13:33:37 +0300 Eli Zaretskii wrote: >> From: =C5=A0t=C4=9Bp=C3=A1n N=C4=9Bmec >> Cc: 39980@debbugs.gnu.org, Lars Ingebrigtsen >> Date: Sun, 12 Apr 2020 11:53:47 +0200 >>=20 >> On Thu, 02 Apr 2020 13:01:35 +0200 >> Lars Ingebrigtsen wrote: >>=20 >> > =C5=A0t=C4=9Bp=C3=A1n N=C4=9Bmec writes: >> > >> >> Considering the opinions expressed here and in >> >> https://lists.gnu.org/archive/html/emacs-devel/2020-03/msg00541.html I >> >> have reverted to defun and autoload the function instead to prevent >> >> having to load subr-x at runtime whenever gnus-sum is loaded, as it is >> >> currently only used there by `gnus-summary-browse-url'. >> >> >> >> Revised patch attached. >> > >> > Looks good to me. >>=20 >> This can go to emacs-27, right? `gnus-summary-browse-url' is new in >> Emacs 27, it would seem a shame to ship it with this bug. > > OK for the change in gnus-summary-browse-url, but let's please leave > out of emacs-27 changes that aren't necessarily needed to fix the > original problem; cleanups are for master. Understood. > On emacs-27, let's just fix the original problem locally. The revised patch is upthread () 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. OK? --=20 =C5=A0t=C4=9Bp=C3=A1n From debbugs-submit-bounces@debbugs.gnu.org Sun Apr 12 07:06:00 2020 Received: (at 39980) by debbugs.gnu.org; 12 Apr 2020 11:06:00 +0000 Received: from localhost ([127.0.0.1]:57450 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1jNaR6-00032i-2o for submit@debbugs.gnu.org; Sun, 12 Apr 2020 07:06:00 -0400 Received: from eggs.gnu.org ([209.51.188.92]:32857) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1jNaR3-00032W-PJ for 39980@debbugs.gnu.org; Sun, 12 Apr 2020 07:05:58 -0400 Received: from fencepost.gnu.org ([2001:470:142:3::e]:57357) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1jNaQy-00077e-ME; Sun, 12 Apr 2020 07:05:52 -0400 Received: from [176.228.60.248] (port=2013 helo=home-c4e4a596f7) by fencepost.gnu.org with esmtpsa (TLS1.2:RSA_AES_256_CBC_SHA1:256) (Exim 4.82) (envelope-from ) id 1jNaQy-0005z7-33; Sun, 12 Apr 2020 07:05:52 -0400 Date: Sun, 12 Apr 2020 14:05:40 +0300 Message-Id: <83a73hklq3.fsf@gnu.org> From: Eli Zaretskii To: =?utf-8?B?xaB0xJtww6FuIE7Em21lYw==?= In-Reply-To: <87o8rxc72a.fsf@gmail.com> (message from =?utf-8?B?xaB0xJtw?= =?utf-8?B?w6FuIE7Em21lYw==?= on Sun, 12 Apr 2020 12:49:33 +0200) Subject: Re: bug#39980: [PATCH] gnus-shorten-url: Improve and avoid args-out-of-range error 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> MIME-version: 1.0 Content-type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Spam-Score: -0.7 (/) X-Debbugs-Envelope-To: 39980 Cc: larsi@gnus.org, 39980@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.7 (-) > From: Štěpán Němec > Cc: larsi@gnus.org, 39980@debbugs.gnu.org > Date: Sun, 12 Apr 2020 12:49:33 +0200 > > > OK for the change in gnus-summary-browse-url, but let's please leave > > out of emacs-27 changes that aren't necessarily needed to fix the > > original problem; cleanups are for master. > > Understood. > > > On emacs-27, let's just fix the original problem locally. > > 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. 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. From debbugs-submit-bounces@debbugs.gnu.org Sun Apr 12 07:46:53 2020 Received: (at 39980) by debbugs.gnu.org; 12 Apr 2020 11:46:53 +0000 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 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 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) 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) From: =?utf-8?B?xaB0xJtww6FuIE7Em21lYw==?= To: Eli Zaretskii Subject: Re: bug#39980: [PATCH] gnus-shorten-url: Improve and avoid args-out-of-range error In-Reply-To: <83a73hklq3.fsf@gnu.org> (Eli Zaretskii's message of "Sun, 12 Apr 2020 14:05:40 +0300") 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> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/28.0.50 (gnu/linux) Date: Sun, 12 Apr 2020 13:47:20 +0200 Message-ID: <87k12lc4dz.fsf@gmail.com> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable X-Spam-Score: -0.8 (/) X-Debbugs-Envelope-To: 39980 Cc: larsi@gnus.org, 39980@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.8 (-) 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 From debbugs-submit-bounces@debbugs.gnu.org Sun Apr 12 09:39:16 2020 Received: (at 39980) by debbugs.gnu.org; 12 Apr 2020 13:39:16 +0000 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 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 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 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 Date: Sun, 12 Apr 2020 16:38:57 +0300 Message-Id: <838sj0lt72.fsf@gnu.org> From: Eli Zaretskii To: =?utf-8?B?xaB0xJtww6FuIE7Em21lYw==?= In-Reply-To: <87k12lc4dz.fsf@gmail.com> (message from =?utf-8?B?xaB0xJtw?= =?utf-8?B?w6FuIE7Em21lYw==?= on Sun, 12 Apr 2020 13:47:20 +0200) Subject: Re: bug#39980: [PATCH] gnus-shorten-url: Improve and avoid args-out-of-range error 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 X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Spam-Score: -0.7 (/) X-Debbugs-Envelope-To: 39980 Cc: larsi@gnus.org, 39980@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.7 (-) > 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. From debbugs-submit-bounces@debbugs.gnu.org Sun Apr 12 10:12:57 2020 Received: (at 39980) by debbugs.gnu.org; 12 Apr 2020 14:12:57 +0000 Received: from localhost ([127.0.0.1]:58617 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1jNdM1-0001Up-7Y for submit@debbugs.gnu.org; Sun, 12 Apr 2020 10:12:57 -0400 Received: from mail-lj1-f176.google.com ([209.85.208.176]:45539) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1jNdLz-0001Ub-0u for 39980@debbugs.gnu.org; Sun, 12 Apr 2020 10:12:56 -0400 Received: by mail-lj1-f176.google.com with SMTP id t17so6348340ljc.12 for <39980@debbugs.gnu.org>; Sun, 12 Apr 2020 07:12:54 -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=NYnSxg1CMnqrKodx+Xgvs9A76DkVHeHGYnwIrWrE6tw=; b=kWDlkg4bH71OvudTNe9Xye7kofK8Fne97k/SRWNufldXn6sIfBK9hreXLTDki2tSSs p21YDyCxcrG1j3uVJIVUQhNpN/Ip0RUMsFNyI1wAhGZBPGEQuU7i0GlNxa37JesJ6vhc CwZP6tWB/3uCYgXg9Nwjbz52cRfuX5cHVZHc3ej6X4hfXLSxcGMblFJVvKXpWJrneF1x BQtfM7I8SIysOQ14DrF/nCG7dVRNdzGGzmwxwAvQxOvuHwG2YSmWqJAnCwaM5yHjWS8t V/Mn5chT2dxgM0C8MDxQaqj2wQ7FX+XryT91RohOzb0r57l85fltO+8F9PBnV/OD14zT 2o/w== 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=NYnSxg1CMnqrKodx+Xgvs9A76DkVHeHGYnwIrWrE6tw=; b=POKyD27Nwoi9g/3i4b42dUr2hHB9PW12EI3p8hE66Gvh62D07iwUotbnCv+J2S0dNa Qz+CtSuS0HDP/CRm9wSe5QS2yrblq5o88YvRGlH9Al/VBtI1SqyBKvS+dasxo5RvDbDp bzsf7a8X7oYVrPsvzrcAKwE3Gp0IhGuJnO7a57v7UBfM5RGD5YEyfWlpGckRA8eBoX2t oTQBTuWWsru+IWY+aTeb/7ZnJ5S0ETVoNNhr0s9uuH/fB8PeI6iGE9TX6XcsPf9XJIwd 6Xt/8dLcLdTvghroRwpTfcbjzSaxBlSsYNwbIaQ6LjgEBMOmyhUpDYN+g5LM3sz79fUL mPfA== X-Gm-Message-State: AGi0Pubdbm9hqo4StICkOLhX62P+NSLfgBONxKRTsRNwkJ9zJcgugwRK mIc7H2U+Zyt2fVheBl3mqoA= X-Google-Smtp-Source: APiQypIjaN3C5Zpt8rCHGA7FGpjSQLbQgPnU3jQAL7bB+zkNM7wxKgsxd27RxPpr/E8xxZbhZ8MQsg== X-Received: by 2002:a2e:9a87:: with SMTP id p7mr8063299lji.61.1586700768990; Sun, 12 Apr 2020 07:12:48 -0700 (PDT) Received: from localhost ([185.112.167.47]) by smtp.gmail.com with ESMTPSA id r21sm5530692ljp.29.2020.04.12.07.12.48 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 12 Apr 2020 07:12:48 -0700 (PDT) From: =?utf-8?B?xaB0xJtww6FuIE7Em21lYw==?= To: Eli Zaretskii Subject: Re: bug#39980: [PATCH] gnus-shorten-url: Improve and avoid args-out-of-range error In-Reply-To: <838sj0lt72.fsf@gnu.org> (Eli Zaretskii's message of "Sun, 12 Apr 2020 16:38:57 +0300") 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> <838sj0lt72.fsf@gnu.org> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/28.0.50 (gnu/linux) Date: Sun, 12 Apr 2020 16:13:23 +0200 Message-ID: <873698dc70.fsf@gmail.com> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable X-Spam-Score: -0.8 (/) X-Debbugs-Envelope-To: 39980 Cc: larsi@gnus.org, 39980@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.8 (-) On Sun, 12 Apr 2020 16:38:57 +0300 Eli Zaretskii wrote: >> 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? No, it's the (hopefully) tried and true `ediff-truncate-string-left', only renamed and moved to subr-x to be generally available. The changes are cosmetic. It would even be possible (in emacs-27, to avoid moving anything), to use `ediff-truncate-string-left' unchanged, but that would require gnus-sum to (require 'ediff-init), which would be crazy. Or make `ediff-truncate-string-left' a defsubst instead of defun and (eval-when-compile (require 'ediff-init)) in gnus-sum. That should actually work :-P > Both variants of the log message are fine. Thanks. --=20 =C5=A0t=C4=9Bp=C3=A1n From debbugs-submit-bounces@debbugs.gnu.org Sun Apr 12 10:35:52 2020 Received: (at 39980) by debbugs.gnu.org; 12 Apr 2020 14:35:52 +0000 Received: from localhost ([127.0.0.1]:58648 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1jNdiB-00025j-UB for submit@debbugs.gnu.org; Sun, 12 Apr 2020 10:35:52 -0400 Received: from eggs.gnu.org ([209.51.188.92]:47801) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1jNdiB-00025V-8z for 39980@debbugs.gnu.org; Sun, 12 Apr 2020 10:35:51 -0400 Received: from fencepost.gnu.org ([2001:470:142:3::e]:59581) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1jNdi6-0003IB-3j; Sun, 12 Apr 2020 10:35:46 -0400 Received: from [176.228.60.248] (port=3275 helo=home-c4e4a596f7) by fencepost.gnu.org with esmtpsa (TLS1.2:RSA_AES_256_CBC_SHA1:256) (Exim 4.82) (envelope-from ) id 1jNdi2-0003FP-VL; Sun, 12 Apr 2020 10:35:44 -0400 Date: Sun, 12 Apr 2020 17:35:31 +0300 Message-Id: <834ktolqks.fsf@gnu.org> From: Eli Zaretskii To: =?utf-8?B?xaB0xJtww6FuIE7Em21lYw==?= In-Reply-To: <873698dc70.fsf@gmail.com> (message from =?utf-8?B?xaB0xJtw?= =?utf-8?B?w6FuIE7Em21lYw==?= on Sun, 12 Apr 2020 16:13:23 +0200) Subject: Re: bug#39980: [PATCH] gnus-shorten-url: Improve and avoid args-out-of-range error 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> <838sj0lt72.fsf@gnu.org> <873698dc70.fsf@gmail.com> MIME-version: 1.0 Content-type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Spam-Score: -0.7 (/) X-Debbugs-Envelope-To: 39980 Cc: larsi@gnus.org, 39980@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.7 (-) > From: Štěpán Němec > Cc: larsi@gnus.org, 39980@debbugs.gnu.org > Date: Sun, 12 Apr 2020 16:13:23 +0200 > > On Sun, 12 Apr 2020 16:38:57 +0300 > Eli Zaretskii wrote: > > >> 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? > > No, it's the (hopefully) tried and true `ediff-truncate-string-left', > only renamed and moved to subr-x to be generally available. That's exactly what I'd like to avoid on the release branch. It's fine for master, of course. > The changes are cosmetic. It would even be possible (in emacs-27, to > avoid moving anything), to use `ediff-truncate-string-left' > unchanged, but that would require gnus-sum to (require 'ediff-init), > which would be crazy. It would be crazy and also somewhat risky. Let's just come up with a local change in gnus-sum, for the emacs-27 branch, okay? From debbugs-submit-bounces@debbugs.gnu.org Sun Apr 12 16:01:52 2020 Received: (at 39980) by debbugs.gnu.org; 12 Apr 2020 20:01:52 +0000 Received: from localhost ([127.0.0.1]:58939 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1jNing-0001hF-Br for submit@debbugs.gnu.org; Sun, 12 Apr 2020 16:01:52 -0400 Received: from mail-lj1-f196.google.com ([209.85.208.196]:38209) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1jNind-0001gy-OT for 39980@debbugs.gnu.org; Sun, 12 Apr 2020 16:01:50 -0400 Received: by mail-lj1-f196.google.com with SMTP id v16so6905517ljg.5 for <39980@debbugs.gnu.org>; Sun, 12 Apr 2020 13:01:49 -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; bh=aaLyXyiG7a2SA798/HFDTWFcYWgJf1HRqLjaZebGbc0=; b=W4aCdNDUEkLcHtYuuooKVEMwk7S/c5MjSjxmiaKk/DEyrnsIRQTHZFti/wfSkLdjD2 wOWGYiPSTTxCFUOWWJJLltBfaAdnLvd3AdLUVu+0RReY3+MKDH5LcGUwfiTRsGz8nJ5B X3pGQg/ttpIM74b9FRykhkdRf8Jc7N2kQYO9ByRjpnmI+N9BvguCXBUZKHNbGZbQvi0c fu+riaWZgQuEfRTl/vR6Bh0N3wywwjSVgQPmePEo1gbvLkFjrKYEYwQLir4DKCsc6Rb0 fxkcfcLaSZZNWkOxk6ilJ1bGnPynZj6c4NqMnoiFoy7J83BoWSe7p7XOgusd3Abf/6kO kfnw== 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; bh=aaLyXyiG7a2SA798/HFDTWFcYWgJf1HRqLjaZebGbc0=; b=Boi3wRBqgOdjOAGnqxbtHa9rw6aaKbeajx0wlh6QRxfRy9IKGZ+pgxPfE0ptYFJ9SN TNfe2/U2vyt9crI17jGU82dlcAReASQ3OyAL1dkoLa7KX3yLjDGq3JsMYHMNZneCA2qc hkK+j2y6NrvT1srcgvc6XhYAszrHAKlMYPRWNqL5U6kE8J4RNQCqTrKNSCZmbEegbkPn xUijrTG32NcOIR75dFboBYi6JE39mAE8IuwyWUvlbsS8tbFXbxNzu6Q5IttjJZt71K9o CvSOpOQBEFuV6UXMr64fJwPR6X+RlymvVhYM2MUbrgGkAAlO8xaGsJrjC0wtJiRdDdqZ Fo7A== X-Gm-Message-State: AGi0PubLZvp9F6cx9dojSX+Ix4P+pFUQnkUouPRs0XMy5mGYW0k4xNqi NY2M+qCtzG9AzmXCh8BTX5U= X-Google-Smtp-Source: APiQypI2ITJ9upfoNPi/AVzQodZwDaqe5cq2Uij6QJ2mCaXfECG5HZ2fBMD0ip55FvRcLUXs1BBLWw== X-Received: by 2002:a2e:5048:: with SMTP id v8mr7960200ljd.99.1586721703695; Sun, 12 Apr 2020 13:01:43 -0700 (PDT) Received: from localhost ([185.112.167.47]) by smtp.gmail.com with ESMTPSA id z4sm5835091ljk.51.2020.04.12.13.01.42 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 12 Apr 2020 13:01:42 -0700 (PDT) From: =?utf-8?B?xaB0xJtww6FuIE7Em21lYw==?= To: Eli Zaretskii Subject: Re: bug#39980: [PATCH] gnus-shorten-url: Improve and avoid args-out-of-range error In-Reply-To: <834ktolqks.fsf@gnu.org> (Eli Zaretskii's message of "Sun, 12 Apr 2020 17:35:31 +0300") 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> <838sj0lt72.fsf@gnu.org> <873698dc70.fsf@gmail.com> <834ktolqks.fsf@gnu.org> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/28.0.50 (gnu/linux) Date: Sun, 12 Apr 2020 22:02:18 +0200 Message-ID: <87d08cbhh1.fsf@gmail.com> MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="=-=-=" X-Spam-Score: 2.7 (++) X-Spam-Report: Spam detection software, running on the system "debbugs.gnu.org", has NOT identified this incoming email as spam. The original message has been attached to this so you can view it or label similar future email. If you have any questions, see the administrator of that system for details. Content preview: On Sun, 12 Apr 2020 17:35:31 +0300 Eli Zaretskii wrote: > Let's just come up with a local change in gnus-sum, for the emacs-27 > branch, okay? OK. I think the pat(c)h of least resistence would be as follows (everything just the same as for master, but with the helper function localized to gnus-sum and no changes to other files): Content analysis details: (2.7 points, 10.0 required) pts rule name description ---- ---------------------- -------------------------------------------------- 3.6 RCVD_IN_SBL_CSS RBL: Received via a relay in Spamhaus SBL-CSS [185.112.167.47 listed in zen.spamhaus.org] 0.0 SPF_HELO_NONE SPF: HELO does not publish an SPF Record 0.0 FREEMAIL_FROM Sender email is commonly abused enduser mail provider (stepnem[at]gmail.com) -0.0 SPF_PASS SPF: sender matches SPF record -0.0 RCVD_IN_DNSWL_NONE RBL: Sender listed at https://www.dnswl.org/, no trust [209.85.208.196 listed in list.dnswl.org] -0.8 RCVD_IN_MSPIKE_H2 RBL: Average reputation (+2) [209.85.208.196 listed in wl.mailspike.net] X-Debbugs-Envelope-To: 39980 Cc: larsi@gnus.org, 39980@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: 1.7 (+) X-Spam-Report: Spam detection software, running on the system "debbugs.gnu.org", has NOT identified this incoming email as spam. The original message has been attached to this so you can view it or label similar future email. If you have any questions, see the administrator of that system for details. Content preview: On Sun, 12 Apr 2020 17:35:31 +0300 Eli Zaretskii wrote: > Let's just come up with a local change in gnus-sum, for the emacs-27 > branch, okay? OK. I think the pat(c)h of least resistence would be as follows (everything just the same as for master, but with the helper function localized to gnus-sum and no changes to other files): Content analysis details: (1.7 points, 10.0 required) pts rule name description ---- ---------------------- -------------------------------------------------- -0.0 RCVD_IN_DNSWL_NONE RBL: Sender listed at https://www.dnswl.org/, no trust [209.85.208.196 listed in list.dnswl.org] -0.8 RCVD_IN_MSPIKE_H2 RBL: Average reputation (+2) [209.85.208.196 listed in wl.mailspike.net] 3.6 RCVD_IN_SBL_CSS RBL: Received via a relay in Spamhaus SBL-CSS [185.112.167.47 listed in zen.spamhaus.org] 0.0 SPF_HELO_NONE SPF: HELO does not publish an SPF Record 0.0 FREEMAIL_FROM Sender email is commonly abused enduser mail provider (stepnem[at]gmail.com) -0.0 SPF_PASS SPF: sender matches SPF record -1.0 MAILING_LIST_MULTI Multiple indicators imply a widely-seen list manager --=-=-= Content-Type: text/plain On Sun, 12 Apr 2020 17:35:31 +0300 Eli Zaretskii wrote: > Let's just come up with a local change in gnus-sum, for the emacs-27 > branch, okay? OK. I think the pat(c)h of least resistence would be as follows (everything just the same as for master, but with the helper function localized to gnus-sum and no changes to other files): --=-=-= Content-Type: text/x-patch Content-Disposition: inline; filename=0001-gnus-shorten-url-Improve-and-avoid-args-out-of-range.patch >From 9fd1f20078220c17f9e954b556c6b770ca70961a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=C5=A0t=C4=9Bp=C3=A1n=20N=C4=9Bmec?= Date: Sun, 12 Apr 2020 19:57:59 +0200 Subject: [PATCH] gnus-shorten-url: Improve and avoid args-out-of-range error 'gnus-shorten-url' (used by 'gnus-summary-browse-url') ignored fragment identifiers and didn't check substring bounds, in some cases leading to runtime errors, e.g.: (gnus-shorten-url "https://some.url.with/path/and#also_a_long_target" 40) ;; => Lisp error: (args-out-of-range "/path/and" -18 nil) This commit makes it account for #fragments and fixes faulty string computation. (bug#39980) ; Do not merge to master, where the helper is put to subr-x.el. * lisp/gnus/gnus-sum.el (gnus--string-truncate-left): New helper function (copied from 'ediff-truncate-string-left'). (gnus-shorten-url): Use it and don't drop #fragments. --- lisp/gnus/gnus-sum.el | 24 +++++++++++++++++------- 1 file changed, 17 insertions(+), 7 deletions(-) diff --git a/lisp/gnus/gnus-sum.el b/lisp/gnus/gnus-sum.el index a40e563e75..9b11d5878d 100644 --- a/lisp/gnus/gnus-sum.el +++ b/lisp/gnus/gnus-sum.el @@ -9493,16 +9493,26 @@ gnus-collect-urls (push primary urls)) (delete-dups urls))) +;; cf. `ediff-truncate-string-left', to become `string-truncate-left' +;; in Emacs 28 +(defun gnus--string-truncate-left (string length) + "Truncate STRING to LENGTH, replacing initial surplus with \"...\"." + (let ((strlen (length string))) + (if (<= strlen length) + string + (setq length (max 0 (- length 3))) + (concat "..." (substring string (max 0 (- strlen 1 length))))))) + (defun gnus-shorten-url (url max) - "Return an excerpt from URL." + "Return an excerpt from URL not exceeding MAX characters." (if (<= (length url) max) url - (let ((parsed (url-generic-parse-url url))) - (concat (url-host parsed) - "..." - (substring (url-filename parsed) - (- (length (url-filename parsed)) - (max (- max (length (url-host parsed))) 0))))))) + (let* ((parsed (url-generic-parse-url url)) + (host (url-host parsed)) + (rest (concat (url-filename parsed) + (when-let ((target (url-target parsed))) + (concat "#" target))))) + (concat host (gnus--string-truncate-left rest (- max (length host))))))) (defun gnus-summary-browse-url (&optional external) "Scan the current article body for links, and offer to browse them. -- 2.26.0 --=-=-= Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: base64 DQotLSANCsWgdMSbcMOhbg0K --=-=-=-- From debbugs-submit-bounces@debbugs.gnu.org Mon Apr 13 00:27:01 2020 Received: (at 39980) by debbugs.gnu.org; 13 Apr 2020 04:27:01 +0000 Received: from localhost ([127.0.0.1]:59094 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1jNqgX-0005Mf-4T for submit@debbugs.gnu.org; Mon, 13 Apr 2020 00:27:01 -0400 Received: from eggs.gnu.org ([209.51.188.92]:36149) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1jNqgV-0005MR-TZ for 39980@debbugs.gnu.org; Mon, 13 Apr 2020 00:27:00 -0400 Received: from fencepost.gnu.org ([2001:470:142:3::e]:42657) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1jNqgQ-0001rT-NF; Mon, 13 Apr 2020 00:26:54 -0400 Received: from [176.228.60.248] (port=2367 helo=home-c4e4a596f7) by fencepost.gnu.org with esmtpsa (TLS1.2:RSA_AES_256_CBC_SHA1:256) (Exim 4.82) (envelope-from ) id 1jNqgQ-0004ca-5V; Mon, 13 Apr 2020 00:26:54 -0400 Date: Mon, 13 Apr 2020 07:26:45 +0300 Message-Id: <83o8rwj9iy.fsf@gnu.org> From: Eli Zaretskii To: =?utf-8?B?xaB0xJtww6FuIE7Em21lYw==?= In-Reply-To: <87d08cbhh1.fsf@gmail.com> (message from =?utf-8?B?xaB0xJtw?= =?utf-8?B?w6FuIE7Em21lYw==?= on Sun, 12 Apr 2020 22:02:18 +0200) Subject: Re: bug#39980: [PATCH] gnus-shorten-url: Improve and avoid args-out-of-range error 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> <838sj0lt72.fsf@gnu.org> <873698dc70.fsf@gmail.com> <834ktolqks.fsf@gnu.org> <87d08cbhh1.fsf@gmail.com> MIME-version: 1.0 Content-type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Spam-Score: -0.7 (/) X-Debbugs-Envelope-To: 39980 Cc: larsi@gnus.org, 39980@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.7 (-) > From: Štěpán Němec > Cc: larsi@gnus.org, 39980@debbugs.gnu.org > Date: Sun, 12 Apr 2020 22:02:18 +0200 > > OK. I think the pat(c)h of least resistence would be as follows > (everything just the same as for master, but with the helper function > localized to gnus-sum and no changes to other files): Thanks, this is OK for emacs-27. > ; Do not merge to master, where the helper is put to subr-x.el. No need to precede this with a semi-colon, I think. From debbugs-submit-bounces@debbugs.gnu.org Mon Apr 13 06:31:10 2020 Received: (at 39980-done) by debbugs.gnu.org; 13 Apr 2020 10:31:11 +0000 Received: from localhost ([127.0.0.1]:59266 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1jNwMw-0008Up-MQ for submit@debbugs.gnu.org; Mon, 13 Apr 2020 06:31:10 -0400 Received: from mail-lf1-f68.google.com ([209.85.167.68]:33212) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1jNwMu-0008Ua-B2 for 39980-done@debbugs.gnu.org; Mon, 13 Apr 2020 06:31:09 -0400 Received: by mail-lf1-f68.google.com with SMTP id h6so6179130lfc.0 for <39980-done@debbugs.gnu.org>; Mon, 13 Apr 2020 03:31:08 -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=wuI+F+Sh38cQ6maLKsjZCQ7C5LRBGeYoHESsz8R//tk=; b=JGw0DcT7jkpWhxEhouEHmggx/Cz3M7QyWzcMHBA76U+7Q9VB1err4olNfBdUvfgSze Ebga3Z7LRxKFq9ifJ8sgVkqQGZDXam0cUE6CP4crj4Z0xxIgOZi6+7AZL7iv10QuvKbQ ql5CZxEJRPRSkQBg9RiuKGSlnJMFV8DeljlMa3EQekVfqPl7LEwG2AWx9MCtqV9/jP86 b9syhwVmhwpWoq9IfConw7h5bfnLNNIRTB1IbzBK5MbeE2hNlvrQc95BQku20MXXS4Dc e8CmeuiBjcWcOBYOoclwF645AJ0xY6TnD7eUKbFo94mT2FGFwfCWKPoYJfdSAY5EYatF W5xQ== 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=wuI+F+Sh38cQ6maLKsjZCQ7C5LRBGeYoHESsz8R//tk=; b=Tu/OPP9i92XblwfAdGmy4KO9sf+vPyk9ug2qW7TBs+O1U5g1AE9OYDWVdgFCfIf4PP bcfOZaRg97wEeCaKlxLAxtxjoqz+52CDr9Gllbzzhd6JJWN2RNSv2IyU6GdfyX1COsuG u1mQkS0TtMT8kkFwOifS2rYCWQ1IQ5esjrZx91auxbQBuNetr5Db6qqjTqdd/oF8D7d0 xO5PuKudix5lg9hi8KaFHr/ZE18zR6DLQtn0uDQXPZI4KbzNEsoqQ0X41CztxTlr9sbi XjDJRrvoAOvvpLTUHJ0w1gwMQ5uX3UqDGJa/+vxgiXlKOe3zZ5wJBtX9ByO1GOhWLmdG Zh8Q== X-Gm-Message-State: AGi0PuY0ts0fQ9iQkVs072Gl4ldV76GZZCxuWojT6rj2X/pzbZ7Y4+Ta hb2N+XPW8l1K4zTiCQuJhvQ= X-Google-Smtp-Source: APiQypLenFItzjC2XoliAJ+tf+QIi1kHfr5j/q8/ZPT1PU02C16r+iCkhgWqba613AfkvedL6AMw5w== X-Received: by 2002:a05:6512:405:: with SMTP id u5mr3756797lfk.192.1586773862301; Mon, 13 Apr 2020 03:31:02 -0700 (PDT) Received: from localhost ([185.112.167.47]) by smtp.gmail.com with ESMTPSA id c22sm6852336lja.86.2020.04.13.03.31.01 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 13 Apr 2020 03:31:01 -0700 (PDT) From: =?utf-8?B?xaB0xJtww6FuIE7Em21lYw==?= To: Eli Zaretskii Subject: Re: bug#39980: [PATCH] gnus-shorten-url: Improve and avoid args-out-of-range error In-Reply-To: <83o8rwj9iy.fsf@gnu.org> (Eli Zaretskii's message of "Mon, 13 Apr 2020 07:26:45 +0300") 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> <838sj0lt72.fsf@gnu.org> <873698dc70.fsf@gmail.com> <834ktolqks.fsf@gnu.org> <87d08cbhh1.fsf@gmail.com> <83o8rwj9iy.fsf@gnu.org> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/28.0.50 (gnu/linux) Date: Mon, 13 Apr 2020 12:31:37 +0200 Message-ID: <874ktnbrsm.fsf@gmail.com> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable X-Spam-Score: 3.7 (+++) X-Spam-Report: Spam detection software, running on the system "debbugs.gnu.org", has NOT identified this incoming email as spam. The original message has been attached to this so you can view it or label similar future email. If you have any questions, see the administrator of that system for details. Content preview: On Mon, 13 Apr 2020 07:26:45 +0300 Eli Zaretskii wrote: > Thanks, this is OK for emacs-27. Pushed to emacs-27 as Content analysis details: (3.7 points, 10.0 required) pts rule name description ---- ---------------------- -------------------------------------------------- 0.0 URIBL_BLOCKED ADMINISTRATOR NOTICE: The query to URIBL was blocked. See http://wiki.apache.org/spamassassin/DnsBlocklists#dnsbl-block for more information. [URIs: gnu.org] 3.6 RCVD_IN_SBL_CSS RBL: Received via a relay in Spamhaus SBL-CSS [185.112.167.47 listed in zen.spamhaus.org] -0.0 RCVD_IN_DNSWL_NONE RBL: Sender listed at https://www.dnswl.org/, no trust [209.85.167.68 listed in list.dnswl.org] 0.0 SPF_HELO_NONE SPF: HELO does not publish an SPF Record 0.0 FREEMAIL_FROM Sender email is commonly abused enduser mail provider (stepnem[at]gmail.com) -0.0 SPF_PASS SPF: sender matches SPF record -0.8 RCVD_IN_MSPIKE_H2 RBL: Average reputation (+2) [209.85.167.68 listed in wl.mailspike.net] 1.0 FREEMAIL_REPLY From and body contain different freemails X-Debbugs-Envelope-To: 39980-done Cc: larsi@gnus.org, 39980-done@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: 1.7 (+) X-Spam-Report: Spam detection software, running on the system "debbugs.gnu.org", has NOT identified this incoming email as spam. The original message has been attached to this so you can view it or label similar future email. If you have any questions, see the administrator of that system for details. Content preview: On Mon, 13 Apr 2020 07:26:45 +0300 Eli Zaretskii wrote: > Thanks, this is OK for emacs-27. Pushed to emacs-27 as Content analysis details: (1.7 points, 10.0 required) pts rule name description ---- ---------------------- -------------------------------------------------- 0.0 URIBL_BLOCKED ADMINISTRATOR NOTICE: The query to URIBL was blocked. See http://wiki.apache.org/spamassassin/DnsBlocklists#dnsbl-block for more information. [URIs: gnu.org] -0.0 RCVD_IN_DNSWL_NONE RBL: Sender listed at https://www.dnswl.org/, no trust [209.85.167.68 listed in list.dnswl.org] -0.8 RCVD_IN_MSPIKE_H2 RBL: Average reputation (+2) [209.85.167.68 listed in wl.mailspike.net] 3.6 RCVD_IN_SBL_CSS RBL: Received via a relay in Spamhaus SBL-CSS [185.112.167.47 listed in zen.spamhaus.org] 0.0 SPF_HELO_NONE SPF: HELO does not publish an SPF Record 0.0 FREEMAIL_FROM Sender email is commonly abused enduser mail provider (stepnem[at]gmail.com) -0.0 SPF_PASS SPF: sender matches SPF record -1.0 MAILING_LIST_MULTI Multiple indicators imply a widely-seen list manager On Mon, 13 Apr 2020 07:26:45 +0300 Eli Zaretskii wrote: > Thanks, this is OK for emacs-27. Pushed to emacs-27 as 2020-04-12T19:57:59+02:00!stepnem@gmail.com 81d07da788 (gnus-shorten-url: Improve and avoid args-out-of-range error) https://git.sv.gnu.org/cgit/emacs.git/commit/?id=3D81d07da788 and master as 2020-03-07T18:26:44+01:00!stepnem@gmail.com 188bd80a90 (gnus-shorten-url: Improve and avoid args-out-of-range error) https://git.sv.gnu.org/cgit/emacs.git/commit/?id=3D188bd80a90 >> ; Do not merge to master, where the helper is put to subr-x.el. > > No need to precede this with a semi-colon, I think. I saw it done in some other commit messages and thought it was a good way to distinguish this as a meta instruction, as opposed to the commit message proper. I have removed it. Thanks, =C5=A0t=C4=9Bp=C3=A1n From unknown Sat Jun 21 10:20:48 2025 Received: (at fakecontrol) by fakecontrolmessage; To: internal_control@debbugs.gnu.org From: Debbugs Internal Request Subject: Internal Control Message-Id: bug archived. Date: Mon, 11 May 2020 11:24:04 +0000 User-Agent: Fakemail v42.6.9 # This is a fake control message. # # The action: # bug archived. thanks # This fakemail brought to you by your local debbugs # administrator