Created
November 7, 2010 12:02
-
-
Save nonsequitur/666092 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
(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