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: Embedded list selection with ido-completing-read. Date: Sun, 24 Oct 2021 08:28:30 +0800 Message-ID: References: <87r1cbwnda.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="13534"; mail-complaints-to="usenet@ciao.gmane.io" To: Emanuel Berg , help-gnu-emacs Original-X-From: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane-mx.org@gnu.org Sun Oct 24 02:29:24 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 1meRO8-0003KY-1h for geh-help-gnu-emacs@m.gmane-mx.org; Sun, 24 Oct 2021 02:29:24 +0200 Original-Received: from localhost ([::1]:42272 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1meRO6-0003aA-6u for geh-help-gnu-emacs@m.gmane-mx.org; Sat, 23 Oct 2021 20:29:22 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:56782) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1meRNT-0003a0-KL for help-gnu-emacs@gnu.org; Sat, 23 Oct 2021 20:28:43 -0400 Original-Received: from mail-ua1-x931.google.com ([2607:f8b0:4864:20::931]:34693) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1meRNS-00059J-B2 for help-gnu-emacs@gnu.org; Sat, 23 Oct 2021 20:28:43 -0400 Original-Received: by mail-ua1-x931.google.com with SMTP id h4so14957185uaw.1 for ; Sat, 23 Oct 2021 17:28:42 -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; bh=GfIg57Glr8quJS3T4K2olV3+6GP01fVlwRygDEJrkSE=; b=WiDAcVR0jY7xRMWRs4da1m5utsOcoAc5ez1o3MRhrd6bfX03EVFSTEBjDW3FZo8ijf wnlHHPSEa5+VcLt8klAvcAufvOSDPJ4QnMz73Dfwu8x60EpjaOZZPdz24PdpecKvLzDT mDhEn0/zE2gPCpYaTiKCp4KNuGfIS68E51ZkAWJ02bHcy8sge4cYLfvD1PWORSz3Rmu+ WoyKzjNK3/JlTQ1gbsVsRmBSK7tDkvl6TBbASbMT++SHZ9DAP3l1lRDLJIhatzk7PoKT 23DcxJK+RMyE5dXedN73ndb+Z9lhBMPgthjOQTL1GEYnMBHHfNjDskq2dM7RunEm7d8E CTAw== 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; bh=GfIg57Glr8quJS3T4K2olV3+6GP01fVlwRygDEJrkSE=; b=y1a4IkhjyNOSyuVToJPHTDCZ93agBT3CbkDz951J9u2xvxPI3L2fHSXHYqAb8juqpV o2OfVo5qjOhpmOrsRaaTgAFO5j5dSHQioQa9umOpptR/M1Q602jkBEmKEPYAHySkPmGt O89caE/G/KF4sDuF7I8V0Uk9CRdc+lBvIPf6Zu/LieOxwAuOUGefGb+zLgnvo6iky37c 4T/5oRSMywJH1G91DS1eYxi4VwoAq2fBuJDu84WWJ29VAWM70OxXNImpEd1jsxPdjCgo rOoZUt17SH8lZjfOBzrOmz/F0ODyhpP/gYB/z4uJ9SJAYkhYeWLnA3de8AhueX9PX0M5 dTGQ== X-Gm-Message-State: AOAM532CWd3LDNcmM9YvodV/FpjeOSl2x5OInbPNZDOqOTtvPn1VXt6/ j2tSzr/KBDUGKg/YDu6HqZeKNXwodQudvq3Qz8g= X-Google-Smtp-Source: ABdhPJzHxp4tA+FO7QNjs+dPg96DSsLpePG2ROPHX/+l8cIAt8A6y9Buu9PJjmRHaRDuCEX0/8UNm8FqBhECYRjtToA= X-Received: by 2002:a67:c31c:: with SMTP id r28mr9018922vsj.10.1635035321446; Sat, 23 Oct 2021 17:28:41 -0700 (PDT) In-Reply-To: <87r1cbwnda.fsf@zoho.eu> Received-SPF: pass client-ip=2607:f8b0:4864:20::931; envelope-from=hongyi.zhao@gmail.com; helo=mail-ua1-x931.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:134073 Archived-At: On Sun, Oct 24, 2021 at 3:30 AM Emanuel Berg via Users list for the GNU Emacs text editor wrote: > > See if you can use `cl-case' (or `pcase') instead of `cond'. > > In the `interactive' form, only assign values to the formal > parameters (see my previous post). > > You can evaluate these to try: > > (interactive "ssay hi: ") > > (interactive (list (read-string "say hi: "))) > > When done test the function both from Lisp and > interactively. I still can't figure out how to use your suggestions above to further simplify my implementation below: (defun my-pw-ATOMIC_POSITIONS2 () (interactive (list (insert "ATOMIC_POSITIONS " (completing-read "flag: " '(("alat") ("bohr") ("angstrom") ("crystal") ("crystal_sg") ) ))))) HZ