all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
* bug#74042: [PATCH] Accept texi2any for version identification
@ 2024-10-27  8:35 Mats Lidell
  2024-10-27  9:20 ` Eli Zaretskii
  2024-10-27  9:47 ` Stefan Kangas
  0 siblings, 2 replies; 9+ messages in thread
From: Mats Lidell @ 2024-10-27  8:35 UTC (permalink / raw)
  To: 74042

[-- Attachment #1: Type: text/plain, Size: 709 bytes --]

Hi,

Although according to docs texi2any is identical to makeinfo it outputs its
name in the first line which the version check in
`Info-file-supports-index-cookies' does not account for. The submitted patch
allows both makeinfo and texi2any to be in the version string.

In GNU Emacs 31.0.50 (build 1, x86_64-pc-linux-gnu, GTK+ Version 3.24.41, cairo version 1.18.2) of 2024-10-27 built on ethel
Repository revision: 523aade3ea11c188e30e3889f031d1848129cf82
Repository branch: master
Windowing system distributor 'The X.Org Foundation', version 11.0.12101013
System Description: Gentoo Linux

Configured using:
 'configure --prefix=/home/matsl --with-mailutils --with-native-compilation --with-tree-sitter'


[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: 0001-Accept-texi2any-for-version-identification.patch --]
[-- Type: text/patch, Size: 783 bytes --]

From 53c87778acb33d82f6fff64048e1e9d6372e5238 Mon Sep 17 00:00:00 2001
From: Mats Lidell <mats.lidell@lidells.se>
Date: Sun, 27 Oct 2024 09:11:16 +0100
Subject: [PATCH] Accept texi2any for version identification

---
 lisp/info.el | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/lisp/info.el b/lisp/info.el
index 1ad1677c6ce..6a5fe6f1fbc 100644
--- a/lisp/info.el
+++ b/lisp/info.el
@@ -667,7 +667,7 @@ Info-file-supports-index-cookies
 	  (goto-char (point-min))
 	  (condition-case ()
 	      (if (and (re-search-forward
-			"makeinfo[ \n]version[ \n]\\([0-9]+.[0-9]+\\)"
+			"\\(?:makeinfo\\|texi2any\\)[ \n]version[ \n]\\([0-9]+.[0-9]+\\)"
 			(line-beginning-position 4) t)
 		       (not (version< (match-string 1) "4.7")))
 		  (setq found t))
-- 
2.45.2


^ permalink raw reply related	[flat|nested] 9+ messages in thread

* bug#74042: [PATCH] Accept texi2any for version identification
  2024-10-27  8:35 bug#74042: [PATCH] Accept texi2any for version identification Mats Lidell
@ 2024-10-27  9:20 ` Eli Zaretskii
  2024-10-27 17:50   ` Mats Lidell
  2024-10-27  9:47 ` Stefan Kangas
  1 sibling, 1 reply; 9+ messages in thread
From: Eli Zaretskii @ 2024-10-27  9:20 UTC (permalink / raw)
  To: Mats Lidell; +Cc: 74042

> From: Mats Lidell <matsl@gnu.org>
> Date: Sun, 27 Oct 2024 09:35:45 +0100
> 
> Although according to docs texi2any is identical to makeinfo it outputs its
> name in the first line which the version check in
> `Info-file-supports-index-cookies' does not account for. The submitted patch
> allows both makeinfo and texi2any to be in the version string.

Can you explain the rationale?  IOW, when does the current code not
doing its job?

The fact that makeinfo invokes texi2any is an internal implementation
detail of the Texinfo project, and I wouldn't want us to depend on
that without a very good reason.  E.g., once upon a time, makeinfo was
a standalone program written in C, and nothing prevents the Texinfo
folks from doing that again in some future release.

Thanks.





^ permalink raw reply	[flat|nested] 9+ messages in thread

* bug#74042: [PATCH] Accept texi2any for version identification
  2024-10-27  8:35 bug#74042: [PATCH] Accept texi2any for version identification Mats Lidell
  2024-10-27  9:20 ` Eli Zaretskii
@ 2024-10-27  9:47 ` Stefan Kangas
  2024-10-27 10:11   ` Eli Zaretskii
  1 sibling, 1 reply; 9+ messages in thread
From: Stefan Kangas @ 2024-10-27  9:47 UTC (permalink / raw)
  To: Mats Lidell, 74042-done

Mats Lidell <matsl@gnu.org> writes:

> Although according to docs texi2any is identical to makeinfo it outputs its
> name in the first line which the version check in
> `Info-file-supports-index-cookies' does not account for. The submitted patch
> allows both makeinfo and texi2any to be in the version string.

Thanks for the patch.  Pushed to master as commit 4af5b794015.

I'm therefore closing this bug report.





^ permalink raw reply	[flat|nested] 9+ messages in thread

* bug#74042: [PATCH] Accept texi2any for version identification
  2024-10-27  9:47 ` Stefan Kangas
@ 2024-10-27 10:11   ` Eli Zaretskii
  0 siblings, 0 replies; 9+ messages in thread
From: Eli Zaretskii @ 2024-10-27 10:11 UTC (permalink / raw)
  To: Stefan Kangas; +Cc: 74042, matsl

> Resent-To: bug-gnu-emacs@gnu.org
> From: Stefan Kangas <stefankangas@gmail.com>
> Date: Sun, 27 Oct 2024 02:47:44 -0700
> 
> Mats Lidell <matsl@gnu.org> writes:
> 
> > Although according to docs texi2any is identical to makeinfo it outputs its
> > name in the first line which the version check in
> > `Info-file-supports-index-cookies' does not account for. The submitted patch
> > allows both makeinfo and texi2any to be in the version string.
> 
> Thanks for the patch.  Pushed to master as commit 4af5b794015.
> 
> I'm therefore closing this bug report.

I'd like to discuss the need for this, as mentioned in my previous
message.  I don't see why we need to support direct invocations of
texi2any.  I hope Mats will respond to my questions.





^ permalink raw reply	[flat|nested] 9+ messages in thread

* bug#74042: [PATCH] Accept texi2any for version identification
  2024-10-27  9:20 ` Eli Zaretskii
@ 2024-10-27 17:50   ` Mats Lidell
  2024-10-27 19:18     ` Eli Zaretskii
  0 siblings, 1 reply; 9+ messages in thread
From: Mats Lidell @ 2024-10-27 17:50 UTC (permalink / raw)
  To: Eli Zaretskii; +Cc: 74042

Hi Eli,

> Eli Zaretskii writes:
> Can you explain the rationale?  IOW, when does the current code not
> doing its job?

If the user generates the info file by using texi2any the check for version
number fails and the fact that "index cookies" are supported is lost.

I don't know what index cookies are but the effect was in my case that only
one of three indexes was noticed in the info file.

> The fact that makeinfo invokes texi2any is an internal implementation
> detail of the Texinfo project, and I wouldn't want us to depend on
> that without a very good reason.  E.g., once upon a time, makeinfo was
> a standalone program written in C, and nothing prevents the Texinfo
> folks from doing that again in some future release.

It seems to be a legit case to use texi2any directly, even encouraged, due to
being a generic translator. makeinfo is mentioned as being an alias with no
different behavior. On my system makeinfo is a symbolic link to texi2any.

https://www.gnu.org/software/texinfo/manual/texinfo/html_node/Generic-Translator-texi2any.html

Yours
-- 
%% Mats





^ permalink raw reply	[flat|nested] 9+ messages in thread

* bug#74042: [PATCH] Accept texi2any for version identification
  2024-10-27 17:50   ` Mats Lidell
@ 2024-10-27 19:18     ` Eli Zaretskii
  2024-10-27 21:01       ` Stefan Kangas
  2024-10-27 21:33       ` Mats Lidell
  0 siblings, 2 replies; 9+ messages in thread
From: Eli Zaretskii @ 2024-10-27 19:18 UTC (permalink / raw)
  To: Mats Lidell; +Cc: 74042

> From: Mats Lidell <matsl@gnu.org>
> Cc: 74042@debbugs.gnu.org
> Date: Sun, 27 Oct 2024 18:50:59 +0100
> 
> Hi Eli,
> 
> > Eli Zaretskii writes:
> > Can you explain the rationale?  IOW, when does the current code not
> > doing its job?
> 
> If the user generates the info file by using texi2any the check for version
> number fails and the fact that "index cookies" are supported is lost.

Why would users do that by invoking texi2any directly?

> > The fact that makeinfo invokes texi2any is an internal implementation
> > detail of the Texinfo project, and I wouldn't want us to depend on
> > that without a very good reason.  E.g., once upon a time, makeinfo was
> > a standalone program written in C, and nothing prevents the Texinfo
> > folks from doing that again in some future release.
> 
> It seems to be a legit case to use texi2any directly, even encouraged, due to
> being a generic translator. makeinfo is mentioned as being an alias with no
> different behavior. On my system makeinfo is a symbolic link to texi2any.
> 
> https://www.gnu.org/software/texinfo/manual/texinfo/html_node/Generic-Translator-texi2any.html

FTR, I'm very unhappy about this change.  I don't think we should
support this.  It is not future-proof.





^ permalink raw reply	[flat|nested] 9+ messages in thread

* bug#74042: [PATCH] Accept texi2any for version identification
  2024-10-27 19:18     ` Eli Zaretskii
@ 2024-10-27 21:01       ` Stefan Kangas
  2024-10-27 21:33       ` Mats Lidell
  1 sibling, 0 replies; 9+ messages in thread
From: Stefan Kangas @ 2024-10-27 21:01 UTC (permalink / raw)
  To: Eli Zaretskii, Mats Lidell; +Cc: 74042

Eli Zaretskii <eliz@gnu.org> writes:

>> From: Mats Lidell <matsl@gnu.org>
>> Cc: 74042@debbugs.gnu.org
>> Date: Sun, 27 Oct 2024 18:50:59 +0100
>>
>> Hi Eli,
>>
>> > Eli Zaretskii writes:
>> > Can you explain the rationale?  IOW, when does the current code not
>> > doing its job?
>>
>> If the user generates the info file by using texi2any the check for version
>> number fails and the fact that "index cookies" are supported is lost.
>
> Why would users do that by invoking texi2any directly?

Because that what the Texinfo documentation tells you to do now.

The Info node (info "(texinfo) Info Files") says:

       Info files are nearly always created by processing a Texinfo
    source document.  ‘texi2any’, also known as ‘makeinfo’, is the
    principal command that converts a Texinfo file into an Info file;
    see texi2any.

    [...]

       With the release of ‘texi2any’ as the reference implementation,
    development of both the C implementation of ‘makeinfo’ and
    ‘texi2html’ has been halted.  Going forward, we ask authors of
    Texinfo documents to use only ‘texi2any’.

Furthermore, the index entry for `makeinfo` in the Texinfo manual leads
to (info "(texinfo) Invoking texi2any"), and there they again tell you
to use `texi2any`:

    To process a Texinfo file, invoke ‘texi2any’ followed by the name of
    the Texinfo file.  Also select the format you want to output with
    the appropriate command line option (default is Info).  Thus, to
    create the Info file for Bison, type the following to the shell:

         texi2any --info bison.texi

> FTR, I'm very unhappy about this change.  I don't think we should
> support this.  It is not future-proof.

I installed it before seeing your objections; I assumed it was
uncontroversial.  I'm probably missing some nuances here as I'm far
removed from Texinfo development, but the documentation at least is
clear.  At the very least, we should support the recommended use of
Texinfo, and that's all that Mats's patch does, AFAICT.





^ permalink raw reply	[flat|nested] 9+ messages in thread

* bug#74042: [PATCH] Accept texi2any for version identification
  2024-10-27 19:18     ` Eli Zaretskii
  2024-10-27 21:01       ` Stefan Kangas
@ 2024-10-27 21:33       ` Mats Lidell
  2024-10-28  3:23         ` Eli Zaretskii
  1 sibling, 1 reply; 9+ messages in thread
From: Mats Lidell @ 2024-10-27 21:33 UTC (permalink / raw)
  To: Eli Zaretskii; +Cc: 74042

> Eli Zaretskii writes:
> Why would users do that by invoking texi2any directly?

Because texi2any is a tool for generating info files from texi files!?

We started to use it with GNU Hyperbole and got into this subtle issue (and
wasted some hours due to it.)

> FTR, I'm very unhappy about this change.  I don't think we should support
> this.  It is not future-proof.

Well to take a step back. Is not the root problem here that the version number
of a tool is used for checking whether certain feature is supported in the
info file? If the check would be more direct then the tool would not matter as
long as the info file is correct!?

The suggested patch is just a simple and pragmatic way to cause less surprises
when a user or developer starts to use texi2any instead of makeinfo.

Yours
-- 
%% Mats





^ permalink raw reply	[flat|nested] 9+ messages in thread

* bug#74042: [PATCH] Accept texi2any for version identification
  2024-10-27 21:33       ` Mats Lidell
@ 2024-10-28  3:23         ` Eli Zaretskii
  0 siblings, 0 replies; 9+ messages in thread
From: Eli Zaretskii @ 2024-10-28  3:23 UTC (permalink / raw)
  To: Mats Lidell; +Cc: 74042

> From: Mats Lidell <matsl@gnu.org>
> Cc: 74042@debbugs.gnu.org
> Date: Sun, 27 Oct 2024 22:33:59 +0100
> 
> > Eli Zaretskii writes:
> > Why would users do that by invoking texi2any directly?
> 
> Because texi2any is a tool for generating info files from texi files!?
> 
> We started to use it with GNU Hyperbole and got into this subtle issue (and
> wasted some hours due to it.)

IMNSHO, as someone who is involved in the Texinfo development for many
years, the GNU Hyperbole made a mistake by doing so.

> > FTR, I'm very unhappy about this change.  I don't think we should support
> > this.  It is not future-proof.
> 
> Well to take a step back. Is not the root problem here that the version number
> of a tool is used for checking whether certain feature is supported in the
> info file? If the check would be more direct then the tool would not matter as
> long as the info file is correct!?

Texinfo doesn't let us check for features, sadly.  The only way to
know which features are present is by looking at the version.





^ permalink raw reply	[flat|nested] 9+ messages in thread

end of thread, other threads:[~2024-10-28  3:23 UTC | newest]

Thread overview: 9+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2024-10-27  8:35 bug#74042: [PATCH] Accept texi2any for version identification Mats Lidell
2024-10-27  9:20 ` Eli Zaretskii
2024-10-27 17:50   ` Mats Lidell
2024-10-27 19:18     ` Eli Zaretskii
2024-10-27 21:01       ` Stefan Kangas
2024-10-27 21:33       ` Mats Lidell
2024-10-28  3:23         ` Eli Zaretskii
2024-10-27  9:47 ` Stefan Kangas
2024-10-27 10:11   ` Eli Zaretskii

Code repositories for project(s) associated with this external index

	https://git.savannah.gnu.org/cgit/emacs.git
	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.