unofficial mirror of help-gnu-emacs@gnu.org
 help / color / mirror / Atom feed
* let*: Wrong type argument: stringp, nil
@ 2021-09-24 14:52 Hongyi Zhao
  2021-09-24 14:57 ` Emanuel Berg via Users list for the GNU Emacs text editor
  2021-09-25 10:09 ` Stephen Berman
  0 siblings, 2 replies; 35+ messages in thread
From: Hongyi Zhao @ 2021-09-24 14:52 UTC (permalink / raw)
  To: help-gnu-emacs

According to the idea represented here [1], I wrote the following
function to activate the python virtual environment automatically
using the content of the ".python-version" file located in the project
directory of the current opened python file:

(defun pyvenv-autoload ()
    (require 'projectile)
    (let* ((pdir (file-name-directory buffer-file-name)) (pfile
(concat pdir ".python-version")))
      (if (file-exists-p pfile)
          (pyvenv-workon (with-temp-buffer
                           (insert-file-contents pfile)
                           (nth 0 (split-string (buffer-string))))))))
(add-hook 'python-mode-hook 'pyvenv-autoload)

It seems the corresponding python virtual environment can be activated
automatically when I open the python file in Emacs. But when I try to
evaluate the file, the following message will be triggered, and defeat
the evaluate operation:

let*: Wrong type argument: stringp, nil

[1] https://github.com/jorgenschaefer/pyvenv/issues/51#issuecomment-253902450

Any hints for fixing this problem?

Regards
-- 
Assoc. Prof. Hongyi Zhao <hongyi.zhao@gmail.com>
Theory and Simulation of Materials
Hebei Vocational University of Technology and Engineering
No. 473, Quannan West Street, Xindu District, Xingtai, Hebei province



^ permalink raw reply	[flat|nested] 35+ messages in thread

end of thread, other threads:[~2021-10-10 14:05 UTC | newest]

Thread overview: 35+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2021-09-24 14:52 let*: Wrong type argument: stringp, nil Hongyi Zhao
2021-09-24 14:57 ` Emanuel Berg via Users list for the GNU Emacs text editor
2021-09-25  1:29   ` Hongyi Zhao
2021-09-25 23:42     ` Emanuel Berg via Users list for the GNU Emacs text editor
2021-09-25 10:09 ` Stephen Berman
2021-09-25 10:45   ` Hongyi Zhao
2021-09-25 11:04     ` Stephen Berman
2021-09-25 13:49       ` Hongyi Zhao
2021-09-25 14:45         ` Stephen Berman
2021-09-25 15:03           ` Hongyi Zhao
2021-09-28  3:08             ` Hongyi Zhao
2021-09-28  3:21               ` Emanuel Berg via Users list for the GNU Emacs text editor
2021-09-28  3:24                 ` Emanuel Berg via Users list for the GNU Emacs text editor
2021-09-28  5:25                 ` Hongyi Zhao
2021-09-28  7:20                   ` Emanuel Berg via Users list for the GNU Emacs text editor
2021-09-28  8:02               ` Yuri Khan
2021-09-28  8:24                 ` Hongyi Zhao
2021-09-29  1:43                 ` Hongyi Zhao
2021-09-29  2:03                   ` Hongyi Zhao
2021-09-29  3:02                     ` Hongyi Zhao
2021-09-29  3:57                       ` Emanuel Berg via Users list for the GNU Emacs text editor
2021-09-29  6:15                         ` Hongyi Zhao
2021-09-29  6:29                           ` Emanuel Berg via Users list for the GNU Emacs text editor
2021-09-29  7:37                             ` Hongyi Zhao
2021-09-29  8:21                               ` Emanuel Berg via Users list for the GNU Emacs text editor
2021-09-29  9:02                                 ` Hongyi Zhao
2021-09-29  9:14                             ` Yuri Khan
2021-09-29 10:29                               ` Hongyi Zhao
2021-09-29 12:29                                 ` Yuri Khan
2021-09-29 12:49                                   ` Hongyi Zhao
2021-10-08  3:36                                     ` Hongyi Zhao
2021-10-10 14:05                                       ` Emanuel Berg via Users list for the GNU Emacs text editor
2021-09-30  3:38                               ` Emanuel Berg via Users list for the GNU Emacs text editor
2021-09-29  4:35                   ` Emanuel Berg via Users list for the GNU Emacs text editor
2021-09-29  6:17                     ` Hongyi Zhao

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).