Emacs: Refactor init.d/net/
This commit is contained in:
parent
9673849925
commit
7127a14006
|
@ -1,6 +1,6 @@
|
||||||
;;; client.el --- Network clients. -*- lexical-binding: t; -*-
|
;;; client.el --- Network clients. -*- lexical-binding: t; -*-
|
||||||
|
|
||||||
;; Time-stamp: <2020-05-26T06:13:03+0200>
|
;; Time-stamp: <2020-05-27T04:11:23+0200>
|
||||||
|
|
||||||
;;; Commentary:
|
;;; Commentary:
|
||||||
|
|
||||||
|
@ -10,35 +10,25 @@
|
||||||
|
|
||||||
;; Explore and test HTTP REST webservices.
|
;; Explore and test HTTP REST webservices.
|
||||||
(use-package restclient
|
(use-package restclient
|
||||||
:mode
|
:mode ("\\.restclient$" . restclient-mode))
|
||||||
("\\.restclient$" . restclient-mode)
|
|
||||||
)
|
|
||||||
|
|
||||||
;; Company completion for restclient.
|
;; Company completion for restclient.
|
||||||
(use-package company-restclient
|
(use-package company-restclient
|
||||||
:after (restclient company)
|
:after (restclient company)
|
||||||
|
:config (add-to-list 'company-backends 'company-restclient))
|
||||||
:config
|
|
||||||
(add-to-list 'company-backends 'company-restclient)
|
|
||||||
)
|
|
||||||
|
|
||||||
(use-package webpaste
|
(use-package webpaste
|
||||||
:commands (webpaste-paste-region webpaste-paste-buffer)
|
:commands (webpaste-paste-region webpaste-paste-buffer)
|
||||||
|
:custom (webpaste-provider-priority '("dpaste.org" "dpaste.com"))
|
||||||
:custom
|
:config (add-to-list
|
||||||
(webpaste-provider-priority '("dpaste.org" "dpaste.com"))
|
'webpaste-providers-alist
|
||||||
|
'("dpaste.org"
|
||||||
:config
|
:uri "https://dpaste.org/api/"
|
||||||
(add-to-list
|
:post-data (("expires" . 86400))
|
||||||
'webpaste-providers-alist
|
:post-field "content"
|
||||||
'("dpaste.org"
|
:post-lang-field-name "lexer"
|
||||||
:uri "https://dpaste.org/api/"
|
:lang-overrides ((emacs-lisp-mode . "clojure"))
|
||||||
:post-data (("expires" . 86400))
|
:success-lambda webpaste--providers-success-returned-string)))
|
||||||
:post-field "content"
|
|
||||||
:post-lang-field-name "lexer"
|
|
||||||
:lang-overrides ((emacs-lisp-mode . "clojure"))
|
|
||||||
:success-lambda webpaste--providers-success-returned-string))
|
|
||||||
)
|
|
||||||
|
|
||||||
;; Gemini and Gopher client.
|
;; Gemini and Gopher client.
|
||||||
(use-package elpher)
|
(use-package elpher)
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
;;; server.el --- Set up network stuff.. -*- lexical-binding: t; -*-
|
;;; server.el --- Set up network stuff.. -*- lexical-binding: t; -*-
|
||||||
|
|
||||||
;; Time-stamp: <2020-05-09T17:51:29+0200>
|
;; Time-stamp: <2020-05-27T04:21:10+0200>
|
||||||
|
|
||||||
;;; Commentary:
|
;;; Commentary:
|
||||||
|
|
||||||
|
@ -14,27 +14,23 @@
|
||||||
(use-package tramp
|
(use-package tramp
|
||||||
:straight nil ; Use built-in version.
|
:straight nil ; Use built-in version.
|
||||||
:defer 2
|
:defer 2
|
||||||
|
:custom ((tramp-use-ssh-controlmaster-options nil
|
||||||
:custom
|
"Don't override SSH config.")
|
||||||
(tramp-use-ssh-controlmaster-options nil) ; Don't override SSH config.
|
(tramp-default-method "ssh" "Faster than scp and supports ports.")
|
||||||
(tramp-default-method "ssh") ; ssh is faster than scp and supports ports.
|
(tramp-password-prompt-regexp
|
||||||
(tramp-password-prompt-regexp ; Add verification code support.
|
(concat
|
||||||
(concat
|
"^.*"
|
||||||
"^.*"
|
(regexp-opt
|
||||||
(regexp-opt
|
'("passphrase" "Passphrase"
|
||||||
'("passphrase" "Passphrase"
|
"password" "Password"
|
||||||
"password" "Password"
|
"Verification code")
|
||||||
"Verification code")
|
t)
|
||||||
t)
|
".*:\0? *") "Add verification code support.")
|
||||||
".*:\0? *"))
|
(tramp-connection-timeout 20)
|
||||||
(tramp-connection-timeout 20)
|
(tramp-auto-save-directory
|
||||||
;; Auto-save locally.
|
(concat user-emacs-directory "backups/") "Auto-save locally."))
|
||||||
(tramp-auto-save-directory (concat user-emacs-directory "backups/"))
|
:config (add-to-list
|
||||||
|
'tramp-remote-path 'tramp-own-remote-path)) ; Respect remote PATH.
|
||||||
:config
|
|
||||||
;; Respect remote PATH.
|
|
||||||
(add-to-list 'tramp-remote-path 'tramp-own-remote-path)
|
|
||||||
)
|
|
||||||
) ; unless slow-computer.
|
) ; unless slow-computer.
|
||||||
|
|
||||||
;; Run server if:
|
;; Run server if:
|
||||||
|
@ -46,42 +42,29 @@
|
||||||
(use-package server
|
(use-package server
|
||||||
:defer 2
|
:defer 2
|
||||||
:functions (server-running-p)
|
:functions (server-running-p)
|
||||||
|
:init (setq
|
||||||
:init
|
server-use-tcp t
|
||||||
(setq server-use-tcp t
|
server-port 51313
|
||||||
server-port 51313
|
server-auth-key ; 64 chars, saved in ~/.emacs.d/server/server.
|
||||||
server-auth-key ; 64 chars, saved in ~/.emacs.d/server/server.
|
"phahw2ohVoh0oopheish7IVie9desh8aequeenei3uo8wahShe%thuadaeNa4ieh")
|
||||||
"phahw2ohVoh0oopheish7IVie9desh8aequeenei3uo8wahShe%thuadaeNa4ieh")
|
:config (unless (eq (server-running-p) t)
|
||||||
|
(server-start)))
|
||||||
:config
|
|
||||||
(unless (eq (server-running-p) t) ; Run server if not t.
|
|
||||||
(server-start))
|
|
||||||
)
|
|
||||||
|
|
||||||
;; Server for Firefox-extension that allows to use Emacs to edit textareas.
|
;; Server for Firefox-extension that allows to use Emacs to edit textareas.
|
||||||
;; https://addons.mozilla.org/en-US/firefox/addon/ghosttext/
|
;; https://addons.mozilla.org/en-US/firefox/addon/ghosttext/
|
||||||
(use-package atomic-chrome
|
(use-package atomic-chrome
|
||||||
:defer 2
|
:defer 2
|
||||||
:config
|
:config (atomic-chrome-start-server)
|
||||||
(atomic-chrome-start-server)
|
|
||||||
|
|
||||||
:custom
|
|
||||||
;; “url” is actually the hostname.
|
;; “url” is actually the hostname.
|
||||||
(atomic-chrome-url-major-mode-alist
|
:custom ((atomic-chrome-url-major-mode-alist
|
||||||
'(
|
'(("^likeable\\.space$" . markdown-mode)
|
||||||
("^likeable\\.space$" . markdown-mode)
|
("^schlomp\\.space$" . gfm-mode)
|
||||||
("^schlomp\\.space$" . gfm-mode)
|
;; ("^wiki\\.gentoo\\.org$" . mediawiki-mode)
|
||||||
;; ("^wiki\\.gentoo\\.org$" . mediawiki-mode)
|
("^github\\.com$" . gfm-mode)
|
||||||
("^github\\.com$" . gfm-mode)
|
("^gitlab\\.com$" . gfm-mode)
|
||||||
("^gitlab\\.com$" . gfm-mode)
|
("^gitlab\\.gnome\\.org$" . gfm-mode)))
|
||||||
("^gitlab\\.gnome\\.org$" . gfm-mode)
|
(atomic-chrome-buffer-open-style 'frame))
|
||||||
))
|
:hook (atomic-chrome-edit-mode . (lambda () (setq-fill-column 400))))))
|
||||||
(atomic-chrome-buffer-open-style 'frame)
|
|
||||||
|
|
||||||
:hook
|
|
||||||
(atomic-chrome-edit-mode . (lambda () (setq-local fill-column 400)))
|
|
||||||
)
|
|
||||||
))
|
|
||||||
|
|
||||||
(provide 'net/server)
|
(provide 'net/server)
|
||||||
;;; server.el ends here
|
;;; server.el ends here
|
||||||
|
|
Loading…
Reference in New Issue
Block a user