texinfo-commits
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

branch master updated: * tp/texi2any.pl: Give a warning if input filenam


From: Gavin D. Smith
Subject: branch master updated: * tp/texi2any.pl: Give a warning if input filename ends in '.info'. * NEWS, TODO: Update. * tp/tests/formatting/list-of-tests (info_extension_warning): New test.
Date: Sat, 03 Dec 2022 04:44:59 -0500

This is an automated email from the git hooks/post-receive script.

gavin pushed a commit to branch master
in repository texinfo.

The following commit(s) were added to refs/heads/master by this push:
     new 072957117b * tp/texi2any.pl: Give a warning if input filename ends in 
'.info'. * NEWS, TODO: Update. * tp/tests/formatting/list-of-tests 
(info_extension_warning): New test.
072957117b is described below

commit 072957117bc040d0726c89cec30f9e7eb7ebe8a1
Author: Gavin Smith <gavinsmith0123@gmail.com>
AuthorDate: Sat Dec 3 09:44:47 2022 +0000

    * tp/texi2any.pl: Give a warning if input filename ends in '.info'.
    * NEWS, TODO: Update.
    * tp/tests/formatting/list-of-tests (info_extension_warning):
    New test.
---
 ChangeLog                                                        | 7 +++++++
 TODO                                                             | 1 -
 tp/tests/formatting/list-of-tests                                | 2 ++
 tp/tests/formatting/res_parser/info_extension_warning/foo.info.1 | 0
 tp/tests/formatting/res_parser/info_extension_warning/foo.info.2 | 2 ++
 tp/texi2any.pl                                                   | 6 ++++++
 6 files changed, 17 insertions(+), 1 deletion(-)

diff --git a/ChangeLog b/ChangeLog
index 0305a05cb7..5e9aa09c08 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,10 @@
+2022-12-03  Gavin Smith  <gavinsmith0123@gmail.com>
+
+       * tp/texi2any.pl: Give a warning if input filename ends in '.info'.
+       * NEWS, TODO: Update.
+       * tp/tests/formatting/list-of-tests (info_extension_warning):
+       New test.
+
 2022-12-02  Gavin Smith  <gavinsmith0123@gmail.com>
 
        * NEWS, doc/texinfo.texi (Heading Generation, @headings)
diff --git a/TODO b/TODO
index 4da6336e7f..4cb15506d1 100644
--- a/TODO
+++ b/TODO
@@ -42,7 +42,6 @@ If you are interested in working on any of these, email 
bug-texinfo@gnu.org.
     for extensible documents (Mallard format ideas)
 
 * texi2any:
-  - give a warning for "makeinfo FOO.info" when "makeinfo FOO.texi" was meant
   - HTML: support thumbnails.
   - HTML: have a library of different CSS styles.
     http://mail.gnu.org/archive/html/bug-texinfo/2004-01/msg00025.html
diff --git a/tp/tests/formatting/list-of-tests 
b/tp/tests/formatting/list-of-tests
index 123271f219..903548ebdb 100644
--- a/tp/tests/formatting/list-of-tests
+++ b/tp/tests/formatting/list-of-tests
@@ -43,3 +43,5 @@ manual_include_accented_file_name_latin1_explicit_encoding 
manual_include_accent
 # of the test suite is utf8
 manual_include_accented_file_name_latin1_use_locale_encoding 
manual_include_accented_file_name_latin1.texi --info -D 'needrecodedfilenames 
Need recoded file names' -c MESSAGE_ENCODING=UTF-8 -c 
INPUT_FILE_NAME_ENCODING=UTF-8
 
+info_extension_warning foo.info
+
diff --git a/tp/tests/formatting/res_parser/info_extension_warning/foo.info.1 
b/tp/tests/formatting/res_parser/info_extension_warning/foo.info.1
new file mode 100644
index 0000000000..e69de29bb2
diff --git a/tp/tests/formatting/res_parser/info_extension_warning/foo.info.2 
b/tp/tests/formatting/res_parser/info_extension_warning/foo.info.2
new file mode 100644
index 0000000000..8c585cb5e4
--- /dev/null
+++ b/tp/tests/formatting/res_parser/info_extension_warning/foo.info.2
@@ -0,0 +1,2 @@
+texi2any: warning: input file `./formatting//foo.info'; did you mean 
`./formatting//foo.texi'?
+could not open ./formatting//foo.info: No such file or directory
diff --git a/tp/texi2any.pl b/tp/texi2any.pl
index 3ab174d718..40b9b630df 100755
--- a/tp/texi2any.pl
+++ b/tp/texi2any.pl
@@ -1342,6 +1342,12 @@ while(@input_files) {
   $file_number++;
   my $input_file_arg = shift(@input_files);
   my $input_file_name;
+  if ($input_file_arg =~ /\.info$/) {
+      document_warn(sprintf(
+          __('input file `%s\'; did you mean `%s\'?'),
+          $input_file_arg,
+          ($input_file_arg =~ s/\.info$/.texi/r)));
+  }
   # try to concatenate with different suffixes. The last suffix is ''
   # such that the plain file name is checked.
   foreach my $suffix (@input_file_suffixes) {



reply via email to

[Prev in Thread] Current Thread [Next in Thread]