Skip to content

Instantly share code, notes, and snippets.

@nonsequitur
Created November 7, 2010 12:02
Show Gist options
  • Save nonsequitur/666092 to your computer and use it in GitHub Desktop.
Save nonsequitur/666092 to your computer and use it in GitHub Desktop.
(require 'moz)
;;; Usage
;; Run M-x moz-reload-on-save-mode to switch moz-reload on/off in the
;; current buffer.
;; When active, saving the buffer triggers Firefox
;; to reload its current page.
(define-minor-mode moz-reload-on-save-mode
"Moz Reload On Save Minor Mode"
nil " Reload" nil
(if moz-reload-on-save-mode
;; Edit hook buffer-locally.
(add-hook 'after-save-hook 'moz-firefox-reload nil t)
(remove-hook 'after-save-hook 'moz-firefox-reload t)))
(defun moz-firefox-reload ()
(comint-send-string (inferior-moz-process) "BrowserReload();"))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment