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: Insert one of the flags automatically with tab completion. Date: Sat, 23 Oct 2021 13:07:06 +0800 Message-ID: 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="12381"; mail-complaints-to="usenet@ciao.gmane.io" To: help-gnu-emacs Original-X-From: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane-mx.org@gnu.org Sat Oct 23 07:07: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 1me9G1-00032d-4d for geh-help-gnu-emacs@m.gmane-mx.org; Sat, 23 Oct 2021 07:07:49 +0200 Original-Received: from localhost ([::1]:55330 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1me9Fz-0006fU-Jg for geh-help-gnu-emacs@m.gmane-mx.org; Sat, 23 Oct 2021 01:07:47 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:57362) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1me9FY-0006f3-7o for help-gnu-emacs@gnu.org; Sat, 23 Oct 2021 01:07:20 -0400 Original-Received: from mail-vk1-xa35.google.com ([2607:f8b0:4864:20::a35]:45896) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1me9FW-00048r-9C for help-gnu-emacs@gnu.org; Sat, 23 Oct 2021 01:07:19 -0400 Original-Received: by mail-vk1-xa35.google.com with SMTP id n201so2470044vkn.12 for ; Fri, 22 Oct 2021 22:07:17 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=mime-version:from:date:message-id:subject:to; bh=H1VsAyarrt9FBmcFXMt6YAc4SKParqfGULk4cyPDIcU=; b=FPEQD5a9ooHvYB9GgoSgRZeVK1GrxlduUN0gSu3Ej32lIQtWFEd8i7lSxbIiF/jUlR u7Rht1jSVMgGVvaiSXNiYTyfXERo7Q01WDhhbndclrGKiZuzRO99OuwuOeswPGztMds5 mGis02NBVVSJR+s40GVhBLc8jCI2132wfbqSNhSqCdwJRhp4UlqjJKEqOGckxQWaaKtC zxQxvqJHm0a2fV2qvbnsJA1j1fsQtuZCuESTdpttIPr+I9Ld9wisCuEv4nLfdZ12YkXB 2sGSwuKEvkuKBv+4QMR9PUyhav4VmULu3j1M4gojIRjVsPcMikso44SOj8dtGi+u2vMs Tenw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:mime-version:from:date:message-id:subject:to; bh=H1VsAyarrt9FBmcFXMt6YAc4SKParqfGULk4cyPDIcU=; b=BTVmb2zSQz5/e4kXDNt5FgI1invsMTgwo7kzPPoKgV6GJRCVQxaEPdLa89F7LBYiEn t8ph92nNYunltJJNIvDZY8B0b9CxH6h/1FdQsmE7tChhdNH1fL7CGdAc8B/Mbo5YbtNQ fmMqcTatcjErr/2vc9u+yvVu9tL4NdsdDFmA9kzZFC1chTcpdKFeG+o7K1XHa/eI1kuC jjCL7dJhHlJhzgc3baJYx2V09zvszAxE+HuWZg3SKUwCblAfA+9L/ql9XLwCwebFXBDL IttyH20s7eqn1WDC6RCGRH2q7lBOD4fIZR+remvFW5pfAyCaL5jGAttHy9LsggBx3sq6 QYUA== X-Gm-Message-State: AOAM531Y71gm/+ckCmC6Z/3VvjF4HEfa19o3ibDzmurADDYv7jpiOaAV nn7H6c5H873nc8dJ+pKqF6wm6KUKkpWj2YWn31LcKJ6smZNOX6dj X-Google-Smtp-Source: ABdhPJwlo6qJLkSlgAfgu8IyAKl8WvBPtnaixr+8B4aMpxlPSxK8VuUaYE2IoLpPIExjT6O9zS/iDc6GQ3rHOZrpYmE= X-Received: by 2002:a1f:ecc2:: with SMTP id k185mr4687748vkh.3.1634965637038; Fri, 22 Oct 2021 22:07:17 -0700 (PDT) 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:134033 Archived-At: I noticed the following function defined here[1]: (defun pw-ATOMIC_POSITIONS () (interactive) (let ((flag (read-string "Flags: { alat | bohr | angstrom | crystal | crystal_sg } "))) (insert "ATOMIC_POSITIONS " flag)) (newline 1) ) The above function can only prompt the user to insert one of the flags manually. But I want to insert one of the flags automatically with tab completion. Any hints for achieving this enhancement? [1] https://github.com/QEF/q-e/blob/03a7fa640903173662b24e4c30e520c9beaba16d/GUI/QE-modes/qe-modes/qe-funcs.el#L1966 Regards -- 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