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: 30.0.50; Info.el: Info-url-alist should support format-sequence that encodes "Top" node as "index" Date: Thu, 08 Feb 2024 20:20:18 +0000 Message-ID: <87ttmi3ar3.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> Mime-Version: 1.0 Content-Type: text/plain Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="14553"; mail-complaints-to="usenet@ciao.gmane.io" Cc: 68970@debbugs.gnu.org To: Eli Zaretskii Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Thu Feb 08 22:31:07 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 1rYBz8-0003Yd-7e for geb-bug-gnu-emacs@m.gmane-mx.org; Thu, 08 Feb 2024 22:31:06 +0100 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1rYBys-0007LM-Ss; Thu, 08 Feb 2024 16:30:50 -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 1rYByq-0007Kx-Hv for bug-gnu-emacs@gnu.org; Thu, 08 Feb 2024 16:30:48 -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 1rYByq-0007mo-8t for bug-gnu-emacs@gnu.org; Thu, 08 Feb 2024 16:30:48 -0500 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1rYBz4-00058a-Gk for bug-gnu-emacs@gnu.org; Thu, 08 Feb 2024 16:31:02 -0500 X-Loop: help-debbugs@gnu.org Resent-From: Mekeor Melire Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Thu, 08 Feb 2024 21:31:02 +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.170742781719691 (code B ref 68970); Thu, 08 Feb 2024 21:31:02 +0000 Original-Received: (at 68970) by debbugs.gnu.org; 8 Feb 2024 21:30:17 +0000 Original-Received: from localhost ([127.0.0.1]:33725 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1rYByK-00057W-EH for submit@debbugs.gnu.org; Thu, 08 Feb 2024 16:30:16 -0500 Original-Received: from mout02.posteo.de ([185.67.36.66]:54333) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1rYByH-00057C-S6 for 68970@debbugs.gnu.org; Thu, 08 Feb 2024 16:30:15 -0500 Original-Received: from submission (posteo.de [185.67.36.169]) by mout02.posteo.de (Postfix) with ESMTPS id 6314F240104 for <68970@debbugs.gnu.org>; Thu, 8 Feb 2024 22:29:53 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=posteo.de; s=2017; t=1707427793; bh=p9/tCVFE4uDQi6WgxRRxc6TTEdUXNnKw3AEL2Hotffo=; h=From:To:Cc:Subject:Date:Message-ID:MIME-Version:Content-Type: From; b=n0sXZgubobFmk6fQJN+A0SWydyz4kVjBRCSFGYCKXTDjlLsnj+8+Ik5cV+nxFT4/u WKs2AfxT9lAiUxmf3RNdcsrXkRy/4QkhJpSn2OLPMG+WaOkU0RIZMWgjLDsJo1oEzb 85pel03Q5YvFKDB/p3/GbXDYNkeQcLsUxX5KvuTNuFNLJCocfGgFLrGoMfkXTDrUYA r4iAITUb19nPE54b6HoPDifYKICm7jHJQEPaLsFfl5naLIP7PKI89DC7+DXf15dqNM 9L3lv9siUo8x2Rn4qTwZ3pQKU/kYZXToZFH7YM4EbAqs6kzzWw+0rloIntqD0H1CYl gngMH1Y2GrwfQ== Original-Received: from customer (localhost [127.0.0.1]) by submission (posteo.de) with ESMTPSA id 4TW99r4mJwz9rxF; Thu, 8 Feb 2024 22:29:52 +0100 (CET) In-reply-to: <86bk8rxyia.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:279656 Archived-At: 2024-02-08 08:26 eliz@gnu.org: > I tried several of those, and they all work without index.html. For > example, these work for me: > > https://sourceware.org/gdb/current/onlinedocs/gdb > https://sourceware.org/gdb/current/onlinedocs/annotate > https://sourceware.org/gdb/current/onlinedocs/stabs > https://cc-mode.sourceforge.net/html-manual > https://orgmode.org/manual > > Some of them also work with a trailing slash, some don't. Thank you for taking time to try it out. Sorry that I was not precise in my statement. You are right, "index.html" can be omitted.[1] But let me try to explain what I really meant. Let's look at a node named "Summary". Texinfo will generate a "Summary.html" file for it. For this file, some webservers do not allow to omit the .html suffix when requesting it via HTTP. For example: https://sourceware.org/gdb/current/onlinedocs/gdb/Summary -> error 404, not found https://sourceware.org/gdb/current/onlinedocs/gdb/Summary.html -> works fine Thus, for the GDB manual, the user would consider to use https://sourceware.org/gdb/current/onlinedocs/gdb/%e.html because %e does not contain the .html-suffix and because the webserver requires to keep the .html-suffix for non-index-HTMLs. But that URL-specification would not work in case of the "Top"-node because %e will be substituted with the empty string "" in that case, thus yielding: https://sourceware.org/gdb/current/onlinedocs/gdb/.html -> error 404, not found The user would now understand that, with the restrictions of the current implementation of the feature, they must define a custom function and use it as URL-specification for the GDB-manual. > > Another idea would be to let users specify two URL-SPECs: One for the > > Top-node; another for non-Top nodes. > > I'd prefer this latter alternative. Having thought about this idea again, it seems unnecessary because we know that the "Top" node is always translated as "index.html". Here's a quote from (info "(texinfo) HTML Xref Node Name Expansion"): A special exception: the Top node (*note The Top Node) is always mapped to the file 'index.html', to match web server software. As a result, I'd like to propose yet another approach. Currently, the implementation on the master branch offers %m (manual-name), %n (raw node-name) and %e (URL-encoded node-name without .html-suffix). Let's add the format-sequence %E that does include the .html-suffix. In case of the Top-node, it'll be the empty-string "", i.e. it'll behave just like %e in that case. | node | %e | %E | |-------+-------+------------| | "Top" | "" | "" | | "Foo" | "Foo" | "Foo.html" | The gnu.org webserver is configured to allow omission of the .html-suffix. We can thus use the %e format-sequence: | URL-specification | https://gnu.org/s/emacs/manual/html_node/emacs/%e | |----------------------+------------------------------------------------------| | URL for "Top" node | https://gnu.org/s/emacs/manual/html_node/emacs/ | | URL for "Intro" node | https://gnu.org/s/emacs/manual/html_node/emacs/Intro | The sourceware.org does not allow to omit the .html-suffix. But it allows to omit "index.html". We can thus use %E: | URL-specification | https://sourceware.org/gdb/current/onlinedocs/gdb/%E | |------------------------+----------------------------------------------------------------| | URL for "Top" node | https://sourceware.org/gdb/current/onlinedocs/gdb/ | | URL for "Summary" node | https://sourceware.org/gdb/current/onlinedocs/gdb/Summary.html | I think with these format-sequences we'd cover a lot of cases. We would not cover the case when the webserver does not allow to omit "index.html" but this is a very uncommon case. Thus, it'd be fine when users need to use a custom function as URL-specification. [1] Of course, webservers can be configured to not serve index.html when a directory is requested. But the default is to do so. When using the common Apache webserver, one can disable this "defaulting to index.html" with the "DirectoryIndex disabled" directive, as documented here: https://httpd.apache.org/docs/trunk/mod/mod_dir.html#directoryindex