aboutsummaryrefslogtreecommitdiff
path: root/config
diff options
context:
space:
mode:
authorKenny Ballou <kb@devnulllabs.io>2022-11-16 14:46:52 -0700
committerKenny Ballou <kb@devnulllabs.io>2022-11-16 14:46:52 -0700
commit49bc3e994a186a7cfe8a58ecd8e7c2832abf8aca (patch)
treea26b63c37a6884ee84387adaf6013df1876a0a24 /config
parente08818c2a8e3cff22c9c1cb876cf97fdbe6c8e94 (diff)
downloaddotfiles-49bc3e994a186a7cfe8a58ecd8e7c2832abf8aca.tar.gz
dotfiles-49bc3e994a186a7cfe8a58ecd8e7c2832abf8aca.tar.xz
packages: profile: dev: add darcs
Signed-off-by: Kenny Ballou <kb@devnulllabs.io>
Diffstat (limited to 'config')
-rw-r--r--config/emacs/emacs.d/emacs.org116
-rw-r--r--config/guix/channels.scm10
2 files changed, 121 insertions, 5 deletions
diff --git a/config/emacs/emacs.d/emacs.org b/config/emacs/emacs.d/emacs.org
index 3c2dcdbb..3bcd408f 100644
--- a/config/emacs/emacs.d/emacs.org
+++ b/config/emacs/emacs.d/emacs.org
@@ -1408,6 +1408,50 @@ https://masteringemacs.org/article/polymode-multiple-major-modes-how-to-use-sql-
(setq synosaurus-backend #'synosaurus-backend-wordnet)
(setq synosaurus-choose-method 'ido))
#+end_src
+
+**** LTEX Language Server
+:PROPERTIES:
+:ID: b170b85a-3d40-4bb6-973c-a9f6a5862719
+:END:
+
+#+begin_src elisp :tangle no
+(use-package lsp-ltex
+ :after lsp
+ :hook (text-mode . kb/enable-ltex)
+ :init
+ (defun kb/enable-ltex ()
+ (require 'lsp-ltex)
+ (lsp-deferred))
+ :config
+ (setq lsp-ltex-ls-path (string-join (list user-emacs-directory "/lsp-ltex/")))
+ (setq lsp-ltex-version "15.2.0"))
+#+end_src
+
+**** detex
+:PROPERTIES:
+:ID: e9352fe8-02e4-4082-9f90-34460f51c9e7
+:END:
+
+Simple function which returns buffer contents untexified.
+
+#+begin_src elisp :tangle no
+(defun detex-filter (contents)
+ "Return buffer contents without (La)TeX commands via `detex'."
+ (2text-filter "detex" contents))
+
+(defun ws-filter (contents)
+ "Return buffer contents without extra whitespace via `sed'."
+ (2text-filter "sed" contents "s/^\\s+//g"))
+
+(defun 2text-filter (program contents &rest ARGS)
+ "Return buffer contents after passing `CONTENTS' to `PROGRAM'."
+ (with-temp-buffer
+ (goto-char (point-min))
+ (insert contents)
+ (apply #'call-process-region (point-min) (point-max) program t t nil ARGS)
+ (buffer-substring-no-properties (point-min) (point-max))))
+#+end_src
+
**** LanguageTool
:PROPERTIES:
:ID: c084445a-9d5c-4a05-8273-f1d6d6cc772d
@@ -1427,6 +1471,47 @@ https://masteringemacs.org/article/polymode-multiple-major-modes-how-to-use-sql-
(flycheck-add-next-checker 'languagetool 'vale)
(flycheck-remove-next-checker 'languagetool 'proselint))
#+end_src
+
+#+begin_src elisp :tangle no
+(defun flycheck-languagetool--start (_checker callback)
+ "Flycheck start function for _CHECKER `languagetool', invoking CALLBACK."
+ (when (or flycheck-languagetool-server-command
+ flycheck-languagetool-server-jar)
+ (unless flycheck-languagetool--started-server
+ (setq flycheck-languagetool--started-server t)
+ (flycheck-languagetool--start-server)))
+
+ (let* ((url-request-method "POST")
+ (url-request-extra-headers
+ '(("Content-Type" . "application/x-www-form-urlencoded")))
+ (disabled-rules
+ (flatten-tree (list
+ (cdr (assoc "disabledRules"
+ flycheck-languagetool-check-params))
+ (when (bound-and-true-p flyspell-mode)
+ flycheck-languagetool--spelling-rules))))
+ (other-params (assoc-delete-all "disabledRules"
+ flycheck-languagetool-check-params))
+ (url-request-data
+ (mapconcat
+ (lambda (param)
+ (concat (url-hexify-string (car param)) "="
+ (url-hexify-string (cdr param))))
+ (append other-params
+ `(("language" . ,flycheck-languagetool-language)
+ ("text" . ,(detex-filter (buffer-substring-no-properties (point-min) (point-max)))))
+ (when disabled-rules
+ (list (cons "disabledRules"
+ (string-join disabled-rules ",")))))
+ "&")))
+ (url-retrieve
+ (concat (or flycheck-languagetool-url
+ (format "http://localhost:%s"
+ flycheck-languagetool-server-port))
+ "/v2/check")
+ #'flycheck-languagetool--read-results
+ (list (current-buffer) callback)
+ t)))
#+end_src
**** Pulsar
@@ -2504,6 +2589,14 @@ left to try and get the PATH down to, at most, MAX-LEN."
(use-package lsp-treemacs :commands lsp-treemacs-errors-list)
#+end_src
+#+begin_src elisp :tangle no
+(use-package eglot
+ :bind (:map eglot-keymap
+ ("C-c e r" . #'eglot-rename))
+ :config
+ (setq eglot-confirm-server-initiated-edits t))
+#+end_src
+
**** Debug Adapter Protocol
:PROPERTIES:
:ID: d4f6107b-d1f1-4448-bfe3-ed207bf44a26
@@ -2822,7 +2915,21 @@ left to try and get the PATH down to, at most, MAX-LEN."
#+begin_src elisp
(use-package autodisass-java-bytecode)
+#+end_src
+
+#+begin_src elisp :tangle no
+(use-package eglot-java
+ :init
+ (defun kb/java-mode ()
+ "Configure java mode settings."
+ (subword-mode)
+ (setq-local tab-width 4)
+ (setq-local c-basic-offset 4)
+ (elgot-ensure))
+ :hook (java-mode . kb/java-mode))
+#+end_src
+#+begin_src elisp
;; Loosely borrowed from
;; https://github.com/jmibanez/jmi-dotemacs/blob/master/development.init.el#L139
;; Other changes from Torstein as well
@@ -4773,3 +4880,12 @@ _dR_: Disable repeat
#+end_src
+
+* Local Variables :noexport:
+:PROPERTIES:
+:ID: d02c9b30-8c22-4840-a50c-18cf7bb5506b
+:END:
+
+Local Variables:
+flycheck-disabled-checkers: '(languagetool vale)
+End:
diff --git a/config/guix/channels.scm b/config/guix/channels.scm
index c210ce61..77fd2e22 100644
--- a/config/guix/channels.scm
+++ b/config/guix/channels.scm
@@ -3,7 +3,7 @@
(url "https://git.savannah.gnu.org/git/guix.git")
(branch "master")
(commit
- "96ae718c516a289124a0b91ceeef78b20d187825")
+ "2f5607badc0b10de087cb079701ad24f28f3e40e")
(introduction
(make-channel-introduction
"9edb3f66fd807b096b48283debdcddccfea34bad"
@@ -14,7 +14,7 @@
(url "https://gitlab.com/nonguix/nonguix")
(branch "master")
(commit
- "dfc2b256ebe208605c7da1b35ab0bfd8304ae675")
+ "1aecd24155019cc524bca1c868729102c8b23f24")
(introduction
(make-channel-introduction
"ca0837cc70d5b4d3fce83b34c31b3378f60f4498"
@@ -25,10 +25,10 @@
(url "https://git.sr.ht/~kennyballou/guix-channel.git")
(branch "master")
(commit
- "e7c3fc8c5a3efdc22d54dad0bd2134df80c4b8cb")
+ "f5733aba33d749482d0f8939f25266fc5dbf681f")
(introduction
(make-channel-introduction
- "e7c3fc8c5a3efdc22d54dad0bd2134df80c4b8cb"
+ "f5733aba33d749482d0f8939f25266fc5dbf681f"
(openpgp-fingerprint
"10F4 14AB D526 0D0E 2372 8C08 FE55 890B 57AE DCE5"))))
(channel
@@ -36,7 +36,7 @@
(url "https://github.com/babariviere/guix-emacs.git")
(branch "master")
(commit
- "05f20038c7370094cb3c6ccdce1833ef98ce2544")
+ "97dbb86faf1139fdb0e53f51b5575328c1bc8a53")
(introduction
(make-channel-introduction
"8d45521e2aeac063fba926d375b1a202c5487275"