groff
[Top][All Lists]
Advanced

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

[Groff] indentation for eqn


From: Bernd Warken
Subject: [Groff] indentation for eqn
Date: Tue, 23 Oct 2001 18:11:16 +0200
User-agent: Mutt/1.2.5i

The following patch allows to indent the eqn commands .EQ and .EN.
It is relative to <groff-source>/src/preproc/eqn

--- main.cc.orig        Fri Apr 20 15:35:00 2001
+++ main.cc     Tue Oct 23 17:29:32 2001
@@ -117,9 +117,19 @@
-       if (linebuf.length() >= 3 && linebuf[0] == '.' && linebuf[1] == 'E') {
-         if (linebuf[2] == 'N'
-             && (linebuf.length() == 3 || linebuf[3] == ' '
-                 || linebuf[3] == '\n' || compatible_flag))
-           break;
-         else if (linebuf[2] == 'Q' && linebuf.length() > 3
-                  && (linebuf[3] == ' ' || linebuf[3] == '\n'
-                      || compatible_flag))
-           fatal("nested .EQ");
+       if (linebuf.length() >= 3 && linebuf[0] == '.') {
+         char c;
+         int i = 1;
+         int i1;
+         while ( (c = linebuf[i]) == ' ' || c == '\t' )
+           i++;
+         if (linebuf[i] == 'E') {
+           i++;
+           i1 = i + 1;
+           if (linebuf[i] == 'N'
+               && (linebuf.length() == i1 || linebuf[i1] == '\n'
+                   || linebuf[i1] = ' ' || linebuf[i1] == '\t'
+                   || compatible_flag))
+             break;
+           else if (linebuf[i] == 'Q'
+               && (linebuf.length() == i1 || linebuf[i1] == '\n'
+                   || linebuf[i1] = ' ' || linebuf[i1] == '\t'
+                   || compatible_flag))
+             fatal("nested .EQ");


Bernd Warken

reply via email to

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