Skip to content

Instantly share code, notes, and snippets.

@ymorimo
Created August 8, 2011 20:16
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save ymorimo/1132618 to your computer and use it in GitHub Desktop.
Save ymorimo/1132618 to your computer and use it in GitHub Desktop.
edit-server config
(when (require 'edit-server nil 'noerror)
(setq edit-server-new-frame nil)
(edit-server-start)
(setq my-edit-server-mode-alist '(("github.com" . markdown-mode) ("blogger.com" . html-mode)))
(add-hook 'edit-server-start-hook
(lambda ()
(let ((lst my-edit-server-mode-alist))
(while lst
(if (string-match (caar lst) (buffer-name))
(progn
(funcall (cdar lst))
(setq lst nil))
(setq lst (cdr lst)))))))
;; bring Emacs to the front
(when (eq window-system 'ns)
(add-hook 'edit-server-start-hook
(lambda () (ns-do-applescript "tell application \"Emacs\" to activate")))))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment