all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
* Make completing-read pick item after initial
@ 2024-04-10 23:14 Heime
  2024-04-14 10:43 ` Philip Kaludercic
  0 siblings, 1 reply; 2+ messages in thread
From: Heime @ 2024-04-10 23:14 UTC (permalink / raw)
  To: Heime via Users list for the GNU Emacs text editor


How can I make completing-read start from an initial "Gramma", but rather than
starting from "Greek" as the next item, it continues with the next one, namely
"Flokki".  But I would like to retain the order of cseq as "Greek"  "Gramma"  
"Flokki" rather than changing it.

(defun avus-latex (seltr)
  "Display the full documentation of `avus-ams' tools."

  (interactive
    (list
      (let ( (cseq '("Greek"  "Gramma"  "Flokki")) )
        (completing-read "Doc: " cseq nil t "Gramma"))))

  (describe-function (pcase seltr
                       ("Greek"   'avus-latex-greek)
                       ("Gramma"  'avus-latex-gramma)
                       ("Flokki"  'avus-latex-flokki))) )



^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: Make completing-read pick item after initial
  2024-04-10 23:14 Make completing-read pick item after initial Heime
@ 2024-04-14 10:43 ` Philip Kaludercic
  0 siblings, 0 replies; 2+ messages in thread
From: Philip Kaludercic @ 2024-04-14 10:43 UTC (permalink / raw)
  To: Heime; +Cc: Heime via Users list for the GNU Emacs text editor

Heime <heimeborgia@protonmail.com> writes:

> How can I make completing-read start from an initial "Gramma", but rather than
> starting from "Greek" as the next item, it continues with the next one, namely
> "Flokki".  But I would like to retain the order of cseq as "Greek"  "Gramma"  
> "Flokki" rather than changing it.

I am not entirely sure about this, but the name of the argument
COLLECTION hints that the interface doesn't commit to any order.  These
are just different strings that by default, Emacs will expand (and due
to the usage of REQUIRE-MATCH prevent anything else from being
accepted).

> (defun avus-latex (seltr)
>   "Display the full documentation of `avus-ams' tools."
>
>   (interactive
>     (list
>       (let ( (cseq '("Greek"  "Gramma"  "Flokki")) )
>         (completing-read "Doc: " cseq nil t "Gramma"))))
>
>   (describe-function (pcase seltr
>                        ("Greek"   'avus-latex-greek)
>                        ("Gramma"  'avus-latex-gramma)
>                        ("Flokki"  'avus-latex-flokki))) )
>
>

-- 
	Philip Kaludercic on icterid



^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2024-04-14 10:43 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2024-04-10 23:14 Make completing-read pick item after initial Heime
2024-04-14 10:43 ` Philip Kaludercic

Code repositories for project(s) associated with this external index

	https://git.savannah.gnu.org/cgit/emacs.git
	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.