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: Tue, 28 Sep 2021 13:25:51 +0800

On Tue, Sep 28, 2021 at 11:22 AM Emanuel Berg via Users list for the
GNU Emacs text editor <help-gnu-emacs@gnu.org> wrote:
>
> Hongyi Zhao wrote:
>
> > Now I'm trying another test code snippet based on the idea
> > posted here [1]:
> >
> > (defun desperately-pyvenv-workon()
> >  "Traveling up the path, find a `.python-version' and activate the
> >  corresponding virtualenv."
> >  (interactive)
> >  (with-temp-buffer
> >     (unless (equal(getenv "HOME") default-directory)
> >     (while (not (file-exists-p ".python-version"))
> >           (cd "..")
> >     ))
> >     (when(file-exists-p ".python-version")
> >       (message(expand-file-name ".python-version")))))
> >
> > (desperately-pyvenv-workon)
> >
> > [1] https://emacs.stackexchange.com/a/7477
> >
> > But when I test the above code in scratch buffer, it seems to be stuck
> > in an endless loop and running there all the time.
>
> Eval this
>
>   (cd "..")
>
> enough times and it alternates between "/" and "/../"
> indefinitely, maybe that's what happens?
>
> (But I don't know why, or what it tries to say with "/../"
> which should be equivalent to "/" ... in the shell, cd from /
> does not lead to /../ but will stay in /)

They are really equivalent:

werner@X10DAi-00:/$ realpath -e /../
/
werner@X10DAi-00:/$ realpath -e /
/



reply via email to

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