emacs-elpa-diffs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[elpa] externals/flymake-proselint c5eaeee1a7 4/6: Add a user option for


From: ELPA Syncer
Subject: [elpa] externals/flymake-proselint c5eaeee1a7 4/6: Add a user option for the Proselint executable name
Date: Sat, 17 Sep 2022 16:57:42 -0400 (EDT)

branch: externals/flymake-proselint
commit c5eaeee1a712231610f0c2e677cf299ed691d847
Author: Philip Kaludercic <philipk@posteo.net>
Commit: Manuel Uberti <manuel.uberti@inventati.org>

    Add a user option for the Proselint executable name
    
    * flymake-proselint.el (flymake-proselint-executable): Add new option.
    (flymake-proselint--options): Use new option.
    (flymake-proselint-generate-configuration): Use new option.
    (flymake-proselint-backend): Use new option.
---
 flymake-proselint.el | 14 +++++++++-----
 1 file changed, 9 insertions(+), 5 deletions(-)

diff --git a/flymake-proselint.el b/flymake-proselint.el
index 2b2b2c965d..415c7c8195 100644
--- a/flymake-proselint.el
+++ b/flymake-proselint.el
@@ -41,6 +41,10 @@
   :prefix "flymake-proselint-"
   :group 'flymake)
 
+(defcustom flymake-proselint-executable "proselint"
+  "Name of the Proselint executable."
+  :type 'string)
+
 (defcustom flymake-proselint-message-format
   "%m%r"
   "A format string to generate diagnostic messages.
@@ -55,7 +59,7 @@ The following %-sequences are replaced:
   ;; Regenerate using:
   ;;
   ;; (with-temp-buffer
-  ;;   (call-process "proselint" nil t nil "--dump-config")
+  ;;   (call-process flymake-proselint-executable nil t nil "--dump-config")
   ;;   (goto-char (point-min))
   ;;   (let ((config (json-parse-buffer :object-type 'alist)))
   ;;     (mapcar #'car (alist-get 'checks config))))
@@ -224,7 +228,7 @@ will be nil."
                    flymake-proselint-config-directory)))
       (unless (file-exists-p output)
         (let* ((config (with-temp-buffer
-                         (call-process "proselint" nil t nil "--dump-config")
+                         (call-process flymake-proselint-executable nil t nil 
"--dump-config")
                          (goto-char (point-min))
                          (json-parse-buffer :object-type 'alist)))
                (checks (alist-get 'checks config)))
@@ -316,7 +320,7 @@ A successfully parsed message is passed onto the function
   "Flymake backend for Proselint.
 REPORT-FN is the flymake reporter function.  See the Info
 node (flymake) Backend functions for more details."
-  (unless (executable-find "proselint")
+  (unless (executable-find flymake-proselint-executable)
     (user-error "Executable proselint not found on PATH"))
 
   (when (process-live-p flymake-proselint--flymake-proc)
@@ -327,8 +331,8 @@ node (flymake) Backend functions for more details."
                :buffer (generate-new-buffer " *proselint-flymake*")
                :command
                (if-let* ((conf (flymake-proselint-generate-configuration)))
-                   (list "proselint" "--config" conf "--json" "-")
-                 '("proselint" "--json" "-"))
+                   (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)



reply via email to

[Prev in Thread] Current Thread [Next in Thread]