Questions tagged [completing-read]
The completing-read tag has no usage guidance.
37
questions
1
vote
2
answers
49
views
Filter out command completions with specific prefixes
I am using command completions, and would like to 'filter' out certain built-in packages. For example, typing "text";
In these completions, I would like to filter out/hide the entries that ...
0
votes
0
answers
16
views
Preventing already-selected items from appearing in subsequent completing-read-multiple completions
The problem is probably more evident when using Vertico, but I suspect the behavior is present in completing-read-multiple itself.
If I've got the following form:
(completing-read-multiple
"...
0
votes
1
answer
29
views
How can I let-bind a variable to input read with `completing-read`?
How can I store the selected value in a let variable when using completing-read ?
(let ( (selc '("Lower-Skeleton" "Upper-Skeleton")) )
(completing-read "Vista: " selc ...
1
vote
2
answers
163
views
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 ...
5
votes
2
answers
363
views
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 '(("...
0
votes
1
answer
22
views
Passing numeric value to a function
I have got the following function but want to pass a numeric mode even if completing-read asks for a string.
(defun mycompany (mode)
"Enables or disables company text completion in buffer."...
2
votes
0
answers
72
views
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 ...
0
votes
1
answer
44
views
Using function both as interactive command and in elisp code
I am trying to understand the use of the interactive and the intern commands so I can use a function both within an interactive context and an elisp context.
Require some explanation of how intern is ...
1
vote
1
answer
99
views
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."
...
0
votes
2
answers
54
views
Find-file, but instead of showing file-names to select, show file content (html tag)
I'm attending a conference, and I have downloaded all abstracts so I can read them offline. They are all html files with the same structure.
The files are numbered according to abstract submission ...
1
vote
1
answer
48
views
Completion to set style
I have the following function, where I would like to use completion to set the style. But the way I have done does not reset the style using M-x rk-bracemk-companion.
(defcustom rk-bracemk-...
0
votes
1
answer
27
views
Allowing user input for opening and closing brackets
The following code selects a string with two delimiters from the predefined list stored in delimiter-strings. The first delimiter being the opening bracketing mark, the second delimiter being the ...
0
votes
1
answer
53
views
Command that accepts a string and a selected region
Would like to have a function that selects a string (from a list or from a user-defined string, using the mini-buffer) and a selected region.
User would input (), [], {} specifying the opening and ...
1
vote
1
answer
306
views
How can I exit completing-read with the current string instead of a completion with fido?
Consider the following code:
(fido-mode 1)
(let ((answer (completing-read "Please enter nothing: " '("Something"))))
(if (string= answer "")
(message "You ...
1
vote
0
answers
24
views
Variant of read-regexp that shows matching string candidates upon TAB
I'm looking for an extension of read-regexp, that given an additional parameter of completion candidates, shows the matching subset of these candidates in the minibuffer, when tab is pressed. Similar ...
0
votes
1
answer
61
views
Getting text input into ivy completing read
I know that I can get previous selections of ivy with ivy-history. But is there any way to get what was actually input into the search before choosing a match?
1
vote
1
answer
300
views
Use completing-read to call arbitrary function
How can one pass a list of (arbitrary) functions to completing-read and run the selected candidate? Something like this:
(defun find/buffer ()
(interactive)
(completing-read "Chose one: &...
1
vote
2
answers
86
views
Completing read with must-match and cannot be null
The function completing-read permits the user to simply press the enter key without selecting a match against the list of valid choices:
(let* ((completion-ignore-case t)
(client (completing-...
2
votes
1
answer
569
views
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 ...
0
votes
1
answer
133
views
User input - How to use predefined list
While there are org-templates creating entire bullet points with content, what I am looking for is a simple user query (similar to read-string) where the user can use a pre-defined list of words/...
0
votes
1
answer
30
views
Close completing-read dialog before continuing
I've written an elisp script to automate the process of taking screenshots. The script uses maim and imgur.sh. Not really important however. Here is the code:
;;; ../../.local/share/git/dotArch/....
2
votes
1
answer
198
views
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 ...
0
votes
1
answer
267
views
How to use ivy to navigate named locations of a buffer?
Given a list of (point-number . title-text), how can ivy be used to show this in a list in ivy?
I have code which uses completing-read to do this (see link).
This can use ivy since it extends ...
0
votes
0
answers
19
views
How to include buffer-file-name in completing-read [duplicate]
I can use completing-read to choose from several items like this:
(completing-read
"Complete a foo: "
'(("apple" 1) ("barfoo" 2) ("elk" 3) ("foobar2" 4)) ;; collection of choices
nil t )
But the ...
4
votes
1
answer
558
views
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. ...
2
votes
3
answers
857
views
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 ...
2
votes
1
answer
107
views
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 ...
0
votes
2
answers
181
views
Using thing-at-point as initial input for bookmark-jump with bookmark+ and helm mode
I am using bookmark+ and helm mode.
Debugging a large Fortran code base, I have created some bookmarks that has the same name as some of the Fortran subroutines. Now, I would like to put the cursor ...
3
votes
1
answer
284
views
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"?
1
vote
2
answers
409
views
Using ido completion for selecting a repository for magit
I like to use ido for completing file paths and helm for all other things. I have tried setting magit-completing-read-function to magit-ido-completing-read. This doesn't change magit-status behaviour ...
2
votes
1
answer
23
views
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?
3
votes
3
answers
1k
views
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 ...
0
votes
1
answer
160
views
defun completion and region
Is it possible to write a function with completion that act on region?
A mix of:
(defun function-style (style)
(interactive
(list
(completing-read "Style: " styles-list)))
...
And
(...
3
votes
1
answer
370
views
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 ...
0
votes
1
answer
99
views
Complete using match in middle of string - work with pop-up list?
I'm trying to use auto-complete to match in the middle of a string (after the characters ::). I'd like to typing a then hit tab and have the list of candidates appear 'in full' e.g. fruit::apples, ...
2
votes
1
answer
351
views
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 ...
12
votes
4
answers
2k
views
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 ...