From 94d86169e9b1e61a682fca15705701601c4cf1a3 Mon Sep 17 00:00:00 2001 From: Jeff Kreeftmeijer Date: Sat, 27 Apr 2024 22:34:13 +0200 Subject: [PATCH] Check if eglot-managed-p exists in jk/maybe-format-buffer --- default.el | 4 +++- emacs-configuration.org | 4 +++- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/default.el b/default.el index 3b57348..0635fcd 100644 --- a/default.el +++ b/default.el @@ -160,7 +160,9 @@ end tell")) (direnv-mode 1)) (defun jk/maybe-format-buffer () - (when (eglot-managed-p) (eglot-format-buffer))) + (when (and (fboundp 'eglot-managed-p) + (glot-managed-p)) + (eglot-format-buffer))) (use-package eglot :config diff --git a/emacs-configuration.org b/emacs-configuration.org index b91e456..208df4e 100644 --- a/emacs-configuration.org +++ b/emacs-configuration.org @@ -1071,7 +1071,9 @@ To remedy this, add a function that formats only when Eglot is enabled. #+headers: :tangle default.el #+begin_src emacs-lisp (defun jk/maybe-format-buffer () - (when (eglot-managed-p) (eglot-format-buffer))) + (when (and (fboundp 'eglot-managed-p) + (eglot-managed-p)) + (eglot-format-buffer))) #+end_src #+RESULTS: