reddit / emacs

Desktop+ with eglot

junglee33 · 2022-06-13 15:21
hi all, I just started playing around with [desktop+](https://github.com/ffevotte/desktop-plus), and my configuration is pretty minimal: (use-package desktop+ :init ;; ---------------------------------------------------------------------- ;; where are we saving all desktops ? (setq desktop+-base-dir (expand-file-name "desktops" user-emacs-directory)) (make-directory desktop+-base-dir 'parents) :commands (desktop+-create desktop+-load) ) i am using [eglot](https://github.com/joaotavora/eglot) + [clangd](https://clangd.llvm.org/) for c/c++ code, and that configuration is also pretty minimal: (use-package eglot :defer :config ;; --------------------------------------------------------------------- ;; disable annoying, _distracting_, over-the-top features that serve ;; no useful purpose at all (imnsho) (setq eglot-ignored-server-capabilities '(:documentHighlightProvider ; highlight symbols automatically :documentSymbolProvider ; list symbols in a buffer :hoverProvider ; documentation on hover :signatureHelpProvider ; function-signature help )) :hook (c-mode . eglot-ensure) (c++-mode . eglot-ensure) ) Desktop state is saved and restored using desktop+-create and desktop+-load respectively. While restoring the desktop state, i get the following message: cl-no-applicable-method: No applicable method: eglot--managed-buffers, nil I looked at the saved desktop+ file, and i see the following (desktop-create-buffer 208 "/home/junglee33/source-code/c++/quick-hacks/cube_face.cpp" "cube_face.cpp" 'c++-mode '(font-lock-mode git-gutter-mode eldoc-mode flymake-mode eglot--managed-mode subword-mode abbrev-mode clang-format+-mode highlight-parentheses-mode wucuo-mode hs-minor-mode) 1769 '(1 nil) nil nil '((tab-width . 8) (indent-tabs-mode) (buffer-display-time 25255 21092 517581 161000) (buffer-file-coding-system . utf-8-unix) (fill-column . 80)) '((mark-ring nil))) (desktop-create-buffer 208 "/home/junglee33/source-code/c++/quick-hacks/span-line.cpp" "span-line.cpp" 'c++-mode '(eldoc-mode flymake-mode eglot--managed-mode font-lock-mode git-gutter-mode subword-mode abbrev-mode clang-format+-mode highlight-parentheses-mode wucuo-mode hs-minor-mode) 49 '(nil nil) nil nil '((tab-width . 8) (indent-tabs-mode) (buffer-display-time 25255 21092 517580 719000) (buffer-file-coding-system . utf-8-unix) (fill-column . 80)) '((mark-ring nil))) How do i fix this ? -- thank you !
vidbina · 2022-06-14 05:55
My first naive guess would be to drop the `:defer` keyword such that all eglot bindings are in place before the desktop+ calls fire away attempting to set things up. TBH am realizing that I need a deeper-dive into how autoloading works so consider this a very "uninformed guess" 🤷🏿‍♂️ and I'll go conduct some reading into elisp fundamentals meanwhile.
junglee33 · 2022-06-14 06:27
thanks for the suggestion u/vidbina. i tried that, and unfortunately that does not work, as in, i still see the same message as before.
redblobgames · 2022-06-15 15:39
I am using regular desktop.el not desktop+, and I get something similar with c++ files: Error running timer ‘my/desktop-mode’: (cl-no-applicable-method eglot--managed-buffers nil) (ignore the timer part) I've been ignoring it so far but your message makes me want to investigate…
redblobgames · 2022-06-23 03:39
Ok, I'm unable to figure this out. :-(
redblobgames · 2022-06-26 22:32
Ok, here's something to try: (add-to-list 'desktop-minor-mode-table (list 'eglot--managed-mode nil)) That's for regular desktop.el but it may work with desktop+ also.