Improve "lst:setup-oglot" in case `oglot' is not installed

This commit is contained in:
Gerard Vermeulen 2024-06-17 08:52:24 +02:00
parent 83c2a353f6
commit 19cd9ad9e0

View File

@ -3943,11 +3943,10 @@ configuration:
#+caption: Setup ~oglot~ for ~python-mode~.
#+name: lst:setup-oglot
#+begin_src emacs-lisp -n :results silent
;; GAV: Is always OK after the second evaluation of the form below.
(if (and (package-installed-p 'oglot)
(require 'oglot nil 'noerror))
(setopt oglot-maybe-ensure-modes '(python-mode))
(unless (package-installed-p 'oglot)
(package-vc-install '(oglot :url "https://github.com/gav451/oglot.git")))
(when (require 'oglot nil 'noerror)
(setopt oglot-maybe-ensure-modes '(python-mode)))
#+end_src
#+caption[Start =eglot= in case of a proper =dir-local-variables-alist=]: