Questions tagged [completing-read]
The completing-read tag has no usage guidance.
21
questions
1
vote
1answer
34 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: &...
0
votes
0answers
9 views
Recover selected/highlighted key, val or cons before RET in completing-read
I have completing-read set to show me a plist.
I want to do something without RETURNING (completing the function).
E.g..:
(defun fancy-mode-call-buffer ()
"List buffers to switch."
(...
1
vote
2answers
29 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-...
0
votes
1answer
85 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
1answer
35 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
1answer
25 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
1answer
48 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
1answer
126 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
0answers
17 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 ...
2
votes
1answer
283 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
3answers
190 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
1answer
77 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
2answers
126 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
1answer
187 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
2answers
337 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
1answer
19 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
3answers
809 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
1answer
121 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
1answer
259 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
1answer
81 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, ...
1
vote
1answer
295 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 ...