texinfo-commits
[Top][All Lists]
Advanced

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

texinfo/tp texi2any.pl


From: Patrice Dumas
Subject: texinfo/tp texi2any.pl
Date: Sat, 02 Feb 2013 13:57:41 +0000

CVSROOT:        /sources/texinfo
Module name:    texinfo
Changes by:     Patrice Dumas <pertusus>        13/02/02 13:57:41

Modified files:
        tp             : texi2any.pl 

Log message:
        Add warning and command name to warning messages in Texinfo::Config.

CVSWeb URLs:
http://cvs.savannah.gnu.org/viewcvs/texinfo/tp/texi2any.pl?cvsroot=texinfo&r1=1.172&r2=1.173

Patches:
Index: texi2any.pl
===================================================================
RCS file: /sources/texinfo/texinfo/tp/texi2any.pl,v
retrieving revision 1.172
retrieving revision 1.173
diff -u -b -r1.172 -r1.173
--- texi2any.pl 30 Jan 2013 00:54:31 -0000      1.172
+++ texi2any.pl 2 Feb 2013 13:57:40 -0000       1.173
@@ -33,6 +33,8 @@
 use File::Basename;
 #use Cwd;
 use Getopt::Long qw(GetOptions);
+# for carp
+#use Carp;
 
 Getopt::Long::Configure("gnu_getopt");
 
@@ -355,6 +357,8 @@
 {
 package Texinfo::Config;
 
+#use Carp;
+
 # passed from main program
 my $cmdline_options;
 my $default_options;
@@ -377,14 +381,20 @@
   }
 }
 
+# FIXME: maybe use an opaque return status that can be used to retrieve
+# an error message?
 sub set_from_init_file($$) {
   my $var = shift;
   my $value = shift;
   if (!Texinfo::Common::valid_option($var)) {
-    warn(sprintf(main::__("Unknown variable %s\n"), $var));
+    # carp may be better, but infortunately, it points to the routine that 
+    # loads the file, and not to the init file.
+    main::document_warn(sprintf(main::__("%s: unknown variable %s"), 
+                                'set_from_init_file', $var));
     return 0;
   } elsif (Texinfo::Common::obsolete_option($var)) {
-    warn(sprintf(main::__("Obsolete variable %s\n"), $var));
+    main::document_warn(sprintf(main::__("%s: obsolete variable %s\n"), 
+                                  'set_from_init_file', $var));
   }
   return 0 if (defined($cmdline_options->{$var}));
   delete $default_options->{$var};
@@ -398,10 +408,12 @@
   delete $options->{$var};
   delete $default_options->{$var};
   if (!Texinfo::Common::valid_option($var)) {
-    warn(sprintf(main::__("Unknown variable %s\n"), $var));
+    main::document_warn(sprintf(main::__("%s: unknown variable %s\n"), 
+                                'set_from_cmdline', $var));
     return 0;
   } elsif (Texinfo::Common::obsolete_option($var)) {
-    warn(sprintf(main::__("Obsolete variable %s\n"), $var));
+    main::document_warn(sprintf(main::__("obsolete variable %s\n"), 
+                                'set_from_cmdline', $var));
   }
   $cmdline_options->{$var} = $value;
   return 1;
@@ -1210,7 +1222,8 @@
     my ($modified_contents, $added_nodes)
      = Texinfo::Structuring::insert_nodes_for_sectioning_commands($parser, 
$tree);
     if (!defined($modified_contents)) {
-      document_warn(__("insert_nodes_for_sectioning_commands transformation 
return no result. No section?"));
+      document_warn(__(
+       "insert_nodes_for_sectioning_commands transformation return no result. 
No section?"));
     } else {
       $tree->{'contents'} = $modified_contents;
     }



reply via email to

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