diff --git a/lisp/external-completion.el b/lisp/external-completion.el index a1aa7ec9cb6..5fd29f801fe 100644 --- a/lisp/external-completion.el +++ b/lisp/external-completion.el @@ -5,6 +5,7 @@ ;; Version: 0.1 ;; Author: Stefan Monnier ;; Maintainer: João Távora +;; Package-Requires: ((emacs "26.1")) ;; Keywords: ;; This is a GNU ELPA :core package. Avoid functionality that is not @@ -117,10 +118,11 @@ EXPANDED-PATTERN." completion-category-defaults))) (let ((cache (make-hash-table :test #'equal))) (cl-flet ((lookup-internal (string point) - (let ((key (cons string point))) - (if (hash-table-contains-p key cache) - (gethash key cache) - (puthash key (funcall lookup string point) cache))))) + (let* ((key (cons string point)) + (probe (gethash key cache 'external--notfound))) + (if (eq probe 'external--notfound) + (puthash key (funcall lookup string point) cache) + probe)))) (lambda (string pred action) (pcase action (`metadata