branch: externals/corfu
commit ba858df5e38fa904a32de768ff048efd93dde7da
Author: Daniel Mendler <[email protected]>
Commit: Daniel Mendler <[email protected]>
Guard against dabbrev error if there are no matches
---
corfu.el | 7 ++++++-
1 file changed, 6 insertions(+), 1 deletion(-)
diff --git a/corfu.el b/corfu.el
index 59f9cd4..464cae1 100644
--- a/corfu.el
+++ b/corfu.el
@@ -285,7 +285,12 @@ If `line-spacing/=nil' or in text-mode, the background
color is used instead.")
(lambda (pattern cands)
(setq hl (lambda (x) (orderless-highlight-matches pattern x)))
cands)))
- (cons (apply #'completion-all-completions args) hl)))
+ ;; XXX dabbrev throws error "No dynamic expansion ... found".
+ ;; TODO report as bug? Are completion tables supposed to throw errors?
+ (cons (condition-case nil
+ (apply #'completion-all-completions args)
+ (t nil))
+ hl)))
(defun corfu--sort-predicate (x y)
"Sorting predicate which compares X and Y."