[PATCH libXext] groff: remove tty backspace encoding in text files

Gaetan Nadon memsize at videotron.ca
Mon Jun 21 06:39:04 PDT 2010


Groff uses grotty for the conversion of troff files.
The target device is a terminal, not a plain text file.
When using "cat file.txt" the output is correct, you can see
bold and underline words.

However it contains backspace sequence for bold, underline or
overstrike charaters. These show up as ^H in vi or as graphic
characters in other editors.

The intention is to produce a plain text version for the documentation,
not man page kind of tty output.

The solution is to use -u -b -o options on grotty to supress these
in the first place. Some ^H still remain where sed is used to remove them.

Signed-off-by: Gaetan Nadon <memsize at videotron.ca>
---
 specs/Makefile.am |    4 ++--
 1 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/specs/Makefile.am b/specs/Makefile.am
index 7d39c2a..0e69ea7 100644
--- a/specs/Makefile.am
+++ b/specs/Makefile.am
@@ -73,8 +73,8 @@ SUFFIXES = .ms .ps .txt .html
 	 else test $$? -le 1; fi
 
 .ms.txt:
-	$(AM_V_GEN) env GROFF_NO_SGR=TRUE $(GROFF) -Tutf8 $(GROFF_FLAGS) \
-	 $< 2> index.$@.raw > $@
+	$(AM_V_GEN) env GROFF_NO_SGR=TRUE $(GROFF) -P-u -P-o -P-b -Tutf8 $(GROFF_FLAGS) \
+	 $< 2> index.$@.raw  | $(SED) -e 's/\x08//g' > $@
 
 .ms.html:
 	$(AM_V_GEN) $(GROFF) -Thtml -P-Dimages -P-I$*-image $(GROFF_FLAGS) $< 2> index.$@.raw > $@
-- 
1.6.0.4



More information about the xorg-devel mailing list