Re: [dev] I wrote a pager

2016-09-17 Thread hiro
Suckless is not about being so small that any task, even stupidly useless like this one suddenly sucks less because of linecount.

Re: [dev] I wrote a pager

2016-09-17 Thread Greg Reagle
On Sat, Sep 17, 2016, at 12:55 PM, pranomes...@gmail.com wrote: > Maybe I'm a bit late for the party, but I think that > https://arcetera.moe/git/pg/log.html > could be another alternative for a suckless pager. > > Possible advantages: more features, like scrolling back and going to the >

Re: [dev] I wrote a pager

2016-09-17 Thread Greg Reagle
On Sat, Sep 17, 2016, at 01:09 PM, hiro wrote: > a suckless pager would be provided by the terminal. Good point. I hadn't thought of that when I was trying stali. Stali has dvtm! Even still, I think that it would be nice for sbase to have a pager and I think that the one I wrote is pretty

Re: [dev] I wrote a pager

2016-09-17 Thread hiro
you might also just want to fix your tmux or dvtm or whatever you use to organize your virtual terminals in your virtual terminals.

Re: [dev] I wrote a pager

2016-09-17 Thread hiro
a suckless pager would be provided by the terminal.

Re: [dev] I wrote a pager

2016-09-17 Thread pranomestro
Greg Reagle wrote: > Thanks to all who gave feedback. I made a few enhancements. Hopefully > they're not bloat. I think it has significantly better functionality > for only several more SLOC. Once again, looking for feedback. Also, do > you suckless maintainers want to

Re: [dev] I wrote a pager

2016-09-16 Thread Greg Reagle
Thanks to all who gave feedback. I made a few enhancements. Hopefully they're not bloat. I think it has significantly better functionality for only several more SLOC. Once again, looking for feedback. Also, do you suckless maintainers want to put this into sbase? It tries to get the size of

Re: [dev] I wrote a pager

2016-09-16 Thread Greg Reagle
On Fri, Sep 16, 2016, at 04:10 PM, Martin Kühne wrote: > a few gripes: > > atoi: personally I prefer strtol and range-checks on the result and/or > errno. > getenv(LINES) is a start, but you might also want to offer > ioctl(TIOCGWINSZ) where available. > always NULL-check the return value of

Re: [dev] I wrote a pager - errno

2016-09-16 Thread Greg Reagle
On Fri, Sep 16, 2016, at 12:26 PM, u...@netbeisser.de wrote: > > #include > > #include > > > > int main() > > { > > const int page_size = 22; > > int count = 0; > > int ch; > > FILE *tty; > > > > if ((tty = fopen("/dev/tty", "a+")) == NULL) > > return(errno); >

Re: [dev] I wrote a pager

2016-09-16 Thread Martin Kühne
a few gripes: atoi: personally I prefer strtol and range-checks on the result and/or errno. getenv(LINES) is a start, but you might also want to offer ioctl(TIOCGWINSZ) where available. always NULL-check the return value of getenv. what does your pager do on binary input and unexpected things?

Re: [dev] I wrote a pager

2016-09-16 Thread Johnathan McKnight
Can you elaborate? On Fri, Sep 16, 2016 at 2:41 PM, Teodoro Santoni wrote: > Hi, > > 2016-09-16 17:40 GMT, Evan Gates : >> On Fri, Sep 16, 2016 at 9:25 AM, wrote >>> Thank you Greg for writing such a fantastic pager. I could

Re: [dev] I wrote a pager

2016-09-16 Thread Teodoro Santoni
Hi, 2016-09-16 17:40 GMT, Evan Gates : > On Fri, Sep 16, 2016 at 9:25 AM, wrote >> Thank you Greg for writing such a fantastic pager. I could increase lines >> however to something more than 22. > > char *lines = getenv("LINES"); > int page_size = lines

Re: [dev] I wrote a pager

2016-09-16 Thread Evan Gates
On Fri, Sep 16, 2016 at 9:25 AM, wrote > Thank you Greg for writing such a fantastic pager. I could increase lines > however to something more than 22. char *lines = getenv("LINES"); int page_size = lines ? atoi(lines) : 24;

Re: [dev] I wrote a pager - errno

2016-09-16 Thread u
On Fri, Sep 16, 2016 at 11:43:37AM -0400, Greg Reagle wrote: > On Fri, Sep 16, 2016, at 10:01 AM, Greg Reagle wrote: > > Greetings. I am running stali in qemu and and it seems to lack a pager. > > Is it a goal of the suckless project to write a suckless pager for > > sbase? I see that plan9port

Re: [dev] I wrote a pager

2016-09-16 Thread u
On Fri, Sep 16, 2016 at 11:43:37AM -0400, Greg Reagle wrote: > On Fri, Sep 16, 2016, at 10:01 AM, Greg Reagle wrote: > > Greetings. I am running stali in qemu and and it seems to lack a pager. > > Is it a goal of the suckless project to write a suckless pager for > > sbase? I see that

[dev] I wrote a pager

2016-09-16 Thread Greg Reagle
On Fri, Sep 16, 2016, at 10:01 AM, Greg Reagle wrote: > Greetings. I am running stali in qemu and and it seems to lack a pager. > Is it a goal of the suckless project to write a suckless pager for > sbase? I see that plan9port already has a pager called "p". What about > importing that into