Am Sonntag, 30. Juli 2006 22:40 schrieb Jose' Matos:

>   I am just proposing another path for plain text export, not to replace 
it.

I like that idea. Actually I would nut put any energy at all in the native 
ascii export, that is difficult to get right.
The attached patch implements the additional converter. I will commit it 
later today if nobody objects.


Georg

PS: I will be on vacation from tomorrow on.

Log:
Add ps2ascii converter and fix child format buglet
        * src/graph.C
        (Graph::getReachable): Only add a child format to only viewable
        formats if the child or parent has a viewer. Previously a child
        format was also added when there was no viewer at all.

        * lib/configure.py
        (checkFormatEntries): add text2 format
        (checkConverterEntries): add ps2ascii converter
Index: src/graph.C
===================================================================
--- src/graph.C	(Revision 14525)
+++ src/graph.C	(Arbeitskopie)
@@ -77,9 +77,14 @@ Graph::getReachable(int from, bool only_
 		int const i = Q_.front();
 		Q_.pop();
 		Format const & format = formats.get(i);
-		if (!only_viewable || !format.viewer().empty() ||
-		    format.isChildFormat())
+		if (!only_viewable || !format.viewer().empty())
 			result.push_back(i);
+		else if (format.isChildFormat()) {
+			Format const * const parent =
+				formats.getFormat(format.parentFormat());
+			if (parent && !parent->viewer().empty())
+				result.push_back(i);
+		}
 
 		vector<int>::const_iterator cit =
 			vertices_[i].out_vertices.begin();
Index: lib/configure.py
===================================================================
--- lib/configure.py	(Revision 14525)
+++ lib/configure.py	(Arbeitskopie)
@@ -240,6 +240,7 @@ def checkFormatEntries():  
 \Format linuxdoc   sgml    LinuxDoc               x  ""	"%%"	"document"
 \Format pdflatex   tex    "LaTeX (pdflatex)"      "" ""	"%%"	"document"
 \Format text       txt    "Plain text"            a  ""	"%%"	"document"
+\Format text2      txt    "Plain text (ps2ascii)" "" ""	"%%"	"document"
 \Format textparagraph txt "Plain text (paragraphs)"    "" ""	"%%"	"document"''' ])
     #
     #checkProg('a Postscript interpreter', ['gs'],
@@ -325,6 +326,9 @@ def checkConverterEntries():
     checkProg('a PS to PDF converter', ['ps2pdf13 $$i $$o'],
         rc_entry = [ r'\converter ps         pdf        "%%"	""' ])
     #
+    checkProg('a PS to TXT converter', ['ps2ascii $$i $$o'],
+        rc_entry = [ r'\converter ps         text2      "%%"	""' ])
+    #
     checkProg('a DVI to PS converter', ['dvips -o $$o $$i'],
         rc_entry = [ r'\converter dvi        ps         "%%"	""' ])
     #

Reply via email to