The 317 can also current limit.
This feature could be added to this simple yet elegant circuit.
http://www.electronics-lab.com/projects/power/010/index.html
The math is R=E/I
"The Key feature of the LM317, and its family, is that the regulation voltage between the