From 8852c37bc0192666467866b9a142b35f13df9941 Mon Sep 17 00:00:00 2001 From: Diego Berrocal Date: Sat, 16 May 2015 01:35:29 -0500 Subject: [PATCH] Add better integration with edit-server package --- contrib/chrome/README.md | 18 ++++++++++-------- contrib/chrome/packages.el | 6 +++++- 2 files changed, 15 insertions(+), 9 deletions(-) diff --git a/contrib/chrome/README.md b/contrib/chrome/README.md index bc3531516..7d0c61c39 100644 --- a/contrib/chrome/README.md +++ b/contrib/chrome/README.md @@ -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 diff --git a/contrib/chrome/packages.el b/contrib/chrome/packages.el index 07ac58952..b9d1a5a10 100644 --- a/contrib/chrome/packages.el +++ b/contrib/chrome/packages.el @@ -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)) + ))