Skip to main content
Share Your Experience: Take the 2024 Developer Survey
7 votes
Accepted

Prompt with pre-populated minibuffer input

I think what you need is (read-string "input: " "awesome").
John Kitchin's user avatar
  • 11.9k
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 ...
Drew's user avatar
  • 77.9k
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).
dalanicolai's user avatar
  • 7,865
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-...
Firmin Martin's user avatar
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.
Gilles 'SO- stop being evil''s user avatar
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-...
John Kitchin's user avatar
  • 11.9k
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-...
Tobias's user avatar
  • 33.3k
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 ...
Tyler's user avatar
  • 22.4k
2 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 ...
lawlist's user avatar
  • 19.2k
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 ...
Basil's user avatar
  • 12.5k
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.
xeruf's user avatar
  • 354
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) ...
roomworoof's user avatar
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) ...
mtraceur's user avatar
  • 356
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) ...
NickD's user avatar
  • 30.6k
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.
rpluim's user avatar
  • 5,325
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 ...
rpluim's user avatar
  • 5,325
1 vote
Accepted

Automatically kill an in-progress compilation when compile is (re)invoked?

(setq compilation-always-kill t)
user41646's user avatar
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 ...
db48x's user avatar
  • 18.3k
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 *...
NickD's user avatar
  • 30.6k
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 ...
telotortium's user avatar
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 ...
db48x's user avatar
  • 18.3k
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 ...
Rudolf Adamkovic's user avatar
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., ...
lawlist's user avatar
  • 19.2k
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-...
Hugo Ideler's user avatar
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.
eeowaa's user avatar
  • 372
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(...
CodyChan's user avatar
  • 2,649
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 ...
Drew's user avatar
  • 77.9k
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 ...
user1404316's user avatar
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. (...
Tobias's user avatar
  • 33.3k
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 ...
wasamasa's user avatar
  • 22.2k

Only top scored, non community-wiki answers of a minimum length are eligible