From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: hw Newsgroups: gmane.emacs.help Subject: Re: =?UTF-8?Q?=E2=80=98=28vterm?= =?UTF-8?Q?_local=29=E2=80=99?= is a malformed function Date: Thu, 03 Aug 2023 21:25:22 +0200 Message-ID: References: <80031dc033efbe0ac0e8b337f33712d46970d221.camel@adminart.net> Mime-Version: 1.0 Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="29609"; mail-complaints-to="usenet@ciao.gmane.io" User-Agent: Evolution 3.48.4 (3.48.4-1.fc38) To: help-gnu-emacs@gnu.org Original-X-From: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane-mx.org@gnu.org Thu Aug 03 21:25:58 2023 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 1qRdxN-0007XT-SX for geh-help-gnu-emacs@m.gmane-mx.org; Thu, 03 Aug 2023 21:25:57 +0200 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1qRdwv-0007xJ-Tv; Thu, 03 Aug 2023 15:25:29 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1qRdwu-0007wh-2v for help-gnu-emacs@gnu.org; Thu, 03 Aug 2023 15:25:28 -0400 Original-Received: from mo4-p00-ob.smtp.rzone.de ([85.215.255.25]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1qRdwr-0000Bi-Lf for help-gnu-emacs@gnu.org; Thu, 03 Aug 2023 15:25:27 -0400 ARC-Seal: i=1; a=rsa-sha256; t=1691090723; cv=none; d=strato.com; s=strato-dkim-0002; b=ZuVJii1alBwpO0iXetUQRc9S8baTM2SKiuwMd6dTkhO8aDQ1nWLdQH7jcxQ8/S2RAM O87XxS+/4oqPpfGW9Wm0zfWHEYMGUTMG90xflwb9jHowy3hC9XXRBGJv8NdlBGjobh3C 8wZ8e2XsjZw0I+YwFLlb7C17HMDJGrmjtovWNjMbKqIcN6hcgLEFRPTFHbljOVdgwQpa bIUqgUo8DENW2rlLvlJVDVL57NauNcRdgqfk2qrLh6uK4FTn2bVOAYBe4jaQGJKoqUcc TpFgQCBGUNWN0js2CKWqxK94VPbcdbBQdLrp7yzc+KNJ5En5PynpW2kwSKHh/PZJli82 4SKg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; t=1691090723; s=strato-dkim-0002; d=strato.com; h=References:In-Reply-To:Date:To:From:Subject:Message-ID:Cc:Date:From: Subject:Sender; bh=OcaOr+rbF48FD4QdBt8/GXs/W2+2hzTTImk8pU5kimY=; b=Dqo4Vxv03weqfMwxapWX82QIh0zlT6KoBcHTVH/Rt3E75crNodF5avoz8weM0hVsVD 0LUUBrLAI3B7BYHPaM1Vi10PSRz3uJNJsY5/PJlKRVg+K8F2CIB8AA6h8rajPeVshykz rQ9t6eCbcOmMsTWK43yDcnQyNGncP3JiZfiJPubTsL3gO/Arem7tSTXMjF3FVnF37v0P 9WMej3jiozESHhT2dnQHJWeSiRx3AQ1RU6z8YyEjGv+QdXN51QQJJ8c+iWJRZq8qn2P1 Nm+U+WcsXv6GYtNkx7JdVHwQinEal7ccCBHKe7sWpX6A4mTu4lOtfqyBMQLa25erPwBy hHyw== ARC-Authentication-Results: i=1; strato.com; arc=none; dkim=none X-RZG-CLASS-ID: mo00 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; t=1691090723; s=strato-dkim-0002; d=adminart.net; h=References:In-Reply-To:Date:To:From:Subject:Message-ID:Cc:Date:From: Subject:Sender; bh=OcaOr+rbF48FD4QdBt8/GXs/W2+2hzTTImk8pU5kimY=; b=CuaVRZc0xw55TZDX0B7NGQmjb522qnzbJKNpHaS2njrVznUZIBzZ8JeBN7DpBpEVT3 cg1M9dYA9wEdzL16yVyISOoOOFmgO3pNf37ooE085hcfmDfOpg8yXhbzfL0dw0AHa3ov 7VA1qLrBcg4E1erGww0oWQdUVtJqVG2fAKFTka/McsOtwOikZvYGFJeMhkDrw3Whicpq /OcBm9I+5RxXrqumRlzS4aZfmTRlI6gb4zoTfOMZG6SIsIIvwh4Pe8B3e+Ajg8Rol73z adFRSzCWTJSUcKQtAxdBmmfeCdZDDQeZjIALV5B0mg/SnOhvuYN8E4Jmf33VWOfZW47J +q1w== DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; t=1691090723; s=strato-dkim-0003; d=adminart.net; h=References:In-Reply-To:Date:To:From:Subject:Message-ID:Cc:Date:From: Subject:Sender; bh=OcaOr+rbF48FD4QdBt8/GXs/W2+2hzTTImk8pU5kimY=; b=3vpc23oTgC15cM3bws7Z3l3Zkrb4kzQt323spfZLVkOmXU6MOu/1c5YOHonf8kz3Ys MJyTMBUHzKuxl5JJBqAQ== X-RZG-AUTH: ":O2kGeEG7b/pS1Ey9Rna9iAZFrfz26y6zbtmqiE/f0+UVPWzfkhbRoUzSCTTNnjIupuXQshKqSG7HgphPv/kc/dnEALe7QeCxHdwC4O777bO3UXSe" Original-Received: from [IPv6:2a09:8e40:1122:f400:8de5:5d5e:4d6c:96eb] by smtp.strato.de (RZmta 49.6.6 AUTH) with ESMTPSA id Qbac0bz73JPNiNV (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256 bits)) (Client did not present a certificate) for ; Thu, 3 Aug 2023 21:25:23 +0200 (CEST) In-Reply-To: Received-SPF: none client-ip=85.215.255.25; envelope-from=hw@adminart.net; helo=mo4-p00-ob.smtp.rzone.de 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, RCVD_IN_DNSWL_NONE=-0.0001, RCVD_IN_MSPIKE_H5=0.001, RCVD_IN_MSPIKE_WL=0.001, SPF_HELO_PASS=-0.001, SPF_NONE=0.001, T_SCC_BODY_TEXT_LINE=-0.01 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: help-gnu-emacs@gnu.org X-Mailman-Version: 2.1.29 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-bounces+geh-help-gnu-emacs=m.gmane-mx.org@gnu.org Xref: news.gmane.io gmane.emacs.help:144577 Archived-At: On Thu, 2023-08-03 at 23:45 +0700, Yuri Khan wrote: > On Thu, 3 Aug 2023 at 22:22, hw wrote: >=20 > > (defun my-connections (fqdns) > > "Set up a bunch of vterms, some with ssh connections." > > (if (not (get-buffer "local")) ((vterm "local") > ^ > You forgot a =E2=80=98progn=E2=80=99 here. In Lisp, you can=E2=80=99t jus= t put a bunch of > forms in parentheses and expect them all to execute sequentially like > they do in C. The first expression in parentheses is expected to be a > function, and the rest will be passed as its arguments. Ohh --- thank you! I think I never understood it that way, and it's been such a long time that I wrote anything in elisp that it's all difficult again because I forgot so many details. > > (vterm-send-string "cd") > > (vterm-send-return)) > > (message "local terminal seems already open")) >=20 > Alternatively, since you have just one form in the ELSE branch, you > could invert the test: >=20 > (if (get-buffer "local") > (message "local terminal seems already open") > (vterm "local") > (vterm-send-string "cd") > (vterm-send-return)) >=20 > The THEN branch allows a single form (which could be a =E2=80=98(progn = =E2=80=A6)=E2=80=99 if > you need many); the ELSE branch allows multiple forms. strange ... > > It works fine, though I'm getting a warning: > >=20 > >=20 > > =E2=9B=94 Warning (comp): connections.el:13:36: Warning: =E2=80=98(vter= m local)=E2=80=99 is a malformed function > >=20 > >=20 > > What's malformed about it? It doesn't consider (vterm pretty-name) as > > malformed ... "local" somehow gets unstringyfied? >=20 > (vterm pretty-name) is within a function body, which allows multiple form= s. Hm, this warning message seems quite misleading. I'm not sure what it could better say instead though. When I look at the desription of if, it says that it'll "do THEN, else do ELSE". To me, that means that it'll will *do* (like evaluate) what I say, like (vterm "local") --- not that it would treat THEN and ELSE sometimes as a parameter of if and sometimes not (i. e. not when "else"). What else is "do" supposed to mean here? What does it "do" with 5 in '(if (eq 1 1) 5 6)' other than returning 5 --- or 6 if 1 wasn't equal to 1? And if (vterm "local") can not be treated as a parameter of if, maybe the warning message could say exactly that. And perhaps the description of if could point out that "do THEN" means something else than "do ELSE". Both are called "expression", and they're not the same because one gets evaluted and the other doesn't (What actually happens to it?). 5 is a malformed function, or is it?