Skip to content

Commit

Permalink
Check if eglot-managed-p exists in jk/maybe-format-buffer
Browse files Browse the repository at this point in the history
  • Loading branch information
jeffkreeftmeijer committed Apr 27, 2024
1 parent 0fc7cf5 commit 94d8616
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 2 deletions.
4 changes: 3 additions & 1 deletion default.el
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
4 changes: 3 additions & 1 deletion emacs-configuration.org
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down

0 comments on commit 94d8616

Please sign in to comment.