eschulte / rinari

Rinari Is Not A Rails IDE (it is an Emacs minor mode for Rails)
http://rinari.rubyforge.org
GNU General Public License v3.0
413 stars 68 forks source link

Adding rinari-web-server-restart #1

Closed developernotes closed 14 years ago

developernotes commented 14 years ago

Hello,

I've added a function to ease killing and restarting the web server in rinari called rinari-web-server-restart. It checks for a running server and kills it if found, subsequently relaunching a server.

Thanks.

rejeep commented 14 years ago

Seems like a function that definitely should be in Rinari!

A question about your code though. Why do you use an if-statement with a progn for the true case and nil in the false case?

Wouldn't this be just as good? (defun rinari-web-server-restart (&optional edit-cmd-args) "If rinari-web-server is running, kill it and start a new server, otherwise just launch the server" (interactive "P") (let ((rinari-web-server-buffer "server")) (when (get-buffer rinari-web-server-buffer) (set-process-query-on-exit-flag (get-buffer-process rinari-web-server-buffer) nil) (kill-buffer rinari-web-server-buffer)) (rinari-web-server edit-cmd-args)))

developernotes commented 14 years ago

rejeep,

That sounds good, I'll make an adjustment and create a new pull request. Thanks.