texinfo-commits
[Top][All Lists]
Advanced

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

texinfo ChangeLog doc/refcard/Makefile doc/refc...


From: karl
Subject: texinfo ChangeLog doc/refcard/Makefile doc/refc...
Date: Wed, 12 Sep 2012 18:15:44 +0000

CVSROOT:        /sources/texinfo
Module name:    texinfo
Changes by:     karl <karl>     12/09/12 18:15:44

Modified files:
        .              : ChangeLog 
        doc/refcard    : Makefile 
Added files:
        doc/refcard    : txivarcheck 

Log message:
        new script txivarcheck to check customization variables implemented vs. 
documented

CVSWeb URLs:
http://cvs.savannah.gnu.org/viewcvs/texinfo/ChangeLog?cvsroot=texinfo&r1=1.1416&r2=1.1417
http://cvs.savannah.gnu.org/viewcvs/texinfo/doc/refcard/Makefile?cvsroot=texinfo&r1=1.2&r2=1.3
http://cvs.savannah.gnu.org/viewcvs/texinfo/doc/refcard/txivarcheck?cvsroot=texinfo&rev=1.1

Patches:
Index: ChangeLog
===================================================================
RCS file: /sources/texinfo/texinfo/ChangeLog,v
retrieving revision 1.1416
retrieving revision 1.1417
diff -u -b -r1.1416 -r1.1417
--- ChangeLog   10 Sep 2012 23:24:12 -0000      1.1416
+++ ChangeLog   12 Sep 2012 18:15:43 -0000      1.1417
@@ -1,3 +1,8 @@
+2012-09-12  Karl Berry  <address@hidden>
+
+       * doc/refcard/txivarcheck: new script to check customization
+       variables implemented vs. documented, similar to txicmdcheck.
+
 2012-09-10  Patrice Dumas  <address@hidden>
 
        * util/texinfo.dtd: update.

Index: doc/refcard/Makefile
===================================================================
RCS file: /sources/texinfo/texinfo/doc/refcard/Makefile,v
retrieving revision 1.2
retrieving revision 1.3
diff -u -b -r1.2 -r1.3
--- doc/refcard/Makefile        12 Sep 2012 01:12:26 -0000      1.2
+++ doc/refcard/Makefile        12 Sep 2012 18:15:43 -0000      1.3
@@ -1,4 +1,4 @@
-# $Id: Makefile,v 1.2 2012/09/12 01:12:26 karl Exp $
+# $Id: Makefile,v 1.3 2012/09/12 18:15:43 karl Exp $
 # Makefile for texinfo/doc/refcard.
 # This is not hooked into Automake, just here for those working on the refcard.
 #
@@ -15,15 +15,15 @@
 doc = txirefcard
 
 # parallel makes, etc., will fail.
-all: txirefcard.pdf txirefcard-a4.pdf
+all: $(doc).pdf $(doc)-a4.pdf
 
 # trying to get it work with pdftex isn't worth the trouble.
-txirefcard.pdf: $(doc).tex
+$(doc).pdf: $(doc).tex
        tex '\nonstopmode \input $(doc)'
        dvips -t landscape -t letter $(doc) -o
        ps2pdf $(doc).ps
 
-txirefcard-a4.pdf: $(doc).tex
+$(doc)-a4.pdf: $(doc).tex
        tex '\nonstopmode \let\afour=1 \input $(doc)'
        dvips -t landscape -t a4 $(doc) -o
        ps2pdf $(doc).ps $@

Index: doc/refcard/txivarcheck
===================================================================
RCS file: doc/refcard/txivarcheck
diff -N doc/refcard/txivarcheck
--- /dev/null   1 Jan 1970 00:00:00 -0000
+++ doc/refcard/txivarcheck     12 Sep 2012 18:15:43 -0000      1.1
@@ -0,0 +1,121 @@
+#!/usr/bin/env perl
+# $Id: txivarcheck,v 1.1 2012/09/12 18:15:43 karl Exp $
+# Copyright 2012 Free Software Foundation, Inc.
+# 
+# This program is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation; either version 3 of the License,
+# or (at your option) any later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program.  If not, see <http://www.gnu.org/licenses/>.
+#
+# Original author: Karl Berry.
+# 
+# Kludge of a script to check customization variables in refman vs. tp
+# for consistency.  Although this has nothing to do with the reference
+# card, since it's similar to the txicmdcheck script, keep them
+# together.  And maybe we'll add the cust.vars to the refcard.
+
+exit (&main ());
+
+sub main {
+  my @man_vars = &read_refman ("../texinfo.txi");
+  my @tp_vars = &read_tp ("../../util/txicustomvars");
+
+  my (%man_vars, %tp_vars);
+  @address@hidden = ();
+  @address@hidden = ();
+
+  my @found = ();
+  for my $name (@tp_vars) {
+    if (exists $man_vars{$name}) {
+      push (@found, $name);
+      delete $man_vars{$name};
+      delete $tp_vars{$name};
+    }
+  }
+  
+  printf "common %3d: @{[sort @found]}\n", @found + 0;
+
+  # we can't report variable names only in the manual, since our list
+  # necessarily includes many non-variables.
+
+  my @tp_only = keys %tp_vars;
+  printf "tp only %2s: @{[sort @tp_only]}\n", @tp_only + 0;
+  
+  return @tp_only;
+}
+
+
+
+# Return customization variable names from the section in the reference
+# manual.  Unfortunately a number of non-variable-names are also
+# returned, since we have no way to distinguish and it wouldn't be worth
+# all the meta-markup in the manual source.
+# 
+sub read_refman {
+  my ($fname) = @_;
+  my @ret = ();
+
+  local *FILE;
+  $FILE = $fname;
+  open (FILE) || die "open($FILE) failed: $!";
+
+  # since we have to look at generic commands like @item, at least
+  # ignore until right section to reduce chance of false matches.
+  while (<FILE>) {
+    last if /address@hidden Customization Variables$/;
+  }
+
+  while (<FILE>) {
+    if (/address@hidden Customization Variables for address@hidden@/) {
+      # in this node we have a bare of bare @-commands which have cust.vars.
+      while (<FILE>) {
+        last if /address@hidden/;
+      }
+      my $atcmds = "";
+      while (<FILE>) {
+        last if /address@hidden smallexample/;
+        s/address@hidden@//g;  # the variable names don't start with @
+        $atcmds .= $_;
+      }
+      # done with special node.
+      my @atcmds = split (" ", $atcmds);
+      push (@ret, @atcmds);      
+    }
+    
+    next unless s/^\@(itemx?|vindex) *//;  # look for item[x]s 
+    chomp;
+    push (@ret, $_);
+  }
+
+  close (FILE) || warn "close($FILE) failed: $!";
+  return @ret;
+}
+
+
+# Return customization variable names implemented in the general parser.
+# The argument is the command to run which returns the list.
+#
+sub read_tp {
+  my ($prog) = @_;
+  my @ret = ();
+  
+  local *FILE;
+  $FILE = "$prog |";
+  open (FILE) || die "open($FILE) failed: $!";
+  while (<FILE>) {
+    chomp;
+    my ($var,$where) = split (/\t/);
+    push (@ret, $var);
+  }
+  close (FILE) || warn "close($FILE) failed: $!";  
+  
+  return @ret;
+}



reply via email to

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