Skip to content

Commit

Permalink
fix(flx-rs): avoid errors when flx-rs package is not installed
Browse files Browse the repository at this point in the history
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: #36
  • Loading branch information
jimeh authored and jojojames committed Dec 15, 2023
1 parent 36920ea commit e06c92a
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion fussy.el
Original file line number Diff line number Diff line change
Expand Up @@ -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'.
Expand Down

0 comments on commit e06c92a

Please sign in to comment.