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 11:11:16 +0800 Message-ID: References: <87r1cbwnda.fsf@zoho.eu> <87a6iz1at1.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="38205"; 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 05:12:10 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 1meTve-0009kD-4I for geh-help-gnu-emacs@m.gmane-mx.org; Sun, 24 Oct 2021 05:12:10 +0200 Original-Received: from localhost ([::1]:54764 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1meTvc-00072d-K7 for geh-help-gnu-emacs@m.gmane-mx.org; Sat, 23 Oct 2021 23:12:08 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:41962) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1meTv1-00072F-EQ for help-gnu-emacs@gnu.org; Sat, 23 Oct 2021 23:11:31 -0400 Original-Received: from mail-ua1-x932.google.com ([2607:f8b0:4864:20::932]:39599) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1meTuz-00037G-0e for help-gnu-emacs@gnu.org; Sat, 23 Oct 2021 23:11:31 -0400 Original-Received: by mail-ua1-x932.google.com with SMTP id p23so2535080uaa.6 for ; Sat, 23 Oct 2021 20:11:28 -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=l7qoKqlRM1cmYtEfHYRvlEOJJJRoZq6AkLpesg61T+0=; b=mQoE8cgPV9yn1b4z1YL/un60ILWP26bydxilFzrUIpMZwdo8wO9owo/zxOvGCpRxN7 Uwu24d5e4aEmDgoDDjpwhmRFn3/cBkTdKAIHylNfWPoBiKkuEtQ2T7gQh1Hkz19tTCsC hJBSPI863WPoTUKHMk+rPCwmVKghV96Hulu/wS2eaGnybGaf0T1ktEbBg6/kgAMpl3tK g8fnUt9hpVqSPbxFUjuzlx7wq8euVFnfggUPj78l0UiV0aFi3B7U9H/8fqAyhUYHRT4F kAC/ofHbN7ycLpRABmVwrLsSeAHGe7r3YghmwHTPafW61tsWkDYiQE6fz5GPeELV1tFq VkOw== 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=l7qoKqlRM1cmYtEfHYRvlEOJJJRoZq6AkLpesg61T+0=; b=TpfCpjZZdLDwkfdUuNCKF2XxvUJmDHFkMapj7BkbiKFL28CuD9t43gU9CUrXF/0brS 0BPFKdHcdWEAP6e1NjwkfgWwBlcTU24sZbrPw2x92gJrWCJTAXg7r4ZKo1h0y1sCebf8 Rks4xxtzbe9lDxQXUSdqDS2o/GHGczqvJi/Twb9nes0OO1zqZ3om/67TIaDuZdUYmvDN qJ69wI8lsszXQgV09c0rGxUG+6832y0+6TFsx7Uv9Xv5H0DE4+CJUwVPamGwRQlJfbuD cJv0fAVTUmGcT8friJb/OKXfNQlM3tieDLyOufNydKEU7bYRQ2YaZSNJa/S8++s6Ar0s moUw== X-Gm-Message-State: AOAM531Xb7AuHMT0Fcj2fjnj5ua150RvudBmYzXrYjSwENvK0Bm8KdC3 w1czCI7L1IeDixBHVdDPcTAXT44+2VK7KlBJF1zzAB8yxYtW1N0U X-Google-Smtp-Source: ABdhPJyBLdC4fH62xJyEX+D2lEJA6LVb1FR9yK/wOS9mSMmnErdzaPw2VGKpjnQK8m+O6m/hxMfk52IiHDBX8uk8DPE= X-Received: by 2002:a67:a60c:: with SMTP id p12mr9492224vse.25.1635045087711; Sat, 23 Oct 2021 20:11:27 -0700 (PDT) In-Reply-To: Received-SPF: pass client-ip=2607:f8b0:4864:20::932; envelope-from=hongyi.zhao@gmail.com; helo=mail-ua1-x932.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:134079 Archived-At: On Sun, Oct 24, 2021 at 10:28 AM Hongyi Zhao wrote: > BTW, my ultimate purpose it to implement the in-buffer company-mode > [1] completion support for QE-modes [2], which is the main reason why > I ask this question. And I=E2=80=99ve got some useful advice here [3-5]. > > [1] https://github.com/company-mode/company-mode > [2] http://pwtk.ijs.si/qe-modes.html > [3] https://github.com/company-mode/company-mode/discussions/1247#discuss= ioncomment-1525332 > [4] https://github.com/company-mode/company-mode/blob/master/CONTRIBUTING= .md#guidelines-for-third-party-packages > [5] https://github.com/company-mode/company-mode/blob/master/CONTRIBUTING= .md#backend-integration > > It seems that I still have a long way to go to achieve this goal. I describe the outline of my final goal as follows [1]: The ultimate purpose of [`QE-modes`](http://pwtk.ijs.si/qe-modes.html) package is to facilitate the generation of [`Quantum ESPRESSO`](http://www.quantum-espresso.org/) input files. Therefore, the content to be automatically completed here may not be the same as ordinary automatic completion. Let me use [the following example](https://github.com/QEF/q-e/blob/master/test-suite/cp_h2o/h2o-mt-bl= yp-1.in) to illustrate some of the technical difficulties that need to be resolved. ``` &control title =3D ' Water Molecule ', calculation =3D 'cp', restart_mode =3D 'from_scratch', ndr =3D 51, ndw =3D 51, nstep =3D 100, iprint =3D 100, isave =3D 100, tstress =3D .TRUE., tprnfor =3D .TRUE., dt =3D 5.0d0, etot_conv_thr =3D 1.d-9, ekin_conv_thr =3D 1.d-4, prefix =3D 'h2o' verbosity =3D 'medium' / &system ibrav =3D 14, ce celldm(1) =3D 12.0, celldm(2) =3D 1.0, celldm(3) =3D 1.0, celldm(4) =3D 0.0, celldm(5) =3D 0.0, celldm(6) =3D 0.0, nat =3D 3, ntyp =3D 2, nbnd =3D 4, ecutwfc =3D 80.0, / &electrons emass =3D 400.d0, emass_cutoff =3D 2.5d0, electron_dynamics =3D 'damp', electron_damping =3D 0.2 / &ions orthogonalization =3D 'ortho', ion_dynamics =3D 'none', ion_radius(1) =3D 0.8d0, ion_radius(2) =3D 0.8d0, / ATOMIC_SPECIES O 16.0d0 O.blyp-mt.UPF H 1.00d0 H.blyp-vbc.UPF ATOMIC_POSITIONS (bohr) O 0.0099 0.0099 0.0000 0 0 0 H 1.8325 -0.2243 -0.0001 1 1 1 H -0.2243 1.8325 0.0002 1 1 1 ``` The input file specification of the above example is located [here](https://www.quantum-espresso.org/Doc/INPUT_CP.html). The main problems I want to solve are: 1. When I try to input one namelist, hinting all possible namelists at the point with drop-down frame; once I select the namelist, say, `&CONTROL`, then insert it corresponding to the specification as follows, and put the point in the middle of it, denoted by `|`: ``` &control | / ``` 2. When I try to input one CARD, hinting all possible CARDs at the point with drop-down frame; once I select the CARD, say, `ATOMIC_SPECIES`, then insert it corresponding to the specification as follows, and put the point in the middle of it, denoted by `|`: ``` ATOMIC_SPECIES | ``` 3. When I try to input one variable with the point located in certain namelist, hinting all possible variables belonging to the given namelist at the point with drop-down frame. Say, for the namelist `&control`, only [the following variables](https://www.quantum-espresso.org/Doc/INPUT_CP.html#idm4) should be used to construct the candidates list: ` calculation | title | verbosity | isave | restart_mode | nstep | iprint | tstress | tprnfor | dt | outdir | saverho | prefix | ndr | ndw | tabps | max_seconds | etot_conv_thr | forc_conv_thr | ekin_conv_thr | disk_io | memory | pseudo_dir | tefield ` 4. After I have completed an input of one CARD, inserting an example usage of the CARD, say, the following one: ``` ATOMIC_POSITIONS (bohr) O 0.0099 0.0099 0.0000 0 0 0 ``` [1] https://github.com/company-mode/company-mode/discussions/1247#discussio= ncomment-1526576 HZ