On Sun, Jan 09, 2011 at 03:34:02PM +0100, Werner LEMBERG wrote:
> Colin Watson wrote:
> > Given that backspacing over half a character is never a particularly
> > sensible thing for a pager to do, I would suggest that we should
> > assume that pagers will backspace over a character at a time, as
> > less seems to do, and emit a number of backspaces corresponding to
> > the number of characters.  Does this make sense, or am I missing
> > something?
> 
> I second your analysis.  Can you provide a patch?

How about the following?

2011-01-09  Colin Watson  <cjwat...@debian.org>

        * src/devices/grotty/tty.cpp (tty_printer::make_underline): Only
        emit a single backspace in no-SGR mode.  less (at least) backspaces
        over a character at a time.
        (tty_printer::make_bold): Likewise.

=== modified file 'src/devices/grotty/tty.cpp'
--- src/devices/grotty/tty.cpp  2010-12-13 17:42:28 +0000
+++ src/devices/grotty/tty.cpp  2011-01-09 15:17:24 +0000
@@ -311,11 +311,8 @@ void tty_printer::make_underline(int w)
     if (!w)
       warning("can't underline zero-width character");
     else {
-      int n = w / font::hor;
-      for (int i = 0; i < n; i++)
-       putchar('_');
-      for (int j = 0; j < n; j++)
-       putchar('\b');
+      putchar('_');
+      putchar('\b');
     }
   }
   else {
@@ -337,10 +334,8 @@ void tty_printer::make_bold(output_chara
     if (!w)
       warning("can't print zero-width character in bold");
     else {
-      int n = w / font::hor;
       put_char(c);
-      for (int i = 0; i < n; i++)
-       putchar('\b');
+      putchar('\b');
     }
   }
   else {

Thanks,

-- 
Colin Watson                                       [cjwat...@debian.org]

_______________________________________________
bug-groff mailing list
bug-groff@gnu.org
http://lists.gnu.org/mailman/listinfo/bug-groff

Reply via email to