From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Hongyi Zhao Newsgroups: gmane.emacs.help Subject: Re: let*: Wrong type argument: stringp, nil Date: Wed, 29 Sep 2021 18:29:47 +0800 Message-ID: References: <87lf3lrmos.fsf@gmx.net> <87ee9csyp0.fsf@gmx.net> <87a6k0sogz.fsf@gmx.net> <87lf3gqbi7.fsf@zoho.eu> <87r1d7q4i1.fsf@zoho.eu> Mime-Version: 1.0 Content-Type: text/plain; charset="UTF-8" Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="3728"; mail-complaints-to="usenet@ciao.gmane.io" Cc: help-gnu-emacs , Emanuel Berg To: Yuri Khan Original-X-From: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane-mx.org@gnu.org Wed Sep 29 12:31:53 2021 Return-path: Envelope-to: geh-help-gnu-emacs@m.gmane-mx.org Original-Received: from lists.gnu.org ([209.51.188.17]) by ciao.gmane.io with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1mVWsT-0000n6-Bw for geh-help-gnu-emacs@m.gmane-mx.org; Wed, 29 Sep 2021 12:31:53 +0200 Original-Received: from localhost ([::1]:41370 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1mVWsR-0005jM-NP for geh-help-gnu-emacs@m.gmane-mx.org; Wed, 29 Sep 2021 06:31:51 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:57036) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1mVWqg-0005ix-TH for help-gnu-emacs@gnu.org; Wed, 29 Sep 2021 06:30:02 -0400 Original-Received: from mail-vs1-xe2e.google.com ([2607:f8b0:4864:20::e2e]:46731) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1mVWqd-0006XI-N8 for help-gnu-emacs@gnu.org; Wed, 29 Sep 2021 06:30:02 -0400 Original-Received: by mail-vs1-xe2e.google.com with SMTP id i30so2245340vsj.13 for ; Wed, 29 Sep 2021 03:29:59 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=0Afl+VywLWB6WifhoqqVjjNimQhKgJbHZNTXzBidzmU=; b=FRUNH7cT5xKZMXuWn48jw6Y0MleKPz1DsHBEWoW+8AR1aqNNzi4MTK47qLQJH/fldM shdbnVCuxle2wu9Jrj6zr/6BIfy7H07rMUrC0BPpsVRJ6tQR/UYB56L+zzpCF0jr2HC6 kXoQBFJELp4eKCZq6ENYIuRPfRrCkQ/Cb1I2toocVHOzde5FU0BD9b4s7zwOKbwRop+j cl23fK0gW5tAfFClGoouv4k1gEj6wOOvvP/alwIreHGLVkRNqW/Kz+bcVGUg26hv+XYd oCSLob7cEf2W6LiK8XsQzj9rkWdc3Uf1mCJgvWeCm7frqubeGNU5bG32MXr5ycgx/7u9 t5aQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=0Afl+VywLWB6WifhoqqVjjNimQhKgJbHZNTXzBidzmU=; b=DJaSrN0nLlQxIU3LAjQ2fWwNvhPC0v5Lk6vI4XC8SoSxT36FaE2kL/KRU6WcIAHR4h fVtpRiE/wAywbkmDaNmuXnK08JA4eABE1sUqEkSKXZmRbJ2NxeBps+ZoDzepxrxC0ziA P8PPHgpur0ukExTqR+WorC4kvHGrkWRsv/9jmti1LX6R3707tnWmBz8uz+6BDxCdXmcE UKHHzvJYw26c2wElD/pDrqwnxpTIgQM6dnSxfNp3SJ3LXXFLT9GUYKTzPb+f9V17j29E BoG1lj0hE3nqJS4Vv3pholdiXs8HlwcOOh2cOJpAZdkgmpefweihWJZ9wpuZbcDYJp/m tK7g== X-Gm-Message-State: AOAM530Ku1sFODlXI+9Iwzq7XTxHn1zTDi7KfsxsjpmyiiSYn9GA9Umn cvRxThtEZHZOFZesQiwDy9nptI0VrTvSJSCaJAg= X-Google-Smtp-Source: ABdhPJwCxhM0RQJwLpHswYuch/kKteigaMs5qV69hcJQAgEzgbhkSRrfPYdC9UnK1DuZWF7hYDTYIh1Y+wQORV5qzLM= X-Received: by 2002:a67:3157:: with SMTP id x84mr9516507vsx.51.1632911398666; Wed, 29 Sep 2021 03:29:58 -0700 (PDT) In-Reply-To: Received-SPF: pass client-ip=2607:f8b0:4864:20::e2e; envelope-from=hongyi.zhao@gmail.com; helo=mail-vs1-xe2e.google.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, FREEMAIL_FROM=0.001, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: help-gnu-emacs@gnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: Users list for the GNU Emacs text editor List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane-mx.org@gnu.org Original-Sender: "help-gnu-emacs" Xref: news.gmane.io gmane.emacs.help:133385 Archived-At: On Wed, Sep 29, 2021 at 5:14 PM Yuri Khan wrote: > > On Wed, 29 Sept 2021 at 13:29, Emanuel Berg via Users list for the GNU > Emacs text editor wrote: > > > (let ((file (concat (locate-dominating-file (buffer-file-name) > > > ".python-version") ".python-version"))) > > > concat -> format > > Why use either, when you have a perfectly good expand-file-name? Good advice, so change to the following: (defun try/pyvenv-workon () (when (buffer-file-name) (let* ((python-version ".python-version") (project-dir (locate-dominating-file (buffer-file-name) python-version))) (when project-dir (pyvenv-workon (with-temp-buffer (insert-file-contents (expand-file-name python-version)) (car (split-string (buffer-string))))))))) HZ