branch: externals/gtags-mode
commit c60bb82307c4ebe55d042c2ad4a3d179ddde739d
Author: Jimmy Aguilar Mena <kratsbinov...@gmail.com>
Commit: Jimmy Aguilar Mena <kratsbinov...@gmail.com>

    Don't use with-memoization it is too new.
    
    Add a TODO for it.
---
 gtags-mode.el | 10 ++++++----
 1 file changed, 6 insertions(+), 4 deletions(-)

diff --git a/gtags-mode.el b/gtags-mode.el
index 9f77be60bc..267d046096 100644
--- a/gtags-mode.el
+++ b/gtags-mode.el
@@ -167,10 +167,12 @@ On success return a list of strings or nil if any error 
occurred."
   "Get the list of completions for PREFIX.
 When PREFIX is nil or empty; return the entire list of
 completions usually from the cache when possible."
-  (or (and (stringp prefix) (not (string-blank-p prefix))
-          (gtags-mode--exec-sync '("--ignore-case" "--completion") prefix))
-      (with-memoization (plist-get gtags-mode--plist :cache)
-       (gtags-mode--exec-sync '("--completion")))))
+  (cond ;; TODO: use with-memoization in the future it will be on emacs 29.1
+   ((and (stringp prefix) (not (string-blank-p prefix))
+        (gtags-mode--exec-sync '("--ignore-case" "--completion") prefix)))
+   ((plist-get gtags-mode--plist :cache))
+   ((plist-put gtags-mode--plist :cache (gtags-mode--exec-sync 
'("--completion")))
+    (plist-get gtags-mode--plist :cache))))
 
 (defun gtags-mode--buffers-in-root (plist)
   "Return a list of buffers which variable `buffer-file-name' is inside PLIST."

Reply via email to