From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Yuri Khan Newsgroups: gmane.emacs.help Subject: =?UTF-8?B?UmU6IOKAmCh2dGVybSBsb2NhbCnigJkgaXMgYSBtYWxmb3JtZWQgZnVuY3Rpb24=?= Date: Thu, 3 Aug 2023 23:45:09 +0700 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="14384"; mail-complaints-to="usenet@ciao.gmane.io" Cc: help-gnu-emacs@gnu.org To: hw Original-X-From: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane-mx.org@gnu.org Thu Aug 03 18:46:02 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 1qRbSc-0003ZR-KX for geh-help-gnu-emacs@m.gmane-mx.org; Thu, 03 Aug 2023 18:46:02 +0200 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1qRbS3-0003i7-S4; Thu, 03 Aug 2023 12:45:27 -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 1qRbS1-0003hn-T2 for help-gnu-emacs@gnu.org; Thu, 03 Aug 2023 12:45:26 -0400 Original-Received: from mail-vs1-xe34.google.com ([2607:f8b0:4864:20::e34]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1qRbRx-0004xn-U0 for help-gnu-emacs@gnu.org; Thu, 03 Aug 2023 12:45:23 -0400 Original-Received: by mail-vs1-xe34.google.com with SMTP id ada2fe7eead31-44768609e0bso539490137.0 for ; Thu, 03 Aug 2023 09:45:21 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20221208; t=1691081120; x=1691685920; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:from:to:cc:subject:date :message-id:reply-to; bh=CxlRoAHywk0l9E1jVIQqOqp4QyZVlrhhm8ooyzO/90k=; b=sE8M7PMlRxl4a8CTmlMYhfLvqYUwAq7r4rvZBxUuhE+17utTu9KT1veZHOTSPq3sFY gdKAO76mzi+AajRyyzLHR6OAL0gvRSV2geywcjyP0+yavUPpagFCX2q7/J2Qy9ymJYPE ypYrpFIZrLDU8oygFrxILtiDbhS8PKzyRJmWPN5KchunZPAFUD6aekFq/XwnlLkbIyqH 33OtWyNGQgf/uZ/ua22LwM3w6E489DQoWpwZF+HlgtNeXw0Pw5XJ6fZK2fnju5Cx4CDb 6YCfCq8FjR1ZbEYKVF7UNiefzVMOoHAG6bcfG0/kkMpFbX3DylWz65DrSYVE9e7KYaaG Sv4Q== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1691081120; x=1691685920; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=CxlRoAHywk0l9E1jVIQqOqp4QyZVlrhhm8ooyzO/90k=; b=XMne7uMTisWVyUnRlo2q6vEsVnKBd9Qn4mSiqMoNxal0auQ7PzSqRjK20jnPACBjTC +tFFF+goND6rN3dAOzVOnjR/rs95+Ho6nSrLNC4A2c0nZocLpVKh9e5E+C9fpFRPrXKl k8kMTzuHEaYz/S2OV24wFN6H3deZJ6/9muJhmK7WqSVEjfPsygdB1R8rKmdLAjKCLmjZ XNOpfB6ts/VnaDDHG8aHfemaBAC5VGOYIaAaYxNiLvKU+qs54TsmBjrr3xXTX9PnvTcf h180K7j5sQLubQ7UswuqSIXVktdL5X+gBxr5Dz3rx6lIQex6SLuVOFfOu8ltN/yQV0cc I7Ag== X-Gm-Message-State: ABy/qLb051gv09PTTfhBCa6px5fktMKQ7dfIyJOOOQvGU9++eVGp/W3e 2WnLW0/MTe/l5WTA3URO+UmFVcLDtES2trG0z1I= X-Google-Smtp-Source: APBJJlH9roKmXzU+3EKlO+OkZDD8iOQO80CD2Rvcm01s4aEfVzbRqENl9CLo6BXFYCK0WJ+6ghfmsNIpL2jkCFpO74c= X-Received: by 2002:a05:6102:498:b0:447:b5de:157b with SMTP id n24-20020a056102049800b00447b5de157bmr4912977vsa.5.1691081120460; Thu, 03 Aug 2023 09:45:20 -0700 (PDT) In-Reply-To: <80031dc033efbe0ac0e8b337f33712d46970d221.camel@adminart.net> Received-SPF: pass client-ip=2607:f8b0:4864:20::e34; envelope-from=yurivkhan@gmail.com; helo=mail-vs1-xe34.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, 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:144572 Archived-At: On Thu, 3 Aug 2023 at 22:22, hw wrote: > (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 just = 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. > (vterm-send-string "cd") > (vterm-send-return)) > (message "local terminal seems already open")) Alternatively, since you have just one form in the ELSE branch, you could invert the test: (if (get-buffer "local") (message "local terminal seems already open") (vterm "local") (vterm-send-string "cd") (vterm-send-return)) 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. > It works fine, though I'm getting a warning: > > > =E2=9B=94 Warning (comp): connections.el:13:36: Warning: =E2=80=98(vterm = local)=E2=80=99 is a malformed function > > > What's malformed about it? It doesn't consider (vterm pretty-name) as > malformed ... "local" somehow gets unstringyfied? (vterm pretty-name) is within a function body, which allows multiple forms.