2022 Developer Survey is open! Take survey.

Hot answers tagged

6 votes
Accepted

Prompt with pre-populated minibuffer input

I think what you need is (read-string "input: " "awesome").
user avatar
  • 10.9k
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-...
user avatar
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 ...
user avatar
  • 69.2k
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.
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-...
user avatar
  • 10.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-...
user avatar
  • 29.8k
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 ...
user avatar
  • 20.1k
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 ...
user avatar
  • 17.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 ...
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 ...
user avatar
  • 11.4k
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., ...
user avatar
  • 17.6k
1 vote
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.
user avatar
  • 224
1 vote

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 ...
user avatar
  • 11.3k
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(...
user avatar
  • 2,559
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 ...
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. (...
user avatar
  • 29.8k
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 ...
user avatar
  • 21k
1 vote
Accepted

How to automatically select an option in a specific prompt?

After delving into the innards of the minibuffer, I've developed a solution that should work for all prompting functions. It's pretty hacky though. This method intercepts the prompt function itself (...
user avatar
  • 919

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