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
#+begin_src emacs-lisp
(with-eval-after-load 'emacs
(custom-set-variables
'(org-src-preserve-indentation t))
(with-eval-after-load 'org-src
(custom-set-variables
'(org-src-preserve-indentation t)))
(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))
@ -4191,7 +4192,9 @@ and listing [[lst:setting-python-shell-virtualenv-root]] to set
`(org-babel-python-command
,(concat (or (executable-find "ipython3")
(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)
(pcase choice
("python"
@ -4204,7 +4207,9 @@ and listing [[lst:setting-python-shell-virtualenv-root]] to set
`(python-shell-interpreter
,(or (executable-find "ipython3") (executable-find "ipython")))
'(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
#+caption[Manage =pyenv=]:
@ -4263,10 +4268,10 @@ Complete the result with \"system\"."
pyenv-versions
pyenv-virtualenvs))
(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-versions)))))
(message "Now `python-shell-virtualenv-root' equals \"%s\""
(message "Now `python-shell-virtualenv-root' equals %S"
python-shell-virtualenv-root)
(defun set-python-shell-virtualenv-root-to-pyenv-version ()
@ -4279,7 +4284,7 @@ Complete the result with \"system\"."
(unless (string= version-name version)
(setq python-shell-virtualenv-root (pyenv-full-path 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)))
(defun set-python-shell-virtualenv-root-to-pyenv-virtualenv ()
@ -4292,7 +4297,7 @@ Complete the result with \"system\"."
(unless (string= version-name version)
(setq python-shell-virtualenv-root (pyenv-full-path 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)))))
#+end_src