help-gnu-emacs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: let*: Wrong type argument: stringp, nil


From: Hongyi Zhao
Subject: Re: let*: Wrong type argument: stringp, nil
Date: Wed, 29 Sep 2021 15:37:52 +0800

On Wed, Sep 29, 2021 at 2:29 PM Emanuel Berg via Users list for the
GNU Emacs text editor <help-gnu-emacs@gnu.org> wrote:
> concat -> format
>
> ".python-version" hardcoded twice
>
> nth 0 -> car

Thanks again. Then, is there room for further improvement in the following code?

  (defun try/pyvenv-workon ()
    (when (buffer-file-name)
      (let* ((python-version ".python-version")
             (venvdir (locate-dominating-file (buffer-file-name)
python-version)))
        (when venvdir
          (pyvenv-workon
            (with-temp-buffer
              (insert-file-contents (format "%s%s" venvdir python-version))
              (car (split-string (buffer-string)))))))))

HZ



reply via email to

[Prev in Thread] Current Thread [Next in Thread]