Update of bug #68905 (group groff):

                  Status:                    None => In Progress
             Assigned to:                    None => gbranden
                 Summary: [troff] enhance `pev` request to interpret arguments
as environment identifiers => [PATCH] [troff] enhance `pev` request to
interpret arguments as environment identifiers

    _______________________________________________________

Follow-up Comment #1:


diff --git a/src/roff/troff/env.cpp b/src/roff/troff/env.cpp
index bd9d2b312..ab04e1310 100644
--- a/src/roff/troff/env.cpp
+++ b/src/roff/troff/env.cpp
@@ -3814,15 +3814,32 @@ void environment::dump()
 }
 
 // TODO: Revise to report, without arguments, only the environment stack
-// contents from top to bottom; report details only of environments
-// named in arguments.
+// contents from top to bottom, then list unstacked environments.
 static void print_environment_request() // .pev
 {
+  symbol s;
+  environment *e;
+  if (has_arg()) {
+    do {
+      s = read_identifier();
+      if (s.is_null()) {
+       skip_rest_of_argument();
+       continue;
+      }
+      e = static_cast<environment *>(env_dictionary.lookup(s));
+      if (e != 0 /* nullptr */) {
+       // If you end your environment name with a colon, I got no
+       // sympathy for ya.
+       errprint("environment %1:\n", s.contents());
+       fflush(stderr);
+       e->dump();
+      }
+    } while(has_arg());
+  }
+  else {
   errprint("Current Environment:\n");
   curenv->dump();
   dictionary_iterator iter(env_dictionary);
-  symbol s;
-  environment *e;
   while (iter.get(&s, (void **)&e)) {
     assert(!s.is_null());
     errprint("Environment %1:\n", s.contents());
@@ -3831,6 +3848,7 @@ static void print_environment_request() // .pev
     else
       errprint("  current\n");
   }
+  }
   fflush(stderr);
   skip_line();
 }




    _______________________________________________________

Reply to this item at:

  <https://savannah.gnu.org/bugs/?68905>

_______________________________________________
Message sent via Savannah
https://savannah.gnu.org/

Attachment: signature.asc
Description: PGP signature

Reply via email to