shithub: neatroff

Download patch

ref: 883272e1c24f8410b7c78e3671cc5b2603635fbe
parent: e6e6b5d4881caa47502e8daa881a120d322091b7
author: Ali Gholami Rudi <ali@rudi.ir>
date: Fri Apr 27 19:14:22 EDT 2018

tr: allow parsing macro arguments as a request

For instance, after the following command, the argument of mac is
parsed just as .ds request.

  .de mac . ds
  .	tm \\$1: \\$2
  ..

--- a/tr.c
+++ b/tr.c
@@ -203,6 +203,8 @@
 	macrobody(&sbuf, args[2] ? args[2] : ".");
 	str_set(id, sbuf_buf(&sbuf));
 	sbuf_done(&sbuf);
+	if (!n_cp && args[3])	/* parse the arguments as request argv[3] */
+		str_dset(id, str_dget(map(args[3])));
 }
 
 static void tr_ig(char **args)