groff-commit
[Top][All Lists]
Advanced

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

[groff] 32/34: [troff]: Increase `.device`/`\X` parity.


From: G. Branden Robinson
Subject: [groff] 32/34: [troff]: Increase `.device`/`\X` parity.
Date: Mon, 16 Sep 2024 20:48:36 -0400 (EDT)

gbranden pushed a commit to branch master
in repository groff.

commit 13f84b9892290fe9c5ceb7142d0d56a775e30cca
Author: G. Branden Robinson <g.branden.robinson@gmail.com>
AuthorDate: Sun Sep 15 05:19:05 2024 -0500

    [troff]: Increase `.device`/`\X` parity.
    
    * src/roff/troff/input.cpp (do_device_extension): Make `\X` escape
      sequence begin the first page of the document if it hasn't begun
      already.  In the "grout" page description language, this puts the
      leading 'x' initialization commands on the output stream, which we
      guarantee to come first in any such document.  Device extension
      commands 'x X' before that point are not well-defined, and further
      this change brings `\X` into parity with its sibling, the `device`
      request, which does so already.
---
 ChangeLog                | 11 +++++++++++
 src/roff/troff/input.cpp |  2 ++
 2 files changed, 13 insertions(+)

diff --git a/ChangeLog b/ChangeLog
index 3961d0c29..17183149c 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,14 @@
+2024-09-15  G. Branden Robinson <g.branden.robinson@gmail.com>
+
+       * src/roff/troff/input.cpp (do_device_extension): Make `\X`
+       escape sequence begin the first page of the document if it
+       hasn't begun already.  In the "grout" page description language,
+       this puts the leading 'x' initialization commands on the output
+       stream, which we guarantee to come first in any such document.
+       Device extension commands 'x X' before that point are not
+       well-defined, and further this change brings `\X` into parity
+       with its sibling, the `device` request, which does so already.
+
 2024-09-13  G. Branden Robinson <g.branden.robinson@gmail.com>
 
        [troff]: Make groff streams objects of new `grostream` class, so
diff --git a/src/roff/troff/input.cpp b/src/roff/troff/input.cpp
index 729f1038e..6f133803e 100644
--- a/src/roff/troff/input.cpp
+++ b/src/roff/troff/input.cpp
@@ -5864,6 +5864,8 @@ static node *do_device_extension() // \X
   if (!start_token.is_usable_as_delimiter(true /* report error */))
     return 0 /* nullptr */;
   macro mac;
+  if ((curdiv == topdiv) && (topdiv->before_first_page_status > 0))
+    topdiv->begin_page();
   for (;;) {
     tok.next();
     if (tok.is_newline() || tok.is_eof()) {



reply via email to

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