Re: [dev] announcing edit-pipe

2017-08-29 Thread Nick
Quoth Greg Reagle: > > * Quote "$edit" in case the editor has a space in its name. > > I deliberately do not quote $edit so that I can set EDITOR to nano -w. > Is that non-standard/wacky? Is there a convention for whether the the > value of EDITOR environment variable should be able to have opt

Re: [dev] announcing edit-pipe

2017-08-28 Thread Kamil Cholewiński
> The name generated by mktemp is the concatenation of a directory name, > a slash (/), the value of the LOGNAME environment variable truncated > to {NAME_MAX} - 6 characters, and the process ID of the invoking > process. This is horrible. I guess HP-UX has much bigger problems than an inc

Re: [dev] announcing edit-pipe

2017-08-27 Thread Anselm R Garbe
On 27 August 2017 at 20:16, Greg Reagle wrote: > On Sun, Aug 27, 2017, at 13:48, Thomas Levine wrote: >> * mktemp is not portable; you could use something like the date and >> process identifier ($$) to create a portable temporary file. >> (I am actually still curious as to whether there is a

Re: [dev] announcing edit-pipe

2017-08-27 Thread Thomas Levine
I suppose I could have just logged in to my HP-UX computer to confirm. So now I do that. It indeed has an incompatible version of mktemp that happens to be even worse than the option that I proposed; here is the relevant section of the man page. The name generated by mktemp is the concatenation

Re: [dev] announcing edit-pipe

2017-08-27 Thread Greg Reagle
On Sun, Aug 27, 2017, at 16:46, Kamil Cholewiński wrote: > On Sun, 27 Aug 2017, Thomas Levine <_...@thomaslevine.com> wrote: > > * mktemp is not portable; you could use something like the date and > > process identifier ($$) to create a portable temporary file. > > This is very wrong advice, ple

Re: [dev] announcing edit-pipe

2017-08-27 Thread Kamil Cholewiński
On Sun, 27 Aug 2017, Thomas Levine <_...@thomaslevine.com> wrote: > * mktemp is not portable; you could use something like the date and > process identifier ($$) to create a portable temporary file. This is very wrong advice, please don't do this. Current timestamp is as guessable as it gets. PI

Re: [dev] announcing edit-pipe

2017-08-27 Thread Thomas Levine
> > * mktemp is not portable; you could use something like the date and > > process identifier ($$) to create a portable temporary file. > > (I am actually still curious as to whether there is a reasonable > > portable approach that is less sloppy than this.) > > I'm not sure the best way to

Re: [dev] announcing edit-pipe

2017-08-27 Thread Greg Reagle
On Sun, Aug 27, 2017, at 13:48, Thomas Levine wrote: > * mktemp is not portable; you could use something like the date and > process identifier ($$) to create a portable temporary file. > (I am actually still curious as to whether there is a reasonable > portable approach that is less sloppy

Re: [dev] announcing edit-pipe

2017-08-27 Thread Greg Reagle
On Sun, Aug 27, 2017, at 13:18, isabella parakiss wrote: > why don't you open the !@#$%^&* vipe script and read it? I did. > YOU WROTE THE EXACT SAME THING Well it's very similar, but not the exact same thing because it has the -v option. > you literally have ZERO control over the amount of mem

Re: [dev] announcing edit-pipe

2017-08-27 Thread Thomas Levine
I had not been aware of vipe; thank you for sending this! Removing the perl dependency is worthwhile, even if it does not reduce RAM usage. (And I don't know what affects the RAM usage in this case.) Regarding the portability of your version, * mktemp is not portable; you could use something lik

Re: [dev] announcing edit-pipe

2017-08-27 Thread isabella parakiss
On 8/27/17, Greg Reagle wrote: > Hello everyone. Someone asked a little while ago about a suckless pager > and I mentioned using vipe of moreutils to use your favorite editor as a > pager. I noticed that when I was using vipe it was using several > megabytes (it is written in Perl) so I wrote a

Re: [dev] announcing edit-pipe

2017-08-27 Thread Josuah Demangeon
A similar tool made for the dvtm pager: https://github.com/martanne/dvtm/raw/master/dvtm-editor.c It saves stdin to a file and open an editor on it, then if the file has changed since its creation, it print all the content of the file to stdout. It is used to copy a fragment of a file: select th

[dev] announcing edit-pipe

2017-08-27 Thread Greg Reagle
Hello everyone. Someone asked a little while ago about a suckless pager and I mentioned using vipe of moreutils to use your favorite editor as a pager. I noticed that when I was using vipe it was using several megabytes (it is written in Perl) so I wrote a program in Bourne shell that is much sma