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: Tue, 26 Oct 2021 23:07:25 +0800 Message-ID: References: <87r1cbwnda.fsf@zoho.eu> <87a6iz1at1.fsf@zoho.eu> <87sfwqxuhi.fsf@zoho.eu> <878rygmkhn.fsf@zoho.eu> <87lf2fkhko.fsf@zoho.eu> 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="37605"; 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 Tue Oct 26 17:08:49 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 1mfO4E-0009Vt-Rv for geh-help-gnu-emacs@m.gmane-mx.org; Tue, 26 Oct 2021 17:08:46 +0200 Original-Received: from localhost ([::1]:37088 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1mfO4D-00044q-Mm for geh-help-gnu-emacs@m.gmane-mx.org; Tue, 26 Oct 2021 11:08:45 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:43004) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1mfO3A-00041s-Gk for help-gnu-emacs@gnu.org; Tue, 26 Oct 2021 11:07:40 -0400 Original-Received: from mail-ua1-x935.google.com ([2607:f8b0:4864:20::935]:38544) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1mfO38-00036C-6a for help-gnu-emacs@gnu.org; Tue, 26 Oct 2021 11:07:40 -0400 Original-Received: by mail-ua1-x935.google.com with SMTP id o26so15818718uab.5 for ; Tue, 26 Oct 2021 08:07:36 -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 :content-transfer-encoding; bh=iJsWjSKDHFufncH4gnE60FdzXolF20KCyzzPaN096l4=; b=hHmCO6993KFoZTTWUPUrI6W+TfkTv6XGo6FHpVef061AwAG66bs1Y61WLqqmjunz4Y BtJOHULI1etAm6qoeAN0jIJWCnLZE8w6cPxjkCxS5nHldR1GWXHCPObwGLQ7OgcQGxVT b0be1CBoBsGdXr3U9TyA9oSbCjgRrK2AJOj795yX0NvAQdW+GPoT5I0XBzkTExfC/4lB iYHxE4lFUTUSoCIMeF0zJTJ+W50Bzt2TphZBSQodQ8WV8srFFk7KgEGMPiJN2UiUOPsH VPlNlUG5EH/rhqyMRbmpUJeJS2fLXHhaBR+TYOyj45esSXK/8pTrPFtq6wvLfZ41Zlwe Po6w== 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:content-transfer-encoding; bh=iJsWjSKDHFufncH4gnE60FdzXolF20KCyzzPaN096l4=; b=IK8ahd5aZPg6o793UYJYvmPARoHU3L8Ni/ZHLPKmBotEOf8FX7tGRowj1bYuQduIHV r2GHNzufy5R47wQuemXncQej3q0Qv0U64f6iS1R9U88TbLngyssTlNVlwlRUKxjJ4kLu ZzofLW6/Qft1Vb2uET/MKOztNCO+Ox4Bt5Sg4nMGkjyszLDTMbroia56DwxhTOZ633D0 6TFZIhWc1PnvgIZW+t+jFeZVTkSQoqvbm/bpgLczgPi3UYeMESsMbvcZGh8eZHiCVrJ5 8ky1yDrSWstaPGepQ3BkT10IBY17EL3We3l8R3H1I0vw64cu5qXaeuZLLDBPzDFur1u2 azOQ== X-Gm-Message-State: AOAM530/IJ0zOzonmFUq9LBcmiR3LV4a+erEx9A9giVhjkN5sXBELZqa QFrJ48zB56ZK1FDuREdfK77Zhm8Ot7SRWmSoyjwSDOtkxr5tUCDI X-Google-Smtp-Source: ABdhPJxh0MDxCSvnzm67UKVBL8N2EOs1F/UAkkGvM6N/5zWAopLXzuIqwJNu9fBeJxNVppyfCC8NuMAcRRZenWApOsI= X-Received: by 2002:a67:f1ca:: with SMTP id v10mr21549793vsm.55.1635260856274; Tue, 26 Oct 2021 08:07:36 -0700 (PDT) In-Reply-To: <87lf2fkhko.fsf@zoho.eu> Received-SPF: pass client-ip=2607:f8b0:4864:20::935; envelope-from=hongyi.zhao@gmail.com; helo=mail-ua1-x935.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:134216 Archived-At: On Tue, Oct 26, 2021 at 10:05 PM Emanuel Berg via Users list for the GNU Emacs text editor wrote: > > Hongyi Zhao wrote: > > > I tried for some time and got the following code snippet, > > but it doesn't seem to be able to complete the work > > discussed here by the original code snippet: > > > > (defun atomic-position (prog flag1 flag2) > > (interactive > > (list > > (completing-read "prog: " '("neb" "pw" "cp") nil t) > > (completing-read "flag1: " '("alat" "angstrom" "bohr" "crystal" > > "crystal_sg") nil t) > > (completing-read "flag2: " '("alat" "angstrom" "bohr" "crystal") ni= l t) > > ) > > ) > > > > (cond ((or (equal prog "neb") > > (equal prog "pw")) > > (insert (format "Atomic position: %s\n" flag1))) > > ((equal prog "cp") > > (insert (format "Atomic position: %s\n" flag2))) > > )) > > Ha, so what's up with all this? The above code has a problem: only one of the completing-read command corresponding to flag1 or flag2 should be called in one run, but it runs both at the same call. > You fooled me, I admit it ... good one :) I=E2=80=99m serious and have never done anything flashy. HZ