From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Mekeor Melire Newsgroups: gmane.emacs.bugs Subject: bug#68970: [PATCH v2] In Info-url-alist, add .html extension to %e format-sequence Date: Sat, 10 Feb 2024 22:41:35 +0000 Message-ID: <87zfw80wh0.fsf@posteo.de> References: <87fry44bz6.fsf@posteo.de> <867cjgz5rm.fsf@gnu.org> <87bk8s3usi.fsf@posteo.de> <86le7wxc3e.fsf@gnu.org> <8734u352rm.fsf@posteo.de> <86bk8rxyia.fsf@gnu.org> <87ttmi3ar3.fsf@posteo.de> <8634u2w25i.fsf@gnu.org> <87le7t2r7o.fsf@posteo.de> <86jzncvk0y.fsf@gnu.org> <87cyt4316d.fsf@posteo.de> <86r0hktocr.fsf@gnu.org> Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="=-=-=" Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="18235"; mail-complaints-to="usenet@ciao.gmane.io" Cc: Eli Zaretskii To: 68970@debbugs.gnu.org Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Sat Feb 10 23:47:09 2024 Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane-mx.org Original-Received: from lists.gnu.org ([209.51.188.17]) by ciao.gmane.io with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1rYw7o-0004TL-O1 for geb-bug-gnu-emacs@m.gmane-mx.org; Sat, 10 Feb 2024 23:47:08 +0100 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1rYw7U-0002z4-K2; Sat, 10 Feb 2024 17:46:48 -0500 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1rYw7S-0002xk-BD for bug-gnu-emacs@gnu.org; Sat, 10 Feb 2024 17:46:46 -0500 Original-Received: from debbugs.gnu.org ([2001:470:142:5::43]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1rYw7S-0001DM-2z for bug-gnu-emacs@gnu.org; Sat, 10 Feb 2024 17:46:46 -0500 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1rYw7h-0000JV-Sa for bug-gnu-emacs@gnu.org; Sat, 10 Feb 2024 17:47:01 -0500 X-Loop: help-debbugs@gnu.org Resent-From: Mekeor Melire Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Sat, 10 Feb 2024 22:47:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 68970 X-GNU-PR-Package: emacs Original-Received: via spool by 68970-submit@debbugs.gnu.org id=B68970.17076051741075 (code B ref 68970); Sat, 10 Feb 2024 22:47:01 +0000 Original-Received: (at 68970) by debbugs.gnu.org; 10 Feb 2024 22:46:14 +0000 Original-Received: from localhost ([127.0.0.1]:48529 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1rYw6v-0000HG-EF for submit@debbugs.gnu.org; Sat, 10 Feb 2024 17:46:14 -0500 Original-Received: from mout02.posteo.de ([185.67.36.66]:48071) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1rYw6s-0000Go-P5 for 68970@debbugs.gnu.org; Sat, 10 Feb 2024 17:46:12 -0500 Original-Received: from submission (posteo.de [185.67.36.169]) by mout02.posteo.de (Postfix) with ESMTPS id CCD71240101 for <68970@debbugs.gnu.org>; Sat, 10 Feb 2024 23:45:48 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=posteo.de; s=2017; t=1707605148; bh=60X4C9BKCDwp0iSaCkYrQZH0V3THEm4DySHAm5/gADk=; h=From:To:Cc:Subject:Date:Message-ID:MIME-Version:Content-Type: From; b=UaX1b17TMpscOkmq0ZEmrzl9NyiHYT7BEaebiRhf6uDpr3TrzwdcCn+IJCpApIyAQ JXkm+Y550806474ZIsRXVvpJ5RF9vP8z7cFXGzrtEBGnZAP32aca3Pjk1kVCddOIx8 ru3RifAM4z2n1LJoi62jBNTqTnOOMoVHWLfQKr9QDcxp1euia51OvMO4knsCAaCb+b 6CvH6D/kmBMNxAvyLknQGdFOGKw2Loo/Jn8NjMdbLJtYVUxgUDHmaXMcwdzkdSPTwe FXRoD4Cg3gV7732qfJMdjHIw2hJKrPagBwMgGNIp2B7cgqO93Rr2UoJSOqFNfeFBSX lbg3SEE5zvWqQ== Original-Received: from customer (localhost [127.0.0.1]) by submission (posteo.de) with ESMTPSA id 4TXQmW547pz6tm4; Sat, 10 Feb 2024 23:45:47 +0100 (CET) In-reply-to: <86r0hktocr.fsf@gnu.org> X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-BeenThere: bug-gnu-emacs@gnu.org List-Id: "Bug reports for GNU Emacs, the Swiss army knife of text editors" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Original-Sender: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Xref: news.gmane.io gmane.emacs.bugs:279802 Archived-At: --=-=-= Content-Type: text/plain 2024-02-10 15:56 eliz@gnu.org: > if the doc string looks okay to you, there's no need to refill. I decided to not refill the docstring. > > > Two spaces between sentences, please. Done. > > > Should we add here tests for the Top node? Done. Find attached the new version of the patch. --=-=-= Content-Type: text/x-patch Content-Disposition: attachment; filename=0001-In-Info-url-alist-add-.html-extension-to-e-format-se.patch >From 7241f2ab1867f2d84c4e25c3ae5bba509718697f Mon Sep 17 00:00:00 2001 From: Mekeor Melire Date: Fri, 9 Feb 2024 23:30:52 +0100 Subject: [PATCH] In Info-url-alist, add .html extension to %e format-sequence * lisp/info.el (Info-url-for-node): Implement the change. (Bug#68970) (Info-url-alist): Document the change. * test/lisp/info-tests.el (test-info-urls): Adjust tests to account for the change and add a test for the "Top" node. --- lisp/info.el | 31 +++++++++++++++++-------------- test/lisp/info-tests.el | 16 +++++++++------- 2 files changed, 26 insertions(+), 21 deletions(-) diff --git a/lisp/info.el b/lisp/info.el index e91cc7b8e54..a6e78187e3b 100644 --- a/lisp/info.el +++ b/lisp/info.el @@ -231,8 +231,9 @@ Info-url-alist MANUALs represents the name of one or more manuals. It can either be a string or a list of strings. URL-SPEC can be a string in which the substring \"%m\" will be expanded to the -manual-name, \"%n\" to the node-name, and \"%e\" to the -URL-encoded node-name (without a `.html' suffix). (The +manual-name and \"%n\" to the node-name. \"%e\" will expand to +the URL-encoded node-name, including the `.html' extension; in +case of the Top node, it will expand to the empty string. (The URL-encoding of the node-name mimics GNU Texinfo, as documented at Info node `(texinfo)HTML Xref Node Name Expansion'.) Alternatively, URL-SPEC can be a function which is given @@ -1924,18 +1925,20 @@ Info-url-for-node ;; (info "(texinfo) HTML Xref Node Name Expansion") (if (equal node "Top") "" - (url-hexify-string - (string-replace " " "-" - (mapconcat - (lambda (ch) - (if (or (< ch 32) ; ^@^A-^Z^[^\^]^^^- - (<= 33 ch 47) ; !"#$%&'()*+,-./ - (<= 58 ch 64) ; :;<=>?@ - (<= 91 ch 96) ; [\]_` - (<= 123 ch 127)) ; {|}~ DEL - (format "_00%x" ch) - (char-to-string ch))) - node "")))))) + (concat + (url-hexify-string + (string-replace " " "-" + (mapconcat + (lambda (ch) + (if (or (< ch 32) ; ^@^A-^Z^[^\^]^^^- + (<= 33 ch 47) ; !"#$%&'()*+,-./ + (<= 58 ch 64) ; :;<=>?@ + (<= 91 ch 96) ; [\]_` + (<= 123 ch 127)) ; {|}~ DEL + (format "_00%x" ch) + (char-to-string ch))) + node ""))) + ".html")))) (cond ((stringp url-spec) (format-spec url-spec diff --git a/test/lisp/info-tests.el b/test/lisp/info-tests.el index 0dfdbf417e8..8020a7419cf 100644 --- a/test/lisp/info-tests.el +++ b/test/lisp/info-tests.el @@ -28,18 +28,20 @@ (require 'ert-x) (ert-deftest test-info-urls () + (should (equal (Info-url-for-node "(tramp)Top") + "https://www.gnu.org/software/emacs/manual/html_node/tramp/")) (should (equal (Info-url-for-node "(emacs)Minibuffer") - "https://www.gnu.org/software/emacs/manual/html_node/emacs/Minibuffer")) + "https://www.gnu.org/software/emacs/manual/html_node/emacs/Minibuffer.html")) (should (equal (Info-url-for-node "(emacs)Minibuffer File") - "https://www.gnu.org/software/emacs/manual/html_node/emacs/Minibuffer-File")) + "https://www.gnu.org/software/emacs/manual/html_node/emacs/Minibuffer-File.html")) (should (equal (Info-url-for-node "(elisp)Backups and Auto-Saving") - "https://www.gnu.org/software/emacs/manual/html_node/elisp/Backups-and-Auto_002dSaving")) + "https://www.gnu.org/software/emacs/manual/html_node/elisp/Backups-and-Auto_002dSaving.html")) (should (equal (Info-url-for-node "(eintr)car & cdr") - "https://www.gnu.org/software/emacs/manual/html_node/eintr/car-_0026-cdr")) + "https://www.gnu.org/software/emacs/manual/html_node/eintr/car-_0026-cdr.html")) (should (equal (Info-url-for-node "(emacs-mime)\tIndex") - "https://www.gnu.org/software/emacs/manual/html_node/emacs-mime/Index")) - (should (equal (Info-url-for-node "(gnus) Don't Panic") - "https://www.gnu.org/software/emacs/manual/html_node/gnus/Don_0027t-Panic")) + "https://www.gnu.org/software/emacs/manual/html_node/emacs-mime/Index.html")) + (should (equal (Info-url-for-node "(gnus) Don't Panic") + "https://www.gnu.org/software/emacs/manual/html_node/gnus/Don_0027t-Panic.html")) (should-error (Info-url-for-node "(nonexistent)Example"))) ;;; info-tests.el ends here -- 2.41.0 --=-=-=--