emacs-elpa-diffs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[elpa] externals/corfu ba858df 08/11: Guard against dabbrev error if the


From: Protesilaos Stavrou
Subject: [elpa] externals/corfu ba858df 08/11: Guard against dabbrev error if there are no matches
Date: Tue, 27 Apr 2021 11:39:07 -0400 (EDT)

branch: externals/corfu
commit ba858df5e38fa904a32de768ff048efd93dde7da
Author: Daniel Mendler <mail@daniel-mendler.de>
Commit: Daniel Mendler <mail@daniel-mendler.de>

    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."



reply via email to

[Prev in Thread] Current Thread [Next in Thread]