7
votes
Accepted
Prompt with pre-populated minibuffer input
I think what you need is (read-string "input: " "awesome").
5
votes
Accepted
Set focus to minibuffer window
I prefer to select a window in a particular direction -- that way, I don't have to "cycle" through too many windows. That being said, here is a repost from Emacs wiki -- "The following command ...
3
votes
Accepted
How to call a interactive function with prompt from a lambda?
Instead of providing a function to `call-interactively, you are calling the function (to pass the return value from that call).
Try (call-interactively 'my--insert-chord).
3
votes
Why does emacs recognize my wildcard with finding file but not with searching buffer?
Use of * in a file or directory name is a wildcard for glob matching. (It is unrelated to regular-expression matching, by the way).
Buffer names are not necessarily file names. There are many ...
3
votes
Accepted
How to force Yes/y answer to `emacs has changed since visited or saved. Save anyway?` prompt
You might want to check the auto-answer package. It works on functions whose the underlying prompt is yes-or-no-p, read-string, read-from-minibuffer, read-key-sequence, read-key-sequence-vector, read-...
3
votes
Accepted
Change prompt style to minibuffer from GUI dialogs
This is controlled through the use-dialog-box variable. Either put this in your init file:
(setq use-dialog-box nil)
or use the Customize interface.
3
votes
Accepted
How to prompt for function use be used within a function?
One way is to use an interactive code to prompt you for the function.
(defun simple-function (input-function)
(interactive "aInput function: ")
(dotimes (counter 10)
(funcall input-...
3
votes
Accepted
How to switch org-babel-execute-src-block to use y-or-n-p?
yes-or-no-p is hard-coded into org-babel-confirm-evaluate.
We override it with y-or-n-p locally for org-babel-confirm-evaluate:
(eval-when-compile
(require 'cl-lib))
(defun org+-substitute-yes-or-...
2
votes
How to prompt to ask for confirmation when C-x C-c in emacsclient?
C-x C-c will not prompt to ask for saving desktop, it will exit Emacs immediately.
C-xC-c (save-buffers-kill-terminal) does not actually kill the server by default, unless the client invoking it was ...
2
votes
Accepted
Accept default in ivy filename prompt
Use ivy-immediate-done (defaults to C-M-j) without entering any text to use the default value.
2
votes
PS1 under term and shell doesn't match system
It looks like $PS1 does match: your echo statements in the first example return identical results. I think the problem is that the escape codes aren't getting processed properly. I use the following ...
2
votes
Accepted
Disable yes/no prompting in git-gutter?
I hope my unskilled code meets your requirements.
(defun my-stage-hunk ()
(interactive)
(git-gutter:awhen (git-gutter:search-here-diffinfo git-gutter:diffinfos)
(git-gutter:do-stage-hunk it)
...
2
votes
Accepted
How to reset the colors at the end of the Eshell prompt?
Turn off the "stickiness" of the face property at the end of the prompt:
(setq eshell-prompt-function
(lambda ()
(let ((c "#fdd"))
(let ((bc (lambda (str)
...
2
votes
Accepted
Write a function that prompts for a file from within a list
You can use completing-read like this:
(setq completions '("foo" "bar" "baz"))
(completing-read "Type something, use TAB for completion: " completions nil t)
...
2
votes
Accepted
Emacs 29.1: read-string prompt bug?
This is the result of a deliberate change made in emacs-28 to fix bug 46033
As @NickD suggested, C-p and C-n still work.
1
vote
Accepted
Emacs 29.1: read-string prompt and other messages in minibuffer
emacs-27 introduced set-message-function to call set-message-functions, which by default appends the message to the prompt. To get back the emacs-26 behaviour, set or let-bind set-message-function to ...
1
vote
Accepted
Automatically kill an in-progress compilation when compile is (re)invoked?
(setq compilation-always-kill t)
1
vote
Accepted
I can't run gdb in emacs
Emacs isn’t expecting a prompt from GDB here, so just change your GDB configuration so that there is no prompt. A quick search that anyone could have done suggests that adding set debuginfod enabled ...
1
vote
Accepted
most commands are refused when prompted for querying whether to use a novice-confusing command
This dialog is modal: there is indeed no way to go forward other than pressing one of the indicated keys. But:
You can answer n and then visit the *Messages* buffer to copy the prompt string.
The *...
1
vote
Non-blocking prompt for user input
The solution I've come up with is to run the function prompting for user input in a timer using run-at-time:
(defun my-org-pomodoro-started-break-reminder-prompt (prompt)
"Create Google ...
1
vote
Why does emacs recognize my wildcard with finding file but not with searching buffer?
If you want to type in fewer characters, Emacs has built in completion. You can type a few letters and then hit TAB to complete the input, or to see a list of matching inputs. This can save you a huge ...
1
vote
Accepted
eshell last exit code in prompt
How about using the eshell-last-command-status variable?
(setopt eshell-prompt-function
(lambda ()
(concat (abbreviate-file-name (eshell/pwd))
(if-let ((status ...
1
vote
Accepted
Mollyguard specific functions (delete-frame)?
A popular y/n built-in function is y-or-n-p. To write up this answer, I first typed C-h k C-x 5 0 and saw that it was bound to delete-frame with two optional arguments being FRAME and FORCE; i.e., ...
1
vote
How to force Yes/y answer to `emacs has changed since visited or saved. Save anyway?` prompt
Based on an example from the emacs wiki, the following works for me to force Emacs to overwrite external changes to the file:
(defadvice basic-save-buffer (around auto-confirm compile activate)
(cl-...
1
vote
How to prompt to ask for confirmation when C-x C-c in emacsclient?
You could try setting confirm-kill-emacs to y-or-n-p in your config:
(setq confirm-kill-emacs #'y-or-n-p)
Works for me.
1
vote
Accepted
How to prompt to ask for confirmation when C-x C-c in emacsclient?
I found the answer from https://emacs.stackexchange.com/a/30475/794
The version is tweaked version from the answer in the link
(defun ask-before-closing ()
"Prompt for confirmation for emacsclient(...
1
vote
Prompt with pre-populated minibuffer input
I think you're asking how you can tell completing-read to insert some text in the minibuffer by default, so you can append some more text that you type, to have the returned value be the result of the ...
1
vote
call write-file interactively with prompting
I have the function now working to my satisfaction, as below, but am open to suggestions if I'm not doing things optimally. In the solution below, I use function read-file-name to prompt the user, and ...
1
vote
Accepted
Show file name in delete prompt?
Function spacemacs/delete-current-buffer-file is defined in spacemacs-base/funcs.el.
You can override it with the desired function. Note that I just changed the prompt of the yes-or-no-p question.
(...
1
vote
customize evil ex prompt
No, there isn't a customizable for that (see the read-from-minibuffer call in evil-ex). Feel free to open a PR if it bothers you greatly that the colon doesn't stand out, otherwise redefining the ...
Only top scored, non community-wiki answers of a minimum length are eligible
Related Tags
prompt × 39minibuffer × 8
shell × 3
eshell × 3
find-file × 3
ssh × 3
debugging × 2
tramp × 2
completion × 2
functions × 2
term × 2
interactive × 2
gui × 2
call-interactively × 2
confirmation × 2
read-string × 2
org-mode × 1
key-bindings × 1
spacemacs × 1
org-babel × 1
python × 1
buffers × 1
evil × 1
hooks × 1
emacsclient × 1