From 562b8ba4311d36597b982368544f346ae1633270 Mon Sep 17 00:00:00 2001 From: fuxialexander Date: Sun, 11 Feb 2018 17:04:30 +0800 Subject: [PATCH 1/2] Add: extend +write module --- init.example.el | 2 +- modules/app/write/README.org | 39 +++++++++++++++++++++++++++ modules/app/write/config.el | 51 +++++++++++++++++++++++++++++++++++ modules/app/write/packages.el | 11 ++++++++ 4 files changed, 102 insertions(+), 1 deletion(-) create mode 100644 modules/app/write/README.org create mode 100644 modules/app/write/config.el create mode 100644 modules/app/write/packages.el diff --git a/init.example.el b/init.example.el index 0bb4f79de..ca1bfaa4c 100644 --- a/init.example.el +++ b/init.example.el @@ -134,7 +134,7 @@ ;irc ; how neckbeards socialize ;rss ; emacs as an RSS reader ;twitter ; twitter client https://twitter.com/vnought - ;write ; emacs as a word processor (latex + org + markdown) + ;; (write +synosaurus +wordnut +langtool) ; emacs as a word processor (latex + org + markdown) ;; Private modules are where you place your personal configuration files. ;; By default, they are not tracked. There is one module included here, diff --git a/modules/app/write/README.org b/modules/app/write/README.org new file mode 100644 index 000000000..85288db98 --- /dev/null +++ b/modules/app/write/README.org @@ -0,0 +1,39 @@ +* +langtool +:PROPERTIES: +:ID: AE6DA5B3-6859-47D9-A483-972D42F0E11B +:END: +Support for languagetool + +For installation of languagetool, please checkout https://languagetool.org/. Noted that you need Java to run languagetool. + +MacOS users can install languagetool using ~brew~: +#+BEGIN_SRC bash +brew install languagetool +#+END_SRC + +After installation, you need to find out the path of the ~jar~ file and set it as ~+langtool-jar-path~. + +* +wordnut +:PROPERTIES: +:ID: 005E9DD8-DE23-4A69-B423-8950B5E23059 +:END: +This use ~wordnut~ package to provide a dictionary in Emacs. +Commands avaliable: +- ~wordnut-search~ +- ~wordnut-lookup-curent-word~ + +* +synosaurus +:PROPERTIES: +:ID: 005E9DD8-DE23-4A69-B423-8950B5E23059 +:END: +This use ~synosaurus~ package to provide a dictionary in Emacs. +Commands avaliable: +- ~synosaurus-mode~ +- ~synosaurus-lookup~ +- ~synosaurus-choose-and-replace~ + +* mixed-pitch +:PROPERTIES: +:ID: 417B004D-2E33-4071-894F-0792CB22B3D5 +:END: +This package enable fixed-width font and variable-pitch font coexist in the same buffer": you can use ~Fira code~ for code blocks in org mode file where use ~Ariel~ for main content (if you want...). diff --git a/modules/app/write/config.el b/modules/app/write/config.el new file mode 100644 index 000000000..9492cf5f5 --- /dev/null +++ b/modules/app/write/config.el @@ -0,0 +1,51 @@ +;;; app/write/config.el -*- lexical-binding: t; -*- + +(when (featurep! +langtool) + (defvar +langtool-default-lang "en-US" + "default language for langtool") + (defvar +langtool-mother-tongue nil + "mother tongue of user") + (defvar +langtool-jar-path "/usr/local/Cellar/languagetool/4.0/libexec/languagetool-commandline.jar" + "TODO") + (def-package! langtool + :commands (langtool-check + langtool-check-done + langtool-switch-default-language + langtool-show-message-at-point + langtool-correct-buffer) + :init + (setq langtool-default-language +langtool-default-lang + langtool-mother-tongue +langtool-mother-tongue + langtool-language-tool-jar +langtool-jar-path))) +(when (featurep! +wordnut) + (def-package! wordnut + :commands (wordnut-search + wordnut-lookup-current-word))) +(when (featurep! +synosaurus) + (def-package! synosaurus + :commands (synosaurus-mode + synosaurus-lookup + synosaurus-choose-and-replace) + :init + (require 'synosaurus-wordnet) + :config + (setq synosaurus-choose-method 'default))) + +(def-package! mixed-pitch + :config + (setq mixed-pitch-fixed-pitch-faces + (append mixed-pitch-fixed-pitch-faces + '(org-todo-keyword-todo + org-todo-keyword-habt + org-todo-keyword-done + org-todo-keyword-wait + org-todo-keyword-kill + org-todo-keyword-outd + org-special-keyword + org-date + org-property-value + org-special-keyword + org-property-value + org-ref-cite-face + org-tag + font-lock-comment-face)))) diff --git a/modules/app/write/packages.el b/modules/app/write/packages.el new file mode 100644 index 000000000..f94e24af7 --- /dev/null +++ b/modules/app/write/packages.el @@ -0,0 +1,11 @@ +;; -*- no-byte-compile: t; -*- +;;; app/write/packages.el + +(when (featurep! +langtool) + (package! langtool)) +(when (featurep! +wordnut) + (package! wordnut)) +(when (featurep! +synosaurus) + (package! synosaurus)) + +(package! mixed-pitch) From 13e2239fcd730b29061181dd9bd1932ffab79488 Mon Sep 17 00:00:00 2001 From: fuxialexander Date: Sun, 11 Feb 2018 17:05:16 +0800 Subject: [PATCH 2/2] Add: add mixed-pitch-mode to +write-mode --- modules/app/write/autoload.el | 1 + 1 file changed, 1 insertion(+) diff --git a/modules/app/write/autoload.el b/modules/app/write/autoload.el index 6b370c667..e0d3fcfef 100644 --- a/modules/app/write/autoload.el +++ b/modules/app/write/autoload.el @@ -13,6 +13,7 @@ (visual-fill-column-mode arg) (visual-line-mode arg) (when (eq major-mode 'org-mode) + (mixed-pitch-mode arg) (+org-pretty-mode arg)) (setq line-spacing (if +write-mode 4))))