Questions tagged [completing-read]
36 questions
12
votes
4 answers
Make completing-read respect sorting order of a collection
Either:
(completing-read "test: " '("a" "b" "c"))
or:
(completing-read "test: " '("c" "b" "a"))
produces the same result in completion buffer when pressing TAB. How do I make it respect the sorting order?

Tu Do
- 6,772
- 20
- 39
5
votes
2 answers
completing-read, search also in annotations
Can someone please tell me how can I force completing-read to search not only in the displayed rows, but also within annotations?
Consider a trivial example such as this:
(let* ((coll '(("Affenpinscher" . "Loyal and amusing")
("Akita"…

iLemming
- 1,223
- 9
- 14
3
votes
1 answer
How to tell Ivy to use completing-read-default for specific command? (org-tags-view, in particular)
Ivy (+swiper +counsel) is very cool and I use it constantly for an ever growing number of tasks. But there are some cases in which the requirements of a certain completion task defeats Ivy's logic. One of those is Org tags search, more precisely,…

gusbrs
- 721
- 4
- 14
3
votes
1 answer
Accept unmatched input in completing-read when using helm
In helm, when executing following code:
(let ((things (list "a" "aa" "aaaa")))
(completing-read "Thing: " things))
... how can I exit the minibuffer and return "aaa"?

mkcms
- 1,340
- 12
- 13
3
votes
3 answers
How can I create custom menu prompts in elisp?
I have two elisp functions:
$ cat ~/myelisp/myoptions.el
(defun get-my-name (arg)
"Prompt user to enter a string, with input history support."
(interactive
(list
(read-string "Enter your name: ")))
(message "Your name is %s."…

Brian Fitzpatrick
- 2,265
- 1
- 17
- 40
3
votes
1 answer
Completing read a directory or an element from a list
I'm making some functions to interact with Mercurial. Many Mercurial commands take a repository as an argument, and that argument can be specified either by a path to the root of the repository or by a repo name. These repo names can be configured…

Daniel Matz
- 115
- 7
2
votes
1 answer
Selecting a directory like counsel-find-file
I would like to write a function that would prompt the user to select a directory, using an UI like that presented by counsel-find-file.
The starting directory should be an arbitrary directory passed to this function as an argument.
This function…

izkon
- 1,798
- 10
- 23
2
votes
1 answer
How to prompt user for tags and use the result in a org-ql-search function?
Is there a way to read tags with completion from the user in the same way read-number or read-string allows?
I would like to have a custom function defined where I ask the user for a tag (or list of tags) and use that in a org-ql-search query.

AEmacs
- 87
- 4
2
votes
3 answers
How can I ask a user to choose from a list of options, while showing her a long list with extra metadata?
I'm writing a package which connects to a remote server for a game.
I want to show the list of players, along with their score, and let the player choose one of the players.
I thought of using completing-read, but I have no idea how to show a…

Parham Doustdar
- 275
- 2
- 10
2
votes
1 answer
Read a sentence with completion for words from a collection
Suppose we have a collection of descriptions like this:
("procedural" "functional" "high-level" "low-level" "statically-scoped" "dynamically-scoped")
Suppose that we have a database of programming languages and would like to enable the user to…

AlwaysLearning
- 749
- 4
- 14
2
votes
1 answer
How can I modify the prompt of another command?
How can I modify the prompt of another interactive command without copy-pasting too much?
Can I override only the interactive form?

Joelmob
- 231
- 1
- 4
2
votes
1 answer
Configure helm--completing-read-default to pick the top match
I have the variable completing-read-function set to helm--completing-read-default. When an external package invokes completing-read, this gives helm-based completion. However, the default item picked by the helm completions buffer is the exact…

Pradhan
- 2,330
- 14
- 28
1
vote
2 answers
Is it possible to automate completions?
Continued from this post:
(setq completions '("~/org/test-file-1.org" "~/org/test-file-2.org")) ; C-x C-e
(defun mybar()
(newline-and-indent)
(insert-file-contents (completing-read "Type something, use TAB for completion: " completions nil t))) ;…
user19777
1
vote
0 answers
see virtual/recent buffers when switching with fido
I've switched from ido to fido and I'm missing the feature of being able to open recently closed buffers that ido-mode provided with ido-use-virtual-buffers. I spent a lot of time searching for how to get this and reading all about icomplete and do…

hzuim992
- 11
- 2
1
vote
1 answer
Initial input for completing-read
With the following function using "completing-read", how can one add a default initial input to be Convert. What can I do?
(defun subset ()
"Convert or extract subsets of data."
(interactive)
(let* ( (opts '("Convert" "Split"))
(sel…

Dilna
- 1,173
- 3
- 10