From owner-freebsd-questions@FreeBSD.ORG Sun Feb 20 22:56:23 2011 Return-Path: Delivered-To: freebsd-questions@FreeBSD.ORG Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id F28601065670 for ; Sun, 20 Feb 2011 22:56:23 +0000 (UTC) (envelope-from kline@thought.org) Received: from thought.org (plato.thought.org [209.180.213.209]) by mx1.freebsd.org (Postfix) with ESMTP id 4FFA18FC0C for ; Sun, 20 Feb 2011 22:56:23 +0000 (UTC) Received: by thought.org (Postfix, from userid 1001) id 33C78E8070A; Sun, 20 Feb 2011 14:56:22 -0800 (PST) Date: Sun, 20 Feb 2011 14:56:22 -0800 From: Gary Kline To: FreeBSD Mailing List Message-ID: <20110220225622.GA13744@thought.org> References: <20110219233736.GA20393@thought.org> <20110219235240.GA2495@libertas.local.camdensoftware.com> <20110220002300.GA21231@thought.org> <20110220004200.GC2495@libertas.local.camdensoftware.com> <20110220004432.GD2495@libertas.local.camdensoftware.com> <20110220084235.GA30569@thought.org> <20110220164410.GB66537@libertas.local.camdensoftware.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20110220164410.GB66537@libertas.local.camdensoftware.com> X-Organization: Thought Unlimited. Public service Unix since 1986. X-Of_Interest: With 24 years of service to the Unix community. User-Agent: Mutt/1.5.20 (2009-06-14) Cc: Subject: Re: variable line-display pager? X-BeenThere: freebsd-questions@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: User questions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 20 Feb 2011 22:56:24 -0000 On Sun, Feb 20, 2011 at 08:44:10AM -0800, Chip Camden wrote: > Quoth Gary Kline on Sunday, 20 February 2011: > > > > > Yes, this is much nicer that the more -15 that messes up the > > text with it's [MORE...] white within black. But here you can't > > just tap the spacebar; is there a way around that and > > turning it into a space...? > > > > Also, can you insert > > > > "^+++" > > > > text > > > > "^+++" > > > > top And bottom? Pretty sure that the user would have the large > > font to read aloug with that espeak read to hijm. Having the > > top/bottom delimiters might make scanning the text easier. > > > > (It messed up with more. > > > > Anyway, thanks foe something that actually works, :_) > > > > gary > > > > > > > > > > -- > > Gary Kline kline@thought.org http://www.thought.org Public Service Unix > > Journey Toward the Dawn, E-Book: http://www.thought.org > > The 7.98a release of Jottings: http://jottings.thought.org > > > Better? > The code does what you tell it to. It puts the +++ string before the output and following the EOF. I was thinking of having: +++ 15 lines of text +++ After espeak speaks these lines, the user hits the spacebar and another +++ 15 lines +++ until EOF. I know zero ruby and am still learhnning python. Thanks much for getting me going with ruby! FRom here on it is just logic, :_) gary > > #!/usr/bin/env ruby > require 'optparse' > > pagesize = 15 > > optparse = OptionParser.new do |opts| > opts.banner = 'usage: npg [-n pagesize] file...' > > opts.on('-n', '--numlines pagesize', 'Specify page size in number of lines') do |n| > pagesize = n.to_i > end > > end > > begin > optparse.parse! > rescue OptionParser::InvalidOption, OptionParser::MissingArgument => e > puts e > puts optparse > exit 1 > end > > puts "^+++" > loop do > pagesize.times do > if line = gets > puts line > else > puts "^+++" > exit > end > end > print "More..." > system "stty raw" > STDIN.getc > system "stty -raw" > end > > -- > Sterling (Chip) Camden | sterling@camdensoftware.com | 2048D/3A978E4F > http://chipsquips.com | http://camdensoftware.com | http://chipstips.com -- Gary Kline kline@thought.org http://www.thought.org Public Service Unix Journey Toward the Dawn, E-Book: http://www.thought.org The 7.98a release of Jottings: http://jottings.thought.org