From da32e8e6f233a80d54d51964d21c4b46b000323b Mon Sep 17 00:00:00 2001 From: Henrik Lissner Date: Wed, 23 Apr 2025 05:37:27 -0400 Subject: [PATCH] fix(lsp): gate gcmh API call behind gcmh-mode check In case the mode is activated before gcmh is loaded (as is the case with session persistance libraries like desktop.el or persp{ective,-mode}.el). Close: #8372 --- modules/tools/lsp/config.el | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/modules/tools/lsp/config.el b/modules/tools/lsp/config.el index cc64003b6..84bb40d49 100644 --- a/modules/tools/lsp/config.el +++ b/modules/tools/lsp/config.el @@ -35,7 +35,8 @@ killing and opening many LSP/eglot-powered buffers.") ;; so we modify its variables rather than `gc-cons-threshold' ;; directly. (setq-default gcmh-high-cons-threshold (* 2 +lsp--default-gcmh-high-cons-threshold)) - (gcmh-set-high-threshold) + (when (bound-and-true-p gcmh-mode) + (gcmh-set-high-threshold)) (setq +lsp--optimization-init-p t))))