shithub: neatroff

Download patch

ref: 98888b4b078cf0197416287f3650d9ad3a75acbe
parent: fa9769a25be700f1aecaeb688f1dd57c9366b87e
author: Ali Gholami Rudi <[email protected]>
date: Sat Sep 21 16:10:49 EDT 2013

ren: add .cl request to change color, just like \m[]

--- a/ren.c
+++ b/ren.c
@@ -579,7 +579,7 @@
 	}
 }
 
-static void ren_m(char *s)
+static void ren_cl(char *s)
 {
 	int m = !s || !*s ? n_m0 : clr_get(s);
 	n_m0 = n_m;
@@ -586,6 +586,11 @@
 	n_m = m;
 }
 
+void tr_cl(char **args)
+{
+	ren_cl(args[1]);
+}
+
 void tr_ab(char **args)
 {
 	fprintf(stderr, "%s\n", args[1]);
@@ -626,7 +631,7 @@
 		ren_hlcmd(wb, arg);
 		break;
 	case 'm':
-		ren_m(arg);
+		ren_cl(arg);
 		break;
 	case 'o':
 		ren_ocmd(wb, arg);
--- a/roff.h
+++ b/roff.h
@@ -290,6 +290,7 @@
 void tr_br(char **args);
 void tr_ce(char **args);
 void tr_ch(char **args);
+void tr_cl(char **args);
 void tr_di(char **args);
 void tr_divbeg(char **args);
 void tr_divend(char **args);
--- a/tr.c
+++ b/tr.c
@@ -717,6 +717,7 @@
 	{"cc", tr_cc},
 	{"ce", tr_ce},
 	{"ch", tr_ch},
+	{"cl", tr_cl},
 	{"cp", tr_cp},
 	{"cs", tr_cs},
 	{"da", tr_di},