Add better integration with edit-server package

This commit is contained in:
Diego Berrocal 2015-05-16 01:35:29 -05:00 committed by syl20bnr
parent 1241b1e536
commit 8852c37bc0
2 changed files with 15 additions and 9 deletions

View file

@ -28,7 +28,7 @@ Feature:
To use this contribution add it to your `~/.spacemacs`
```elisp
(setq-default dotspacemacs-configuration-layers '(edit-server))
(setq-default dotspacemacs-configuration-layers '(chrome))
```
### Chrome extension
@ -42,19 +42,21 @@ The edit server is configured to start automatically when Spacemacs starts.
## Configuration
You can hook into `edit-server`'s provided hooks in `dotspacemacs/config` in
your `.spacemacs` file.
Use `edit-server-url-major-mode-alist` to choose a major mode initialization
function based on `edit-server-url`, or fall back to
`edit-server-default-major-mode` that has a current value of `markdown-mode`.
```elisp
(defun dotspacemacs/config ()
;; Open github text areas as markdown
(add-hook 'edit-server-start-hook
(lambda ()
(when (string-match "github.com" (buffer-name))
(markdown-mode))))
;; Open github text areas as org buffers
;; currently they are opened as markdown
(setq edit-server-url-major-mode-alist
'(("github\\.com" . org-mode)))
)
```
Or
[edit-server]: http://melpa.org/#/edit-server
[Edit with Emacs]: https://chrome.google.com/webstore/detail/edit-with-emacs/ljobjlafonikaiipfkggjbhkghgicgoh
[Emacs Wiki]: http://www.emacswiki.org/emacs/Edit_with_Emacs

View file

@ -16,4 +16,8 @@
(use-package edit-server
:init
(progn
(edit-server-start))))
(edit-server-start))
:config
(progn
(setq edit-server-default-major-mode 'markdown-mode))
))