@@ -73,14 +73,37 @@ Based on `jinx-mode' if available. Falls back to the built-in
73
73
:demand
74
74
:config
75
75
(eglot-ltex-enable-handling-client-commands)
76
+ (defvar +ltex-ls-plus-path (expand-file-name " ltex-ls-plus/" minemacs-local-dir))
77
+ (defvar +ltex-ls-plus-bin (expand-file-name " bin/ltex-ls-plus" +ltex-ls-plus-path))
78
+ (defun +ltex-ls-plus-download (pre)
79
+ " Download the latest release of \" ltex-ls-plus\" .
80
+
81
+ When PRE is non-nil, allow downloading the latest prerelease."
82
+ (interactive " P" )
83
+ (if (zerop
84
+ (when-let* ((tarball (+github-download-release
85
+ " ltex-plus/ltex-ls-plus"
86
+ (concat " -" (cond ((+emacs-options-p 'os/linux ) " linux" )
87
+ ((+emacs-options-p 'os/mac ) " mac" )
88
+ ((+emacs-options-p 'os/win ) " windows" ))
89
+ " -" (cond ((+emacs-options-p 'arch/x86_64 ) " x64" )
90
+ ((+emacs-options-p 'arch/x86_64 ) " aarch64" )))
91
+ nil :prerelease pre)))
92
+ (when (file-directory-p +ltex-ls-plus-path)
93
+ (delete-directory +ltex-ls-plus-path t ))
94
+ (mkdir +ltex-ls-plus-path)
95
+ (shell-command (format " tar -C %S -xf %S --strip-components=2 " +ltex-ls-plus-path tarball)
96
+ (get-buffer-create " *ltex-ls-plus*" ))))
97
+ (message " Downloaded successfully! " )
98
+ (user-error " A problem occured when trying to download ltex-ls-plus" )))
76
99
(+eglot-register
77
100
'(text-mode org-mode markdown-mode markdown-ts-mode rst-mode git-commit-mode)
78
- '( " ltex-ls" " --server-type=TcpSocket" " --port" :autoport ))
101
+ `( , + ltex-ls-plus-bin " --server-type=TcpSocket" " --port" :autoport ))
79
102
(+eglot-register
80
103
'(tex-mode context-mode texinfo-mode bibtex-mode)
81
104
" digestif"
82
105
" texlab"
83
- '( " ltex-ls" " --server-type=TcpSocket" " --port" :autoport )))
106
+ `( , + ltex-ls-plus-bin " --server-type=TcpSocket" " --port" :autoport )))
84
107
85
108
86
109
(provide 'me-natural-langs )
0 commit comments