Questions tagged [completing-read]

The tag has no usage guidance.

Filter by
Sorted by
Tagged with
0 votes
0 answers
9 views

Docstring explaining how to use interactive function with completing-read

I want to write a docstring that explains how completing-read works, but cannot find a good description on how one can move from one option to another.
user avatar
  • 357
0 votes
1 answer
18 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."...
user avatar
  • 357
0 votes
0 answers
14 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 ...
user avatar
0 votes
1 answer
30 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 ...
user avatar
  • 357
1 vote
1 answer
23 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." ...
user avatar
  • 357
0 votes
2 answers
31 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 ...
user avatar
  • 3,403
1 vote
1 answer
29 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-...
user avatar
  • 169
0 votes
1 answer
19 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 ...
user avatar
  • 169
0 votes
1 answer
34 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 ...
user avatar
  • 169
1 vote
1 answer
90 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 ...
user avatar
  • 921
1 vote
0 answers
18 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 ...
user avatar
  • 415
0 votes
1 answer
37 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?
user avatar
  • 3
1 vote
1 answer
164 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: &...
user avatar
1 vote
2 answers
57 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-...
user avatar
  • 17.8k
2 votes
1 answer
377 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 ...
user avatar
  • 1,588
0 votes
1 answer
65 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/...
user avatar
  • 307
0 votes
1 answer
29 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/....
user avatar
2 votes
1 answer
118 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 ...
user avatar
  • 87
0 votes
1 answer
222 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 ...
user avatar
  • 7,267
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 ...
user avatar
3 votes
1 answer
470 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. ...
user avatar
  • 636
2 votes
3 answers
515 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 ...
user avatar
2 votes
1 answer
100 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 ...
user avatar
0 votes
2 answers
159 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 ...
user avatar
3 votes
1 answer
230 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"?
user avatar
  • 1,260
1 vote
2 answers
393 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 ...
user avatar
2 votes
1 answer
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?
user avatar
  • 221
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 ...
user avatar
0 votes
1 answer
141 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 (...
user avatar
  • 3,056
3 votes
1 answer
333 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 ...
user avatar
0 votes
1 answer
87 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, ...
user avatar
  • 189
2 votes
1 answer
336 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 ...
user avatar
  • 2,280