branch: externals/cape
commit 9476f6c38318bd762e749b0a33bdd4bf2073790c
Author: Daniel Mendler <m...@daniel-mendler.de>
Commit: Daniel Mendler <m...@daniel-mendler.de>

    cape-dabbrev-check-other-buffers: More defensive function check (Fix #127)
---
 cape.el | 13 ++++++-------
 1 file changed, 6 insertions(+), 7 deletions(-)

diff --git a/cape.el b/cape.el
index cfdbfc8589..f202e33514 100644
--- a/cape.el
+++ b/cape.el
@@ -567,14 +567,13 @@ If INTERACTIVE is nil the function acts like a Capf."
 (defun cape--dabbrev-list (input)
   "Find all Dabbrev expansions for INPUT."
   (cape--silent
-    (dlet ((dabbrev-check-other-buffers
-            (and cape-dabbrev-check-other-buffers
-                 (not (functionp cape-dabbrev-check-other-buffers))))
-           (dabbrev-check-all-buffers
-            (eq cape-dabbrev-check-other-buffers t))
+    (dlet ((fun-p (and (not (memq cape-dabbrev-check-other-buffers '(nil t 
some)))
+                       (functionp cape-dabbrev-check-other-buffers)))
+           (dabbrev-check-other-buffers
+            (and cape-dabbrev-check-other-buffers (not fun-p)))
+           (dabbrev-check-all-buffers (eq cape-dabbrev-check-other-buffers t))
            (dabbrev-search-these-buffers-only
-            (and (functionp cape-dabbrev-check-other-buffers)
-                 (funcall cape-dabbrev-check-other-buffers))))
+            (and fun-p (funcall cape-dabbrev-check-other-buffers))))
       (dabbrev--reset-global-variables)
       (cons
        (apply-partially #'string-prefix-p input)

Reply via email to