Re: [dev] Auto-preview man pages

From: Greg Reagle <>
Date: Thu, 7 Jan 2016 13:56:13 -0500

On 01/06/2016 06:59 PM, Adrian Grigore wrote:
> Don't know if it's worth posting, but this is a comfortable way for me
> to write man pages:
> ls *.1 | entr -cd sh -c 'MANPAGER="less -FX" man -l $0' /_
> entr is

I find entr very interesting and I am trying to understand it and its
potential uses.

I find it a real pain to work with things like man page source and
markdown source and so forth because of the extra steps of making the
output/object format.

Here is an example. I have a plain text "source" file in the yaml
format called address.yaml. This is the file that I modify. I have a
Makefile with a recipe to convert address.yaml into address.pdf "object"
file. I like to view and print address.pdf, but I never modify it.

So my typical work flow is this. I edit address.yaml. To view it in
PDF format, I run 'make address.pdf; mupdf address.pdf'. Over and over
I switch between my text editor, a shell to run the above command, and
the mupdf window. It is inconvenient. Computers are supposed to be
good at automating repetitive tasks.

Here is what I figured out using entr: I run
   ls address.yaml | entr make address.pdf
which means I don't have to type make, and I run
   ls address.pdf | entr -r mupdf /_
which means I don't have to type mupdf.

Actually, this works very well. It is very automated. Whenever I do a
save from my text editor, a mupdf window pops up.

However, it seems like an overly complicated way to achieve my goal.
I am left with the feeling that "There has got to be a better way." Is
Received on Thu Jan 07 2016 - 19:56:13 CET

This archive was generated by hypermail 2.3.0 : Thu Jan 07 2016 - 20:00:19 CET