auctex-diffs
[Top][All Lists]
Advanced

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

[AUCTeX-diffs] Changes to auctex/doc/preview-dtxdoc.pl


From: David Kastrup
Subject: [AUCTeX-diffs] Changes to auctex/doc/preview-dtxdoc.pl
Date: Wed, 08 Jun 2005 13:04:41 -0400

Index: auctex/doc/preview-dtxdoc.pl
diff -u auctex/doc/preview-dtxdoc.pl:1.1 auctex/doc/preview-dtxdoc.pl:1.2
--- auctex/doc/preview-dtxdoc.pl:1.1    Wed Jun  8 07:12:40 2005
+++ auctex/doc/preview-dtxdoc.pl        Wed Jun  8 17:04:40 2005
@@ -13,6 +13,11 @@
     last MUNGE if /^% *.section/;
 }
 
+# Fish out possible CR characters.
+/(\r*)$/;
+$cr = $1;
+
+
 # Noindent is used sometimes after \end{quote} (see below) 
 $noindent="";
 # Quote environments is translated into @example _without_
@@ -34,22 +39,22 @@
     s/~/address@hidden }/g;
     s/^ *//;
     # Environments
-    if (s/\\begin\{quote\}/address@hidden/) { 
+    if (s/\\begin\{quote\}/address@hidden/) { 
        $quote="yes" }
     if (/^\w/) { 
        print $noindent } 
     $noindent = "";
-    if (s/\\end\{quote\}/address@hidden example\n/) { 
+    if (s/\\end\{quote\}/address@hidden example$cr\n/) { 
        $quote=""; 
-       $noindent="address@hidden"  }
-    s/\\begin\{description\}/address@hidden address@hidden/;
+       $noindent="address@hidden"  }
+    s/\\begin\{description\}/address@hidden address@hidden/;
     # Convoluted pattern: handle 
     # \item[|...|], \item[\meta{..}] and \item[{|[]|}]
-    s/\\item\[\{?(.+?[\|\}])\}?\] ?/address@hidden $1\n/;
-    s/\\end\{description\}/address@hidden table\n/;
-    s/\\begin\{enumerate\}/address@hidden/;
+    s/\\item\[\{?(.+?[\|\}])\}?\] ?/address@hidden $1$cr\n/;
+    s/\\end\{description\}/address@hidden table$cr\n/;
+    s/\\begin\{enumerate\}/address@hidden/;
     s/\\item /address@hidden /;
-    s/\\end\{enumerate\}/address@hidden enumerate\n/;
+    s/\\end\{enumerate\}/address@hidden enumerate$cr\n/;
 
     # Formatting (\cmd is special within {quote})
     s/\\texttt/address@hidden/g;
@@ -60,12 +65,12 @@
     s/\\cmd\{(.*?)\}/|$1|/g;
     s/\\oarg\{([^}]+?)\}/address@hidden/g;
     s/\\char.//g;
-    s/\\raggedright\n//g;
-    s/\\DescribeEnv\{(.*?)\} /address@hidden 
address@hidden@address@hidden@address@hidden/;
-    if (s/\\DescribeMacro\{(.*?)\}( |\n)/address@hidden $1\n/) {
+    s/\\raggedright$cr\n//g;
+    s/\\DescribeEnv\{(.*?)\} /address@hidden 
address@hidden@address@hidden@address@hidden/;
+    if (s/\\DescribeMacro\{(.*?)\}( |$cr\n)/address@hidden $1$cr\n/) {
        # Index entries for two important macros
-       if (/(\\Preview(Macro|Environment))( |\n)/) {
-           $_ .= "address@hidden $1\n";
+       if (/(\\Preview(Macro|Environment))( |$cr\n)/) {
+           $_ .= "address@hidden $1$cr\n";
        }
     }
 
@@ -99,23 +104,22 @@
     # Texinfo @node-ification
     if (s/\\section\{(.*)\}/address@hidden $1/) {
        if (s/[Oo]ptions/options/) {
-           $_="address@hidden
-* Package options::             
-* Provided commands::           
address@hidden menu
-
address@hidden Package options, Provided commands, The LaTeX style file, The 
LaTeX style file\n" . $_;
+           $_="address@hidden" .
+"* Package options::$cr\n" .
+"* Provided commands::$cr\n" .
+"address@hidden menu$cr\n$cr\n" .
+"address@hidden Package options, Provided commands, The LaTeX style file, The 
LaTeX style file$cr\n" . $_;
        } elsif (s/[Cc]ommands/commands/) {
         # \Describe... needs @table
-           $_= "address@hidden Provided commands, ,Package options, The LaTeX 
style file\n" . 
-               $_ . "address@hidden address@hidden";
+           $_= "address@hidden Provided commands, ,Package options, The LaTeX 
style file$cr\n" . 
+               $_ . "address@hidden address@hidden";
        }
     }
        
     # Stop here
     # \Describe.... needs @end table
     if (/^.StopEventually/) {
-       print "address@hidden table\n";
+       print "address@hidden table$cr\n";
        last MAIN;
     }
     print $_;




reply via email to

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