branch: externals/flymake-codespell commit 41d99c45983e53c3728d25f58e59ffbdbb66356a Author: Stefan Kangas <stefankan...@gmail.com> Commit: Stefan Kangas <stefankan...@gmail.com>
Add user option codespell-program-arguments --- README.org | 24 ++++++++++++++++++++++++ flymake-codespell.el | 15 ++++++++++++++- 2 files changed, 38 insertions(+), 1 deletion(-) diff --git a/README.org b/README.org index 0915bf80a1..076062ab4d 100644 --- a/README.org +++ b/README.org @@ -71,6 +71,30 @@ Here's a ~use-package~ declaration to unable flymake in the same modes: : (use-package flymake : :hook (prog-mode text-mode)) +* Customization + +To customize ~flymake-codespell~, type: + +: M-x customize-group RET flymake-codespell RET + +If you prefer adding customizations to your init file, try setting the +variables ~flymake-codespell-program~ and +~flymake-codespell-program-arguments~. These are their default +values: + +: (setq flymake-codespell-program "codespell") +: (setq flymake-codespell-program-arguments "") + +You could also use this ~use-package~ declaration: + +: (use-package flymake-codespell +: :ensure t +: :custom ((flymake-codespell-program "codespell") +: (flymake-codespell-program-arguments "")) +: :hook ((prog-mode . flymake-codespell-setup-backend) +: (text-mode . flymake-codespell-setup-backend))) + + * Alternatives Here are some alternatives to ~codespell-flymake~: diff --git a/flymake-codespell.el b/flymake-codespell.el index 792dcc16da..837260f18c 100644 --- a/flymake-codespell.el +++ b/flymake-codespell.el @@ -66,6 +66,14 @@ "Name of the codespell executable." :type 'string) +(defcustom codespell-program-arguments "" + "Arguments passed to the codespell executable. +The \"--disable-colors\" flag is passed unconditionally. + +See the Man page `codespell' or the output of running the command +\"codespell --help\" for more details." + :type 'string) + (defvar flymake-codespell--process nil "Currently running proceeed codespell process.") @@ -83,7 +91,12 @@ (make-process :name "flymake-codespell" :noquery t :connection-type 'pipe :buffer (generate-new-buffer " *flymake-codespell*") - :command `(,flymake-codespell-program "--disable-colors" "-") + :command `(,flymake-codespell-program + "--disable-colors" + ,@(when (and (stringp codespell-program-arguments) + (> (length codespell-program-arguments) 0)) + (list codespell-program-arguments)) + "-") :sentinel (lambda (proc _event) (when (memq (process-status proc) '(exit signal))