Fix typo and improve messages, but I still get "Error setting nil"

This commit is contained in:
Gerard Vermeulen 2022-11-17 03:27:07 +01:00
parent 1f4d6ad909
commit 52f4d7d333

View File

@ -2141,8 +2141,9 @@ When called twice, replace the previously inserted \\(\\) by one $."
#+name: lst:customize-org-src #+name: lst:customize-org-src
#+begin_src emacs-lisp #+begin_src emacs-lisp
(with-eval-after-load 'emacs (with-eval-after-load 'emacs
(with-eval-after-load 'org-src
(custom-set-variables (custom-set-variables
'(org-src-preserve-indentation t)) '(org-src-preserve-indentation t)))
(declare-function org-babel-map-src-blocks "ext:ob-core" (file &rest body)) (declare-function org-babel-map-src-blocks "ext:ob-core" (file &rest body))
(declare-function org-do-remove-indentation "ext:org-macs" (n skip-fl)) (declare-function org-do-remove-indentation "ext:org-macs" (n skip-fl))
@ -4191,7 +4192,9 @@ and listing [[lst:setting-python-shell-virtualenv-root]] to set
`(org-babel-python-command `(org-babel-python-command
,(concat (or (executable-find "ipython3") ,(concat (or (executable-find "ipython3")
(executable-find "ipython")) (executable-find "ipython"))
" --simple-prompt --HistoryAccessor.enabled=False")))))) " --simple-prompt --HistoryAccessor.enabled=False")))))
(message "Now `org-babel-python-command' equals %S"
org-babel-python-command))
(when (boundp 'python-shell-interpreter) (when (boundp 'python-shell-interpreter)
(pcase choice (pcase choice
("python" ("python"
@ -4204,7 +4207,9 @@ and listing [[lst:setting-python-shell-virtualenv-root]] to set
`(python-shell-interpreter `(python-shell-interpreter
,(or (executable-find "ipython3") (executable-find "ipython"))) ,(or (executable-find "ipython3") (executable-find "ipython")))
'(python-shell-interpreter-args '(python-shell-interpreter-args
"--simple-prompt --HistoryAccessor.enabled=False"))))))) "--simple-prompt --HistoryAccessor.enabled=False"))))
(message "Now `python-shell-interpreter' equals %S"
python-shell-interpreter))))
#+end_src #+end_src
#+caption[Manage =pyenv=]: #+caption[Manage =pyenv=]:
@ -4263,10 +4268,10 @@ Complete the result with \"system\"."
pyenv-versions pyenv-versions
pyenv-virtualenvs)) pyenv-virtualenvs))
(setq python-shell-virtualenv-root (setq python-shell-virtualenv-root
(pyenv-full-path (or (car `(,(pyenv-version-name))) (pyenv-full-path (or (pyenv-version-name)
(car (pyenv-virtualenvs)) (car (pyenv-virtualenvs))
(car (pyenv-versions))))) (car (pyenv-versions)))))
(message "Now `python-shell-virtualenv-root' equals \"%s\"" (message "Now `python-shell-virtualenv-root' equals %S"
python-shell-virtualenv-root) python-shell-virtualenv-root)
(defun set-python-shell-virtualenv-root-to-pyenv-version () (defun set-python-shell-virtualenv-root-to-pyenv-version ()
@ -4279,7 +4284,7 @@ Complete the result with \"system\"."
(unless (string= version-name version) (unless (string= version-name version)
(setq python-shell-virtualenv-root (pyenv-full-path version)) (setq python-shell-virtualenv-root (pyenv-full-path version))
(setenv "PYENV_VERSION" version)) (setenv "PYENV_VERSION" version))
(message "Now `python-shell-virtualenv-root' equals \"%s\"" (message "Now `python-shell-virtualenv-root' equals %S"
python-shell-virtualenv-root))) python-shell-virtualenv-root)))
(defun set-python-shell-virtualenv-root-to-pyenv-virtualenv () (defun set-python-shell-virtualenv-root-to-pyenv-virtualenv ()
@ -4292,7 +4297,7 @@ Complete the result with \"system\"."
(unless (string= version-name version) (unless (string= version-name version)
(setq python-shell-virtualenv-root (pyenv-full-path version)) (setq python-shell-virtualenv-root (pyenv-full-path version))
(setenv "PYENV_VERSION" version)) (setenv "PYENV_VERSION" version))
(message "Now `python-shell-virtualenv-root' equals \"%s\"" (message "Now `python-shell-virtualenv-root' equals %S"
python-shell-virtualenv-root))))) python-shell-virtualenv-root)))))
#+end_src #+end_src