help-gnu-emacs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Embedded list selection with ido-completing-read.


From: Hongyi Zhao
Subject: Re: Embedded list selection with ido-completing-read.
Date: Sun, 24 Oct 2021 08:28:30 +0800

On Sun, Oct 24, 2021 at 3:30 AM Emanuel Berg via Users list for the
GNU Emacs text editor <help-gnu-emacs@gnu.org> 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



reply via email to

[Prev in Thread] Current Thread [Next in Thread]