Skip to content

Instantly share code, notes, and snippets.

@atog
Forked from pjaspers/rinari
Created May 25, 2010 09:36
Show Gist options
  • Save atog/412956 to your computer and use it in GitHub Desktop.
Save atog/412956 to your computer and use it in GitHub Desktop.
Restart passenger from emacs
;; As seen on
;; http://lucky-dip.net/articles/2009/08/06/restart-passenger-from-emacs-using-rinari/
;; Anyway, here is a small snippet of emacs lisp to easily restart the
;; Passenger server for the project you are currently working on. It
;; assumes you have Rinari installed.
(defun restart-passenger ()
"Restart passenger using the current rinari root" (interactive)
(shell-command (concat "touch " (rinari-root) "tmp/restart.txt"))
(message "Passenger restarted"))
;; And assign it to a key
(global-set-key (kbd "C-c ' p") 'restart-passenger)
@dotemacs
Copy link

;; you might like this

;; tweaked it so it only loads the settings for rinari mode
;;
;; don't know why, but the code is getting weird markup

(add-hook 'rinari-minor-mode-hook
"Passenger restart, in rinari mode"
(defun my-rinari-hook()
(defun restart-passenger ()
"Restart passenger using the current rinari root" (interactive)
(shell-command (concat "touch " (rinari-root) "tmp/restart.txt"))
(message "Passenger restarted"))
(define-key rinari-minor-mode-map "\C-c'p" 'restart-passenger)))

@dotemacs
Copy link

Hi, I tried to add a gist under yours, but it kept getting weird markup, so I created this: http://gist.github.com/435966

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment