I am trying to start dap-mode in my golang project. I already have lsp-mode config set.
for example:
(use-package lsp-mode
:hook
((go-mode . lsp-deferred)
(rust-mode . lsp-deferred)
)
)
What I want is let dap-mode in use-package block, but only load the configs when it is go-mode.
I have wrote
(use-package dap-mode
:if (member major-mode '(go-mode))
:custom
(dap-auto-configure-mode t)
(dap-auto-configure-features
'(sessions locals breakpoints expressions tooltip))
:config
(require 'dap-go)
)
Then I have the question that, I am using emacs server and client. So if I first in my golang project, dap-mode has loaded, then when I in my rust project, even I don't want dap-mode, it is still loaded.
So actually it is some question of emacs server-client and use-package mode. How can I make the mode in use-package load in special type mode and unload in other modes without restart emacs server?