From cfea950e60961e45fc43a820d855eb6212856126 Mon Sep 17 00:00:00 2001 From: Henrik Lissner Date: Thu, 22 May 2025 21:15:19 +0200 Subject: [PATCH] fix(beancount): hangs when completion cache is empty --- modules/lang/beancount/autoload/advice.el | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/modules/lang/beancount/autoload/advice.el b/modules/lang/beancount/autoload/advice.el index 6be36edb5..58ed6cd2c 100644 --- a/modules/lang/beancount/autoload/advice.el +++ b/modules/lang/beancount/autoload/advice.el @@ -63,8 +63,9 @@ will theirs, recursively)." (with-current-buffer (let ((win (minibuffer-selected-window))) (if (window-live-p win) (window-buffer win) (current-buffer))) - (with-memoization (alist-get context +beancount--completion-cache) - (+beancount--collect-unique-recursive regexp n context)) + (unless (assq context +beancount--completion-cache) + (with-memoization (alist-get context +beancount--completion-cache) + (+beancount--collect-unique-recursive regexp n context))) (complete-with-action action (sort (hash-table-keys (alist-get context +beancount--completion-cache))