From 314bdeed0181380bf1be20314c75a2bade8c4739 Mon Sep 17 00:00:00 2001 From: Philip Kaludercic Date: Fri, 29 Sep 2023 12:00:54 +0200 Subject: [PATCH] Check if tuareg-opam--flymake-proc-allowed-file-name-masks is bound * tuareg-opam.el (flymake-proc): Also try to include flymake-proc, where the variable is defined in. * tuareg-opam.el (tuareg-opam-mode): Only modify the variable, if it is non-void. --- tuareg-opam.el | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/tuareg-opam.el b/tuareg-opam.el index 5211624..d2a17bc 100644 --- a/tuareg-opam.el +++ b/tuareg-opam.el @@ -222,6 +222,7 @@ See `prettify-symbols-alist' for more information.") ;;;; Linting (require 'flymake) +(require 'flymake-proc nil :noerror) (defalias 'tuareg-opam--flymake-proc-init-create-temp-buffer-copy (if (fboundp 'flymake-proc-init-create-temp-buffer-copy) @@ -317,8 +318,9 @@ characters \\([0-9]+\\)-\\([0-9]+\\): +\\([^\n]*\\)$" (defvar tuareg-opam--flymake-proc-allowed-file-name-masks) (defvar tuareg-opam--flymake-proc-err-line-patterns) - (push tuareg-opam--allowed-file-name-masks - tuareg-opam--flymake-proc-allowed-file-name-masks) + (when (boundp 'tuareg-opam--flymake-proc-allowed-file-name-masks) + (push tuareg-opam--allowed-file-name-masks + tuareg-opam--flymake-proc-allowed-file-name-masks)) (setq-local tuareg-opam--flymake-proc-err-line-patterns tuareg-opam--err-line-patterns) (when (and tuareg-opam-flymake buffer-file-name)