Open atanasj opened 5 months ago
I installed the flymake-proselint package and the following configuration seems to be working for me:
(defun org-msg-flymake-proselint-backend (report-fn &rest _args)
"Flymake backend for Proselint.
REPORT-FN is the flymake reporter function. See the Info
node (flymake) Backend functions for more details."
(unless (executable-find flymake-proselint-executable)
(user-error "Executable proselint not found on PATH"))
(when (process-live-p flymake-proselint--flymake-proc)
(kill-process flymake-proselint--flymake-proc))
(let ((proc (make-process
:name "proselint-flymake" :noquery t :connection-type 'pipe
:buffer (generate-new-buffer " *proselint-flymake*")
:command
(if-let* ((conf (flymake-proselint-generate-configuration)))
(list flymake-proselint-executable "--config" conf "--json" "-")
(list flymake-proselint-executable "--json" "-"))
:sentinel #'flymake-proselint-sentinel)))
(process-put proc 'source (current-buffer))
(process-put proc 'report-fn report-fn)
(setq flymake-proselint--flymake-proc proc)
(save-restriction
(widen)
(process-send-region proc (point-min) (org-msg-end))
(process-send-eof proc))))
(defun org-msg-flymake-proselint-setup ()
"Enable Flymake backend proselint."
(add-hook 'flymake-diagnostic-functions #'org-msg-flymake-proselint-backend nil t))
(add-hook 'org-msg-edit-mode-hook #'flymake-mode)
(add-hook 'org-msg-edit-mode-hook #'org-msg-flymake-proselint-setup)
I want to use
proselint
as a grammar checker inorg-msg-edit-mode
. I can get it working by runningconsult-flycheck
inmessage-mode
, but not when usingorg-msg
.Some advice about how to get this working would be truly appreciated. Can someone please help / share their experience to help me get this working?