branch: externals/xref-union
commit 1106671c6853dc795b021f4d95dfcfcf2ffa7f09
Author: Philip Kaludercic <[email protected]>
Commit: Philip Kaludercic <[email protected]>
Interpret 'xref-union-excluded-backends' as a predicate
---
xref-union.el | 11 +++++++----
1 file changed, 7 insertions(+), 4 deletions(-)
diff --git a/xref-union.el b/xref-union.el
index a8246672ad..08587089cf 100644
--- a/xref-union.el
+++ b/xref-union.el
@@ -43,9 +43,12 @@
"Combine multiple Xref backends."
:group 'xref)
-(defcustom xref-union-excluded-backends '()
- "List of Xref backend not combine."
- :type '(repeat sexp))
+(defcustom xref-union-excluded-backends #'ignore
+ "Predicate to exclude backends in `xref-union-mode'.
+The function is invoked with a single argument, the backend. If
+a non-nil value is returned, the backend will not be added to the
+union backend, otherwise it will be."
+ :type 'function)
;;;; Xref interface
@@ -113,7 +116,7 @@ PATTERN is specified in `xref-backend-apropos'."
'xref-backend-functions
(lambda (b)
(setq b (funcall b))
- (unless (and b (member b xref-union-excluded-backends))
+ (when (and b (funcall xref-union-excluded-backends b))
(push b backends))
nil))
(setq xref-union--current (cons 'union backends))