Closed pwojnowski closed 10 years ago
Thanks for the improvements! I accepted all three commits, two of them with slight changes, so the commit IDs won't match.
I changed the type of httpd-host from string to a compound type that allows the symbol nil, symbol local, or any arbitrary string. The vast majority of users will want to use either of the two symbols (nil binds to all, local binds to localhost). Plus this won't break things for users already using nil or local. I changed the default back to nil because I don't want to change the default server behavior.
I changed httpd-serve-dir to httpd-serve-directory since it's a nice user-facing command. I also changed the printout to accommodate the updated httpd-host type.
That (require 'cl) in the tests will, in the distant future when cl has been completely removed, become (require 'noflet). Emacs no longer includes a non-deprecated dynamically-scoped flet, the version essential for unit testing. This is what the noflet package brings back. However, simple-httpd currently has no external dependencies and I don't want to introduce one just for this.
When httpd-host is used as symbol then it's hard to pass different host names or ip addresses to make-network-process, which expects them to be strings.
Added 'cl dep to tests, without which they don't work in batch mode - no "flet" definition.
Created a helper function which asks user for directory and starts the web server with the dir as current httpd-root. I find it very helpful, especially when working on different project with skewer-mode.