On Thu, Nov 09, 2006 at 08:35:35PM +0800, Nimrod A. Abing wrote: > On 11/9/06, Marnix Klooster <[EMAIL PROTECTED]> wrote: > >> How about piping into 'less -R' if the hunk is longer than X lines? > >> Where X might be specified either directly or as a multiple of $LINES? > > > >Or use the industry standard *grin* : pipe through $PAGER, defaulting to > >the "more" binary in your path. (Windows?) And perhaps a separate > >variable DARCS_PAGER_LINES to specify the cut-off X: if the patch is > >less than X lines, don't call $PAGER.
That doesn't work so well with coloured output. more will leave it unchanged, but most distributions default $PAGER to less and that needs the -R option, otherwise it will render the escapes in hex. Maybe try in order: - $DARCS_PAGER - less -R - $PAGER - more Or would it be better to check if $PAGER matches (^|/)less$ and add -R if necessary? Windows users are obviously stuck with more unless they go out of their way. > The behavior controlled by DARCS_PAGER_LINES can be implemented by > using LINES since darcs already uses ncurses(?). Not directly. I would find it very annoying if darcs called the pager every time a patch is just a little over a page: I'd rather just scroll my terminal. I see this is as only being useful for much longer patches. > LINES is set by > initscr() so you can use that to automatically determine if a pager is > needed for the patch. Of course, this breaks if your darcs was built > --without-curses. Bash and (I think) zsh also set $LINES, so that shouldn't be much of a problem. Hopefully csh/ksh are dead by now... -- Jamie Webb _______________________________________________ darcs-users mailing list [email protected] http://www.abridgegame.org/mailman/listinfo/darcs-users
