-
Notifications
You must be signed in to change notification settings - Fork 1
/
my-edit-server.el
81 lines (74 loc) · 2.78 KB
/
my-edit-server.el
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
;;; my-edit-server.el -- load up the Edit with Emacs edit server
;;
;;; Commentary:
;;
;; There is not much to do here but ensure the edit server is spawned
;; at the end of start-up and we have hooks in place for the various modes.
;;
;;; Code:
(require 'use-package)
(use-package my-vars)
(use-package my-web)
(when have-melpa
(use-package jira-markup-mode
:ensure t))
(use-package edit-server
:load-path (lambda () (my-return-path-if-ok "~/mysrc/edit-with-emacs.git/servers"))
:ensure t
:commands edit-server-start
:init (progn
(when I-am-on-pixelbook
(setq edit-server-host "0.0.0.0"
edit-server-port 8000)
(global-set-key (kbd "C-x C-c") 'delete-frame))
(if after-init-time
(edit-server-start)
(add-hook 'after-init-hook
#'(lambda() (edit-server-start)))))
:config (setq edit-server-new-frame-alist
'((name . "Edit with Emacs FRAME")
(width . 80)
(height . 25)
(minibuffer . t)
(menu-bar-lines . t)
(window-system . x))
edit-server-url-major-mode-alist
(list '("stackexchange" . markdown-mode)
'("github.com" . markdown-mode))))
(with-eval-after-load 'edit-server
;; Markdown
(add-to-list 'edit-server-url-major-mode-alist
'("reddit" . markdown-mode))
;; Mediawiki
(add-to-list 'edit-server-url-major-mode-alist
'("mediawiki" . mediawiki-mode))
(add-to-list 'edit-server-url-major-mode-alist
'("wikipedia" . mediawiki-mode))
(add-to-list 'edit-server-url-major-mode-alist
'("wiki.qemu.org" . mediawiki-mode))
;; Moin-moin
(add-to-list 'edit-server-url-major-mode-alist
'("wiki.linaro.org" . moinmoin-mode))
(add-to-list 'edit-server-url-major-mode-alist
'("projects.linaro.org" . jira-markup-mode))
;; Diapora
(add-to-list 'edit-server-url-major-mode-alist
'("diasp.eu" . markdown-mode))
;; Web-mode
(add-to-list 'edit-server-url-major-mode-alist
'("www.bennee.com/~alex/blog" . web-mode))
;; Fallbacks for webmail
(unless (require 'gmail-message-mode nil t)
(add-to-list 'edit-server-url-major-mode-alist
'("mail.google" . mail-mode))
;; Rough and ready html munging
(when (require 'edit-server-htmlize nil t)
(add-hook 'edit-server-start-hook
'edit-server-maybe-dehtmlize-buffer)
(add-hook 'edit-server-done-hook
'edit-server-maybe-htmlize-buffer)))
;; Final bits
(setq edit-server-edit-mode-hook nil)
(add-hook 'edit-server-edit-mode-hook 'flyspell-mode t))
(provide 'my-edit-server)
;;; my-edit-server.el ends here