From e06c92a22a5fe0baf6ade5bdc1e1a4dd9620dc03 Mon Sep 17 00:00:00 2001 From: Jim Myhrberg Date: Fri, 15 Dec 2023 15:01:12 +0000 Subject: [PATCH] fix(flx-rs): avoid errors when flx-rs package is not installed This is based on how the other wrapper score functions work, by requiring the relevant package, and wrapping the call in a `fboundp` check. Issue was introduced in PR: https://github.com/jojojames/fussy/pull/36 --- fussy.el | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/fussy.el b/fussy.el index cb2005b..336bc2d 100644 --- a/fussy.el +++ b/fussy.el @@ -1120,7 +1120,9 @@ result: LIST ^a" (defun fussy-flx-rs-score (str query &rest args) "Score STR for QUERY with ARGS using `flx-rs-score'." - (flx-rs-score (funcall fussy-remove-bad-char-fn str) query args)) + (require 'flx-rs) + (when (fboundp 'flx-rs-score) + (flx-rs-score (funcall fussy-remove-bad-char-fn str) query args))) (defun fussy-fuz-score (str query &rest _args) "Score STR for QUERY using `fuz'.