Subject: bug#68970: [PATCH] In Info-url-alist, add .html extension to %e format-sequence

From: Eli Zaretskii <[email-masked]>
Date: Sat, 10 Feb 2024 09:46:37 +0200

> From: Mekeor Melire <[email-masked]>
> Cc: Eli Zaretskii <[email-masked]>
> Date: Fri, 09 Feb 2024 22:00:47 +0000
> 
> > I'm asking why cannot we make %e behave like your proposed %E?
> 
> We can do so. I was just trying to keep URLs a little shorter, by saving
> five characters (".html"). But I think, you are right, it's more
> important to cover as many cases as possible with as few
> format-sequences as possible. Find attached a patch that implements
> this. Note that in the mean time, the fill-column has been changed for
> the Emacs repository via directory-local variables. For this patch, I
> did not use the "new" fill-column value so that the changes to the
> docstring can be seen well in the diff. Please let me know if you'd like
> the docstrings to be refilled according to the new fill-column.

>From where I stand, the fill-column for commit log messages is just a
guideline, not a hard requirement.  It is more important to have the
doc strings filled so they are easily readable.  The hard requirements
are spelled out in CONTRIBUTE.

> --- 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
                                          ^^
Two spaces between sentences, please.

> --- a/test/lisp/info-tests.el
> +++ b/test/lisp/info-tests.el
> @@ -29,17 +29,17 @@
>  
>  (ert-deftest test-info-urls ()
>    (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"))
> +                 "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"))
> +                 "https://www.gnu.org/software/emacs/manual/html_node/gnus/Don_0027t-Panic.html"))
>    (should-error (Info-url-for-node "(nonexistent)Example")))

Should we add here tests for the Top node?

Thanks.