Adding edit-server layer.

This commit is contained in:
Ben Hayden 2015-04-21 14:20:28 -05:00 committed by syl20bnr
parent 2389fea56c
commit 3abb869f73
3 changed files with 61 additions and 0 deletions

View file

@ -0,0 +1,43 @@
# edit-server contribution layer for Spacemacs
![logo](img/chrome.png)
<!-- markdown-toc start - Don't edit this section. Run M-x markdown-toc/generate-toc again -->
**Table of Contents**
- [edit-server contribution layer for Spacemacs](#edit-server-contribution-layer-for-spacemacs)
- [Description](#description)
- [Install](#install)
- [Configuration](#configuration)
<!-- markdown-toc end -->
## Description
This layer provides [edit-server](http://melpa.org/#/edit-server) - a server that responds to edit requests from Chrome. The package is required by the [Edit with Emacs](https://chrome.google.com/webstore/detail/edit-with-emacs/ljobjlafonikaiipfkggjbhkghgicgoh) Google Chrome extension.
More information can be found on [Emacs Wiki](http://www.emacswiki.org/emacs/Edit_with_Emacs).
## Install
To use this contribution add it to your `~/.spacemacs`
```elisp
(setq-default dotspacemacs-configuration-layers '(edit-server))
```
The server is configured to start when the editor is opened.
## Configuration
You can hook into `edit-server`'s provided hooks in `dotspacemacs/config` in your `.spacemacs` file.
```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))))
)
```

Binary file not shown.

After

Width:  |  Height:  |  Size: 28 KiB

View file

@ -0,0 +1,18 @@
;;; packages.el --- edit-server Layer packages File for Spacemacs
;;
;; Copyright (c) 2012-2014 Sylvain Benner
;; Copyright (c) 2014-2015 Sylvain Benner & Contributors
;;
;; Author: Ben Hayden <hayden767@gmail.com>
;; URL: https://github.com/syl20bnr/spacemacs
;;
;; This file is not part of GNU Emacs.
;;
;;; License: GPLv3
(setq edit-server-packages '(edit-server))
(defun edit-server/init-edit-server ()
(use-package edit-server
:init (eval-after-load 'edit-server
'(edit-server-start))))