diff --git a/emacs/init.org b/emacs/init.org index 5d9ac0a..cae75b9 100755 --- a/emacs/init.org +++ b/emacs/init.org @@ -4952,7 +4952,9 @@ A package that bundles together common code beautifying tools for many languages (with-eval-after-load 'lsp-mode (add-hook 'format-all-after-format-functions (lambda (formatter status) - (when (and (eq status :reformatted) python-mode lsp-mode) + (when (and (eq status :reformatted) + (equal major-mode 'python-mode) + (boundp 'lsp-mode) lsp-mode) (lsp-restart-workspace)))))) #+END_SRC