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:21:21 +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="40029"; 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:22:09 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 1meU5J-000ADC-IQ for geh-help-gnu-emacs@m.gmane-mx.org; Sun, 24 Oct 2021 05:22:09 +0200 Original-Received: from localhost ([::1]:55972 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1meU5H-0008Ji-I0 for geh-help-gnu-emacs@m.gmane-mx.org; Sat, 23 Oct 2021 23:22:07 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:42654) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1meU4l-0008JJ-F2 for help-gnu-emacs@gnu.org; Sat, 23 Oct 2021 23:21:35 -0400 Original-Received: from mail-vk1-xa35.google.com ([2607:f8b0:4864:20::a35]:35659) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1meU4j-0002CD-6k for help-gnu-emacs@gnu.org; Sat, 23 Oct 2021 23:21:35 -0400 Original-Received: by mail-vk1-xa35.google.com with SMTP id u130so3474104vku.2 for ; Sat, 23 Oct 2021 20:21:32 -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=jPZrI/RygRveG703IaCt4MqIBlvypNvJMqvvLcqa2D0=; b=bTOdeh/ExYAONU48YJsvXFJaAtSfIX/SAvgyLgSzAj1zCA6DqCNhCCwbR1/UnLprh6 0KR3eOuA64uAeCF2w52XuZn8jBxBt571iWfpXU74dqXPuXQx81HA73xEnat58EHw0xoi PzzAC2vFISp0UAywN7VeYcUFYe1Lb/ztge3UReHQz6ycktoHwujrAZLHRzsn0JjuZlRS KuxzfqbiXs/gJPrdzmlwHw4IbQgDBLWKeiR0NL6Jb5yktvJIvPZdLBXr7Z0rhRkyzNXc Zdr4c0YfiXoTMbb71ZOOJhd2fGCqiSluUsBjbIyujwnIAkFtC8N2/rjNCKFMp7DFOspQ DO5g== 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=jPZrI/RygRveG703IaCt4MqIBlvypNvJMqvvLcqa2D0=; b=1ojX+xIYo3hTJKNbAteDkZZGqw1bofOojiOLjgTWujdp63KI/Dca3GVZRUeve3/Lmi rtx6XlG7QBakz9bUIxVUlWlql2RwBKjS5KxjvUJMEUpWX7zsEMs2DFf9KbhZd5gtMPdL UFgqXUdqybqCQSgSK0PcorGAeWiSvsi4tdMRABEm+yJLd/Zq6udiZZM08V7ZLa1WvZwJ kUwtJvtb66qudmeRRAkW8bnXSjSeVBb8JQNwmE7jDAz/FiLu0Nw1I3anpNy4z0CS11ig g+40oHsaMdoeefhiHcuAmZWaOTVcetZW5KtfqOEXuwbVOK11r8Ht1rhrHsuWSa3+SgUM Wryw== X-Gm-Message-State: AOAM533ifpoVKD9i5NgDa0dveTRI/NUQmmak+5c95XrxvBbsviHd78uE ETrOAKcnlnQ4FMdI/BAq4zSLYeWB0ZOxGlYpFc2syeenAiyxQmzn X-Google-Smtp-Source: ABdhPJxA0OtbwquFHzXd576rItiP2Ic3eA44nAVGAHJA2NoeD+bxLEBYkNRg6J7o/rOQmIsDxxbDtxFkRd8AO2OMcw4= X-Received: by 2002:a05:6122:a10:: with SMTP id 16mr9340789vkn.1.1635045692019; Sat, 23 Oct 2021 20:21:32 -0700 (PDT) In-Reply-To: Received-SPF: pass client-ip=2607:f8b0:4864:20::a35; envelope-from=hongyi.zhao@gmail.com; helo=mail-vk1-xa35.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:134080 Archived-At: On Sun, Oct 24, 2021 at 11:11 AM Hongyi Zhao wrote: > > On Sun, Oct 24, 2021 at 10:28 AM Hongyi Zhao wrot= e: > > 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#discu= ssioncomment-1525332 > > [4] https://github.com/company-mode/company-mode/blob/master/CONTRIBUTI= NG.md#guidelines-for-third-party-packages > > [5] https://github.com/company-mode/company-mode/blob/master/CONTRIBUTI= NG.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-= blyp-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 `|`: put the point on the line below it. > ``` > 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#discuss= ioncomment-1526576 > > HZ --=20 Assoc. Prof. Hongyi Zhao Theory and Simulation of Materials Hebei Vocational University of Technology and Engineering No. 473, Quannan West Street, Xindu District, Xingtai, Hebei province